From 665bd634e31ba7674551dd1dc07de423bee5a467 Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 27 May 2022 16:54:32 +0800 Subject: [PATCH] fix --- .../market/WxCouponChannelController.java | 16 ++++- .../iformall/domain/po/WxActivityJoin.java | 68 ++++++++++--------- .../iformall/domain/vo/WxCouponOrderBVo.java | 3 +- .../impl/WxActivityJoinServiceImpl.java | 5 +- .../impl/WxCouponChannelServiceImpl.java | 9 +++ .../impl/WxCouponOrderServiceImpl.java | 10 ++- 6 files changed, 70 insertions(+), 41 deletions(-) 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/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java b/mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java index 05a36795e..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,46 +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") - @io.swagger.annotations.ApiModelProperty(value = "性别0保密1男2女", name = "sex") - private Integer sex; - @Excel(name = "年龄", width = 10) - @io.swagger.annotations.ApiModelProperty(value = "年龄", name = "sex") - private Integer age; + @Excel(name = "电话号码", width = 10, orderNum = "2") + @io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone") + private String phone; - @Excel(name = "人数", width = 10) + @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; @@ -82,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 be8ab6571..3f6286779 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() { 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 873d5a6e5..41ba881d9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -867,7 +867,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } } - Map buserPhoneMap = new HashMap(); + Map buserPhoneMap = new HashMap(); if(bUserIdList.size() > 0){ WxMerchantBUser buserQ = new WxMerchantBUser(); buserQ.updateTenantInfo(tenantEntity); @@ -875,7 +875,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { List bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); if(null != bUserList && bUserList.size() > 0){ for (WxMerchantBUser bUser: bUserList) { - buserPhoneMap.put(bUser.getId(),bUser.getPhone()); + buserPhoneMap.put(bUser.getId(),bUser); } } } @@ -994,7 +994,11 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } //co.setChannelType();) if(null != co.getBUserId()){ - co.setbUserPhone(buserPhoneMap.get(co.getBUserId())); + WxMerchantBUser buser = buserPhoneMap.get(co.getBUserId()); + if (null != buser) { + co.setbUserPhone(buser.getPhone()); + co.setbuserName(buser.getName()); + } } retList.add(co);