| | |
| | | */ |
| | | @Override |
| | | @Async("couponSendExecutor") |
| | | public CompletableFuture<R<String>> send(SendCouponDto dto) { |
| | | public R<String> send(SendCouponDto dto) { |
| | | |
| | | R<XpCoupon> coupon = xpCouponClient.getCouponById(dto.getCouponId()); |
| | | if (coupon != null) { |
| | |
| | | xpAppUserCoupon.setOpenCityId("0"); |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | }else { |
| | | Long uid = 1l; |
| | | XpAppUserCoupon xpAppUserCoupon = new XpAppUserCoupon(); |
| | | xpAppUserCoupon.setFullMoney(xpCoupon.getConditionalAmount()); |
| | | xpAppUserCoupon.setMoney(xpCoupon.getAmount()); |
| | | xpAppUserCoupon.setCouponId(dto.getCouponId()); |
| | | xpAppUserCoupon.setAppUserId(uid); |
| | | xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(100)); |
| | | xpAppUserCoupon.setStatus(0); |
| | | xpAppUserCoupon.setCouponType(xpCoupon.getCouponType()); |
| | | xpAppUserCoupon.setPhone(phone); |
| | | |
| | | xpAppUserCoupon.setCouponName(xpCoupon.getCouponName()); |
| | | xpAppUserCoupon.setOpenCityId("0"); |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return CompletableFuture.completedFuture(null); |
| | | return null; |
| | | } |
| | | |
| | | |