| @@ -205,9 +205,21 @@ public class WxCouponChannelController extends BaseController { | |||||
| if (null == wxCouponChannel.getChannelPrice() || wxCouponChannel.getChannelPrice() < 0) { | if (null == wxCouponChannel.getChannelPrice() || wxCouponChannel.getChannelPrice() < 0) { | ||||
| return new ResultData(Result.ERROR, "价格未设置或者价格小于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 { | try { | ||||
| wxCouponChannel.updateTenantInfo(getTenantInfo()); | |||||
| wxCouponChannelService.setChannelPrice(wxCouponChannel); | wxCouponChannelService.setChannelPrice(wxCouponChannel); | ||||
| CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); | CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); | ||||
| return new ResultData(Result.SUCCESS, "设置成功", ""); | return new ResultData(Result.SUCCESS, "设置成功", ""); | ||||
| @@ -29,46 +29,52 @@ public class WxActivityJoin extends TenantEntity { | |||||
| @Excel(name = "姓名", width = 10, orderNum = "1") | @Excel(name = "姓名", width = 10, orderNum = "1") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name") | @io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name") | ||||
| private String 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") | @io.swagger.annotations.ApiModelProperty(value = "人数", name = "sex") | ||||
| private Integer number; | 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") | @io.swagger.annotations.ApiModelProperty(value = "签到状态1签到0未签到", name = "signIn") | ||||
| private Integer 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") | @io.swagger.annotations.ApiModelProperty(value = "状态0未确认-报名中1确认-报名成功2取消-报名失败3过期", name = "status") | ||||
| private Integer 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") | @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") | ||||
| private Date updateTime; | private Date updateTime; | ||||
| @@ -82,8 +88,4 @@ public class WxActivityJoin extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "状态", name = "statusStr") | @io.swagger.annotations.ApiModelProperty(value = "状态", name = "statusStr") | ||||
| private String statusStr; | private String statusStr; | ||||
| @Excel(name = "联系电话", width = 10, orderNum = "9") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "telphone") | |||||
| private String telphone; | |||||
| } | } | ||||
| @@ -134,7 +134,8 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| this.bUserName = bUserName; | 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; | private String bUserName; | ||||
| public String getbUserPhone() { | public String getbUserPhone() { | ||||
| @@ -118,7 +118,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { | |||||
| } | } | ||||
| quesAnswer.append("[").append("问题").append(i + 1).append(":").append(wxActivityJoinQuestionAnswer.getQues()) | quesAnswer.append("[").append("问题").append(i + 1).append(":").append(wxActivityJoinQuestionAnswer.getQues()) | ||||
| .append(" ").append("答案").append(":").append(wxActivityJoinQuestionAnswer.getAnswer()) | .append(" ").append("答案").append(":").append(wxActivityJoinQuestionAnswer.getAnswer()) | ||||
| .append("]"); | |||||
| .append("]\r\n"); | |||||
| activityJoin.setAnswer(quesAnswer.toString()); | activityJoin.setAnswer(quesAnswer.toString()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -272,7 +272,8 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { | |||||
| String person = join.getName(); | String person = join.getName(); | ||||
| person = StringUtils.isNotEmpty(person) ? person : ""; | 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 party = activity.getTitle(); | ||||
| String time = DateUtils.date2String(activity.getActivityStartTime()); | String time = DateUtils.date2String(activity.getActivityStartTime()); | ||||
| @@ -551,6 +551,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); | WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); | ||||
| WxCoupon wxCoupon = wxCouponService.getById(couponid,tenantEntity.getTenantId()); | WxCoupon wxCoupon = wxCouponService.getById(couponid,tenantEntity.getTenantId()); | ||||
| if(wxCoupon==null){ | if(wxCoupon==null){ | ||||
| logger.debug(couponid+ErrorCode.COUPON_IS_EMPTY.getMessage()); | logger.debug(couponid+ErrorCode.COUPON_IS_EMPTY.getMessage()); | ||||
| vo.toCouponChannnelVo(null,channelId); | vo.toCouponChannnelVo(null,channelId); | ||||
| @@ -558,6 +559,14 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| return vo; | 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()) { | if (null != channelStock && channelStock > wxCoupon.getRemainInventory()) { | ||||
| vo.toCouponChannnelVo(null,channelId); | vo.toCouponChannnelVo(null,channelId); | ||||
| vo.setErrorMsg("渠道库存不能超过券剩余总库存。"); | vo.setErrorMsg("渠道库存不能超过券剩余总库存。"); | ||||
| @@ -867,7 +867,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| } | } | ||||
| } | } | ||||
| Map<Long,String> buserPhoneMap = new HashMap<Long,String>(); | |||||
| Map<Long,WxMerchantBUser> buserPhoneMap = new HashMap<Long,WxMerchantBUser>(); | |||||
| if(bUserIdList.size() > 0){ | if(bUserIdList.size() > 0){ | ||||
| WxMerchantBUser buserQ = new WxMerchantBUser(); | WxMerchantBUser buserQ = new WxMerchantBUser(); | ||||
| buserQ.updateTenantInfo(tenantEntity); | buserQ.updateTenantInfo(tenantEntity); | ||||
| @@ -875,7 +875,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); | List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); | ||||
| if(null != bUserList && bUserList.size() > 0){ | if(null != bUserList && bUserList.size() > 0){ | ||||
| for (WxMerchantBUser bUser: bUserList) { | 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();) | //co.setChannelType();) | ||||
| if(null != co.getBUserId()){ | 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); | retList.add(co); | ||||