| | |
| | | return R.ok(appUserCoupon.getMoney()); |
| | | } |
| | | |
| | | /** |
| | | * 退回用户的优惠卷 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/appUserCoupon/backUserCoupon") |
| | | public R<BigDecimal> backUserCoupon(@RequestBody UseUserCouponDto dto) { |
| | | if(dto.getUserCouponId() == null){ |
| | | return R.ok(); |
| | | } |
| | | XpAppUserCoupon appUserCoupon = xpAppUserCouponService.getById(dto.getUserCouponId()); |
| | | //状态(1=未使用,2=已使用,3=已过期) |
| | | if(appUserCoupon.getExpirationTime().isAfter(LocalDateTime.now())){ |
| | | appUserCoupon.setStatus(3); |
| | | }else{ |
| | | appUserCoupon.setStatus(1); |
| | | } |
| | | appUserCoupon.setUseTime(null); |
| | | appUserCoupon.setAppUserId(null); |
| | | xpAppUserCouponService.updateById(appUserCoupon); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |