Commit b491437e by liwenjun

退款修改优惠券状态

parent 2d780206
......@@ -2304,12 +2304,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// }
// 是否满足退款
boolean isRefunds;
SConsumerCoupon coupon = null;
if (ObjectUtil.isNotNull(sOrder.getCouponId())) {
SConsumerCoupon coupon = consumerCouponService.getById(sOrder.getCouponId());
coupon = consumerCouponService.getById(sOrder.getCouponId());
// 判断是否可以退款
isRefunds = isRefund(sOrder, coupon);
coupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
consumerCouponService.updateById(coupon);
} else {
// 判断是否可以退款
isRefunds = isRefund(sOrder, null);
......@@ -2375,8 +2374,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
//微信退款
// if (sOrder.getPayType().equals(PayTypeEnum.WECHAT.getCode()) && request.getAmount().compareTo(BigDecimal.ZERO) == 0) {
// 退款task, 定时任务退优惠券
redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, sOrder.getId());
// redisUtil.lPush(Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER, sOrder.getId());
// }
// 退优惠券
if (coupon != null) {
coupon.setUseStatus(UserStatusEnum.UNUSED.getCode());
consumerCouponService.updateById(coupon);
}
execute = Boolean.TRUE;
} catch (Exception e) {
logger.error(e.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment