| @@ -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, "设置成功", ""); | |||
| @@ -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 '人数'; | |||
| @@ -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; | |||
| } | |||
| @@ -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") | |||
| @@ -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()); | |||
| @@ -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("渠道库存不能超过券剩余总库存。"); | |||
| @@ -843,8 +843,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| //循环list,获取 cUserId | |||
| List<Long> cUserIdList = new ArrayList<Long>(); | |||
| // List<Long> bUserIdList = new ArrayList<Long>(); | |||
| // List<Long> merchantIdList = new ArrayList<Long>(); | |||
| List<Long> bUserIdList = new ArrayList<Long>(); | |||
| List<Long> merchantIdList = new ArrayList<Long>(); | |||
| List<Long> couponIdList = new ArrayList<Long>(); | |||
| 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<Long,String> buserPhoneMap = new HashMap<Long,String>(); | |||
| // if(bUserIdList.size() > 0){ | |||
| // WxMerchantBUser buserQ = new WxMerchantBUser(); | |||
| // buserQ.updateTenantInfo(tenantEntity); | |||
| // buserQ.setIds(bUserIdList); | |||
| // List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); | |||
| // if(null != bUserList && bUserList.size() > 0){ | |||
| // for (WxMerchantBUser bUser: bUserList) { | |||
| // buserPhoneMap.put(bUser.getId(),bUser.getPhone()); | |||
| // } | |||
| // } | |||
| // } | |||
| Map<Long,WxMerchantBUser> buserPhoneMap = new HashMap<Long,WxMerchantBUser>(); | |||
| if(bUserIdList.size() > 0){ | |||
| WxMerchantBUser buserQ = new WxMerchantBUser(); | |||
| buserQ.updateTenantInfo(tenantEntity); | |||
| buserQ.setIds(bUserIdList); | |||
| List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ); | |||
| if(null != bUserList && bUserList.size() > 0){ | |||
| for (WxMerchantBUser bUser: bUserList) { | |||
| buserPhoneMap.put(bUser.getId(),bUser); | |||
| } | |||
| } | |||
| } | |||
| Map<Long,String> merchantNameMap = new HashMap<Long,String>(); | |||
| // 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<WxMerchant> 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<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>(); | |||
| Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>(); | |||
| @@ -921,22 +921,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| } | |||
| // Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>(); | |||
| // if (null != merchantIdList && merchantIdList.size() > 0 ) { | |||
| // List<WxMerchantProductVo> 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<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>(); | |||
| 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) { | |||
| @@ -11,6 +11,8 @@ | |||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName"/> | |||
| <result column="birthday" jdbcType="TIMESTAMP" property="birthday"/> | |||
| <result column="sex" jdbcType="INTEGER" property="sex"/> | |||
| <result column="age" jdbcType="INTEGER" property="age"/> | |||
| <result column="number" jdbcType="INTEGER" property="number"/> | |||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||
| <result column="address" jdbcType="VARCHAR" property="address"/> | |||
| <result column="answer" jdbcType="VARCHAR" property="answer"/> | |||
| @@ -24,7 +26,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `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` | |||
| </sql> | |||