| | |
| | | @PostMapping("/grantCoupon") |
| | | public R grantCoupon(@RequestBody GrantCouponDto dto){ |
| | | List<TAppCoupon> res = new ArrayList<>(); |
| | | TCoupon coupon = otherClient.getCouponById(dto.getCouponId()).getData(); |
| | | |
| | | switch (dto.getType()){ |
| | | case 1: |
| | | // 根据标签ids 查询用户ids |
| | |
| | | tAppCoupon.setEndTime(dto.getEndTime()); |
| | | tAppCoupon.setWaysToObtain(dto.getWaysToObtain()); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | res.add(tAppCoupon); |
| | | } |
| | | tAppCouponService.saveBatch(res); |
| | |
| | | tAppCoupon.setEndTime(dto.getEndTime()); |
| | | tAppCoupon.setWaysToObtain(dto.getWaysToObtain()); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | res.add(tAppCoupon); |
| | | } |
| | | tAppCouponService.saveBatch(res); |
| | |
| | | tAppCoupon.setEndTime(dto.getEndTime()); |
| | | tAppCoupon.setWaysToObtain(dto.getWaysToObtain()); |
| | | tAppCoupon.setStatus(1); |
| | | tAppCoupon.setCouponJson(JSON.toJSONString(coupon)); |
| | | res.add(tAppCoupon); |
| | | } |
| | | tAppCouponService.saveBatch(res); |