| | |
| | | |
| | | List<JSONObject> shareCouponRewardList = platformConfigDTO.getShareCouponRewardList(); |
| | | //[{"num":"2","couponId":6},{"num":"3","couponId":5}] |
| | | String couponIds = ""; |
| | | String couponNames = ""; |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(shareCouponRewardList)){ |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | | for (JSONObject jsonObject:shareCouponRewardList) { |
| | |
| | | for (int i = 0; i < num; i++) { |
| | | memberCouponList.add(memberCoupon); |
| | | } |
| | | couponIds = couponIds + (StringUtils.isBlank(couponIds)? ",":"" )+ couponId ; |
| | | couponNames = couponNames + (StringUtils.isBlank(couponNames)? ",":"" )+ coupon.getName() ; |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberCouponList)){ |
| | | memberCouponJoinMapper.insert(memberCouponList); |
| | | } |
| | | } |
| | | inviteRecordMapper.update(new UpdateWrapper<InviteRecord>().lambda() |
| | | .set(InviteRecord::getFirstOrderStatus,Constants.ONE) |
| | | .set(InviteRecord::getFirstFinishDate,new Date()) |
| | | .set(InviteRecord::getCouponIds,couponIds) |
| | | .set(InviteRecord::getCouponNames,couponNames) |
| | | .eq(InviteRecord::getId,inviteRecord.getId()) |
| | | ); |
| | | } |
| | | |
| | | |