| @@ -88,40 +88,20 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| /** | /** | ||||
| * 会员生日券处理 | * 会员生日券处理 | ||||
| * | |||||
| * @param record | * @param record | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| private WxCouponSend buildConditions(WxCouponSend record) { | private WxCouponSend buildConditions(WxCouponSend record) { | ||||
| if (!Objects.equals(record.getSendType(), EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||||
| return record ; | |||||
| if (Objects.equals(record.getSendType(), EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||||
| if (Objects.isNull(record.getTitle())) { | |||||
| record.setTitle(""); | |||||
| } | |||||
| if (Objects.isNull(record.getCouponId())) { | |||||
| record.setCouponId(0L); | |||||
| } | |||||
| return record; | |||||
| } | } | ||||
| // //会员生日券 | |||||
| // JSONObject conditions = JSONObject.parseObject(record.getConditions()); | |||||
| // Long couponId = record.getCouponId(); | |||||
| // if (Objects.nonNull(couponId)) { | |||||
| // JSONArray couponIds; | |||||
| // if (Objects.isNull(record.getId())) { | |||||
| // //添加新卡券 | |||||
| // couponIds = new JSONArray(); | |||||
| // couponIds.add(couponId); | |||||
| // } else { | |||||
| // //更新卡券列表 | |||||
| // WxCouponSend couponSend = wxCouponSendMapper.selectByPrimaryKey(record.getId()); | |||||
| // JSONObject couponSendJo = JSONObject.parseObject(couponSend.getConditions()); | |||||
| // couponIds = couponSendJo.getJSONArray(WxCouponSend.KEY_COUPONIDS); | |||||
| // if (Objects.isNull(couponIds)) { | |||||
| // couponIds = new JSONArray(); | |||||
| // couponIds.add(couponId); | |||||
| // } else { | |||||
| // //添加新卡券 | |||||
| // if (!couponIds.contains(couponId)) { | |||||
| // couponIds.add(couponId); | |||||
| // } | |||||
| // } | |||||
| // } | |||||
| // conditions.put(WxCouponSend.KEY_COUPONIDS, couponIds); | |||||
| // } | |||||
| // record.setConditions(conditions.toJSONString()); | |||||
| return record; | return record; | ||||
| } | } | ||||