diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java index db8d315c4..22c79f62f 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -205,9 +205,21 @@ public class WxCouponChannelController extends BaseController { if (null == wxCouponChannel.getChannelPrice() || wxCouponChannel.getChannelPrice() < 0) { return new ResultData(Result.ERROR, "价格未设置或者价格小于0, 如不需要可点击解除价格设置."); } - + wxCouponChannel.updateTenantInfo(getTenantInfo()); + //免费券不能设置有价 + WxCouponChannel cc = wxCouponChannelService.getById(wxCouponChannel.getId(), wxCouponChannel.getTenantId()); + if (null == cc ) { + return new ResultData(Result.ERROR, "id无效."); + } + WxCoupon coupon = wxCouponService.getById(cc.getCouponId(), wxCouponChannel.getTenantId()); + if (null == coupon ) { + return new ResultData(Result.ERROR, "优惠券不存在."); + } + if (coupon.getSalePrice() <= 0) { + return new ResultData(Result.ERROR, "免费券不能设置渠道价格."); + } try { - wxCouponChannel.updateTenantInfo(getTenantInfo()); + wxCouponChannelService.setChannelPrice(wxCouponChannel); CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); return new ResultData(Result.SUCCESS, "设置成功", ""); diff --git a/mallinkAdmin/src/main/resources/db/migration/V2022052700001__activity.sql b/mallinkAdmin/src/main/resources/db/migration/V2022052700001__activity.sql new file mode 100644 index 000000000..b52273c4b --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2022052700001__activity.sql @@ -0,0 +1,2 @@ +ALTER TABLE `mallink`.`wx_activity_join` ADD COLUMN `age` int(3) COMMENT '年龄'; +ALTER TABLE `mallink`.`wx_activity_join` ADD COLUMN `number` int(9) COMMENT '人数'; \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/doc/抖音小程序/poi_匹配模板.xlsx b/mallinkAdmin/src/main/resources/doc/抖音小程序/poi_匹配模板.xlsx new file mode 100644 index 000000000..8e2db13c9 Binary files /dev/null and b/mallinkAdmin/src/main/resources/doc/抖音小程序/poi_匹配模板.xlsx differ diff --git a/mallinkAdmin/src/main/resources/doc/抖音小程序/商家授权函 模板.docx b/mallinkAdmin/src/main/resources/doc/抖音小程序/商家授权函 模板.docx new file mode 100644 index 000000000..861cbb4f9 Binary files /dev/null and b/mallinkAdmin/src/main/resources/doc/抖音小程序/商家授权函 模板.docx differ diff --git a/mallinkAdmin/src/main/resources/doc/抖音小程序/富茂抖音小城操作流程SOP.docx b/mallinkAdmin/src/main/resources/doc/抖音小程序/富茂抖音小城操作流程SOP.docx new file mode 100644 index 000000000..821df399d Binary files /dev/null and b/mallinkAdmin/src/main/resources/doc/抖音小程序/富茂抖音小城操作流程SOP.docx differ diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java b/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java index 1da64aa54..4fdd980c7 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java @@ -29,38 +29,52 @@ public class WxActivityJoin extends TenantEntity { @Excel(name = "姓名", width = 10, orderNum = "1") @io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name") private String name; - - @Excel(name = "微信昵称", width = 10, orderNum = "4") - @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "nickName") - private String nickName; - - @Excel(name = "生日", format = "yyyy-MM-dd", width = 10, orderNum = "5") - @io.swagger.annotations.ApiModelProperty(value = "生日", name = "birthday") - private Date birthday; - - @Excel(name = "性别", replace = {"保密_0", "男_1", "女_2"}, width = 10, orderNum = "3") + + @Excel(name = "电话号码", width = 10, orderNum = "2") + @io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone") + private String phone; + + @Excel(name = "人数", width = 10, orderNum = "3") + @io.swagger.annotations.ApiModelProperty(value = "人数", name = "sex") + private Integer number; + + @Excel(name = "年龄", width = 10, orderNum = "4") + @io.swagger.annotations.ApiModelProperty(value = "年龄", name = "sex") + private Integer age; + + @Excel(name = "性别", replace = {"保密_0", "男_1", "女_2"}, width = 10, orderNum = "5") @io.swagger.annotations.ApiModelProperty(value = "性别0保密1男2女", name = "sex") private Integer sex; + + @Excel(name = "生日", format = "yyyy-MM-dd", width = 10, orderNum = "6") + @io.swagger.annotations.ApiModelProperty(value = "生日", name = "birthday") + private Date birthday; - @io.swagger.annotations.ApiModelProperty(value = "地址", name = "address") - private String address; + @Excel(name = "微信昵称", width = 10, orderNum = "7") + @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "nickName") + private String nickName; - @Excel(name = "电话号码", width = 10, orderNum = "2") - @io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone") - private String phone; + @Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 10, orderNum = "8") + @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") + private Date createTime; - @Excel(name = "调查问券", width = 10, orderNum = "50") - @io.swagger.annotations.ApiModelProperty(value = "调查问券", name = "answer") - private String answer; - @Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "7") + @Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "9") @io.swagger.annotations.ApiModelProperty(value = "签到状态1签到0未签到", name = "signIn") private Integer signIn; - @Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 10, orderNum = "8") + + @Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 10, orderNum = "10") @io.swagger.annotations.ApiModelProperty(value = "状态0未确认-报名中1确认-报名成功2取消-报名失败3过期", name = "status") private Integer status; - @Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 10, orderNum = "6") - @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") - private Date createTime; + + @Excel(name = "调查问券", width = 10, orderNum = "11") + @io.swagger.annotations.ApiModelProperty(value = "调查问券", name = "answer") + private String answer; + + + + @io.swagger.annotations.ApiModelProperty(value = "地址", name = "address") + private String address; + @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") private Date updateTime; @@ -74,8 +88,4 @@ public class WxActivityJoin extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "状态", name = "statusStr") private String statusStr; - @Excel(name = "联系电话", width = 10, orderNum = "9") - @io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "telphone") - private String telphone; - } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java index 9910962d6..34f65d7cc 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -134,7 +134,8 @@ public class WxCouponOrderBVo extends WxCouponOrder { this.bUserName = bUserName; } - @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName") + @Excel(name = "b端核销员工姓名", width = 50, orderNum = "5") + @io.swagger.annotations.ApiModelProperty(value="b端核销员工姓名",name="bUserName") private String bUserName; public String getbUserPhone() { @@ -152,8 +153,8 @@ public class WxCouponOrderBVo extends WxCouponOrder { public void setbuserPhone(String bUserPhone) { this.bUserPhone = bUserPhone; } -// @Excel(name = "商户操作人", width = 50, orderNum = "5") - @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") + @Excel(name = "b端核销手机号", width = 50, orderNum = "5") + @io.swagger.annotations.ApiModelProperty(value="b端核销手机号",name="bUserPhone") private String bUserPhone; @Excel(name = "所属商户", width = 50, orderNum = "3") @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java index a055c4f7d..9b55c01ac 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java @@ -118,7 +118,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { } quesAnswer.append("[").append("问题").append(i + 1).append(":").append(wxActivityJoinQuestionAnswer.getQues()) .append(" ").append("答案").append(":").append(wxActivityJoinQuestionAnswer.getAnswer()) - .append("]"); + .append("]\r\n"); activityJoin.setAnswer(quesAnswer.toString()); } } @@ -272,7 +272,8 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { String person = join.getName(); person = StringUtils.isNotEmpty(person) ? person : ""; //找出用户手机号 联系电话为空时 使用授权手机号 - String phone = StringUtils.isNotEmpty(join.getTelphone()) ? join.getTelphone() : join.getPhone(); + //String phone = StringUtils.isNotEmpty(join.getTelphone()) ? join.getTelphone() : join.getPhone(); + String phone = join.getPhone(); //活动名 String party = activity.getTitle(); String time = DateUtils.date2String(activity.getActivityStartTime()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 479d98bfa..e238863e5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -551,6 +551,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); WxCoupon wxCoupon = wxCouponService.getById(couponid,tenantEntity.getTenantId()); + if(wxCoupon==null){ logger.debug(couponid+ErrorCode.COUPON_IS_EMPTY.getMessage()); vo.toCouponChannnelVo(null,channelId); @@ -558,6 +559,14 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { return vo; } + if(null != channelPrice) { + if (wxCoupon.getSalePrice() <= 0 && channelPrice > 0) { + vo.toCouponChannnelVo(null,channelId); + vo.setErrorMsg("券为免费券,不能设置渠道价格"); + return vo; + } + } + if (null != channelStock && channelStock > wxCoupon.getRemainInventory()) { vo.toCouponChannnelVo(null,channelId); vo.setErrorMsg("渠道库存不能超过券剩余总库存。"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index e1bd7fdf0..41ba881d9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -843,8 +843,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { //循环list,获取 cUserId List cUserIdList = new ArrayList(); -// List bUserIdList = new ArrayList(); -// List merchantIdList = new ArrayList(); + List bUserIdList = new ArrayList(); + List merchantIdList = new ArrayList(); List couponIdList = new ArrayList(); for (int i = 0 ; i < list.size() ; i ++ ) { WxCouponOrder bo = list.get(i); @@ -852,39 +852,39 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { if (null != cusrid && (!cUserIdList.contains(cusrid))) { cUserIdList.add(cusrid); } -// Long bUserId = bo.getBUserId(); -// if(null != bUserId && (!bUserIdList.contains(bUserId))){ -// bUserIdList.add(bUserId); -// } - -// Long bmerchantId = bo.getBMerchantId(); -// if (null != bmerchantId && (!merchantIdList.contains(bmerchantId))) { -// merchantIdList.add(bmerchantId); -// } + Long bUserId = bo.getBUserId(); + if(null != bUserId && (!bUserIdList.contains(bUserId))){ + bUserIdList.add(bUserId); + } + + Long bmerchantId = bo.getBMerchantId(); + if (null != bmerchantId && (!merchantIdList.contains(bmerchantId))) { + merchantIdList.add(bmerchantId); + } Long couponId = bo.getCouponId(); if (null != couponId && (!couponIdList.contains(couponId))) { couponIdList.add(couponId); } } -// Map buserPhoneMap = new HashMap(); -// if(bUserIdList.size() > 0){ -// WxMerchantBUser buserQ = new WxMerchantBUser(); -// buserQ.updateTenantInfo(tenantEntity); -// buserQ.setIds(bUserIdList); -// List bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); -// if(null != bUserList && bUserList.size() > 0){ -// for (WxMerchantBUser bUser: bUserList) { -// buserPhoneMap.put(bUser.getId(),bUser.getPhone()); -// } -// } -// } + Map buserPhoneMap = new HashMap(); + if(bUserIdList.size() > 0){ + WxMerchantBUser buserQ = new WxMerchantBUser(); + buserQ.updateTenantInfo(tenantEntity); + buserQ.setIds(bUserIdList); + List bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); + if(null != bUserList && bUserList.size() > 0){ + for (WxMerchantBUser bUser: bUserList) { + buserPhoneMap.put(bUser.getId(),bUser); + } + } + } Map merchantNameMap = new HashMap(); -// if (null != merchantIdList && merchantIdList.size() > 0 ) { + if (null != merchantIdList && merchantIdList.size() > 0 ) { WxMerchant merchantQ = new WxMerchant(); merchantQ.updateTenantInfo(tenantEntity); -// merchantQ.setIds(merchantIdList); + merchantQ.setIds(merchantIdList); List merchantList = wxMerchantMapper.findIdNameList(merchantQ); if (null != merchantList) { for (int i = 0 ; i < merchantList.size() ; i ++) { @@ -892,7 +892,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { merchantNameMap.put(m.getId(), m.getName()); } } -// } + } Map couponMap = new HashMap(); Map merchantProductIdMap = new HashMap(); @@ -921,22 +921,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } } -// Map merchantProductIdMap = new HashMap(); -// if (null != merchantIdList && merchantIdList.size() > 0 ) { -// List merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), couponIdList); -// if (null != merchantProductVos) { -// for (int i = 0 ; i < merchantProductVos.size(); i ++) { -// WxMerchantProductVo mp = merchantProductVos.get(i); -// if (mp.getMc() > 1) { -// merchantProductIdMap.put(mp.getProductId(), -999L); -// }else { -// merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId()); -// } -// } -// } -// } - - Map cUserMap = new HashMap(); if (cUserIdList.size() > 0) { WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo(); @@ -1009,9 +993,13 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { co.setVerifyMerchantName(merchantNameMap.get(bMechantId)); } //co.setChannelType();) -// if(null != co.getBUserId()){ -// co.setbUserPhone(buserPhoneMap.get(co.getBUserId())); -// } + if(null != co.getBUserId()){ + WxMerchantBUser buser = buserPhoneMap.get(co.getBUserId()); + if (null != buser) { + co.setbUserPhone(buser.getPhone()); + co.setbuserName(buser.getName()); + } + } retList.add(co); } catch (IllegalAccessException e) { diff --git a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml index 6b0c8df46..f46739123 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml @@ -11,6 +11,8 @@ + + @@ -24,7 +26,7 @@ - `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`, + `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`age`,`number`,`phone`, `address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg`