| | |
| | | for (SendCouponDto sendCouponDto : javaList) { |
| | | Integer number = sendCouponDto.getNumber(); |
| | | for (Integer i = 0; i < number; i++) { |
| | | |
| | | |
| | | R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId()); |
| | | TCoupon coupon = couponById.getData(); |
| | | //将该优惠卷添加到用户优惠卷中 |
| | | TAppCoupon tAppCoupon = new TAppCoupon(); |
| | | tAppCoupon.setAppUserId(nowUser.getId()); |
| | | tAppCoupon.setCouponId(Integer.valueOf(sendCouponDto.getId())); |
| | | if (coupon.getValidityPeriodMode() == 1) { |
| | | tAppCoupon.setEndTime(coupon.getEndTime()); |
| | | } else { |
| | | tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); |
| | | } |
| | | tAppCoupon.setWaysToObtain(4); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | tAppCoupon.setDetailId(tAppUserVipDetail.getId()); |
| | | appCouponService.save(tAppCoupon); |
| | | R<TCoupon> couponById = otherClient.getCouponById(sendCouponDto.getId()); |
| | | TCoupon coupon = couponById.getData(); |
| | | //将该优惠卷添加到用户优惠卷中 |
| | | TAppCoupon tAppCoupon = new TAppCoupon(); |
| | | tAppCoupon.setAppUserId(nowUser.getId()); |
| | | tAppCoupon.setCouponId(Integer.valueOf(sendCouponDto.getId())); |
| | | if (coupon.getValidityPeriodMode() == 1) { |
| | | tAppCoupon.setEndTime(coupon.getEndTime()); |
| | | } else { |
| | | tAppCoupon.setEndTime(LocalDateTime.now().plusDays(coupon.getDays())); |
| | | } |
| | | tAppCoupon.setWaysToObtain(4); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | tAppCoupon.setDetailId(tAppUserVipDetail.getId()); |
| | | appCouponService.save(tAppCoupon); |
| | | } |
| | | } |
| | | }else { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |