|
|
@ -172,10 +172,9 @@ public class HighUserCouponServiceImpl implements HighUserCouponService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void expiredCoupon() { |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
|
// 查询过期的卡券
|
|
|
|
public void expiredCoupon(Long userCouponId) { |
|
|
|
List<HighUserCoupon> userCoupons = getOverdueCoupon(); |
|
|
|
HighUserCoupon highUserCoupon = highUserCouponMapper.selectByPrimaryKey(userCouponId); |
|
|
|
for (HighUserCoupon highUserCoupon : userCoupons) { |
|
|
|
|
|
|
|
highUserCoupon.setStatus(0); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCoupon.setStatus(0); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
highUserCoupon.setQrCodeImg(null); |
|
|
|
highUserCoupon.setQrCodeImg(null); |
|
|
|
updateUserCoupon(highUserCoupon); |
|
|
|
updateUserCoupon(highUserCoupon); |
|
|
@ -185,14 +184,14 @@ public class HighUserCouponServiceImpl implements HighUserCouponService { |
|
|
|
couponCode.setChildOrderId(null); |
|
|
|
couponCode.setChildOrderId(null); |
|
|
|
couponCode.setReceiveTime(null); |
|
|
|
couponCode.setReceiveTime(null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HighUser highUser = highUserService.findByUserId(highUserCoupon.getUserId()); |
|
|
|
|
|
|
|
|
|
|
|
// 查询卡券信息
|
|
|
|
// 查询卡券信息
|
|
|
|
HighCoupon coupon = highCouponService.getCouponById(highUserCoupon.getCouponId()); |
|
|
|
HighCoupon coupon = highCouponService.getCouponById(highUserCoupon.getCouponId()); |
|
|
|
|
|
|
|
|
|
|
|
HighChildOrder childOrder = highOrderService.getChildOrderById(couponCode.getChildOrderId()); |
|
|
|
HighChildOrder childOrder = highOrderService.getChildOrderById(couponCode.getChildOrderId()); |
|
|
|
HighOrder order = highOrderService.getOrderById(childOrder.getId()); |
|
|
|
HighOrder order = highOrderService.getOrderById(childOrder.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 归库记录
|
|
|
|
// 归库记录
|
|
|
|
HighCouponRecycle highCouponRecycle = new HighCouponRecycle(); |
|
|
|
HighCouponRecycle highCouponRecycle = new HighCouponRecycle(); |
|
|
|
highCouponRecycle.setCouponId(coupon.getId()); |
|
|
|
highCouponRecycle.setCouponId(coupon.getId()); |
|
|
@ -206,10 +205,12 @@ public class HighUserCouponServiceImpl implements HighUserCouponService { |
|
|
|
highCouponRecycle.setOrderNo(order.getOrderNo()); |
|
|
|
highCouponRecycle.setOrderNo(order.getOrderNo()); |
|
|
|
highCouponRecycle.setChildOrderId(childOrder.getId()); |
|
|
|
highCouponRecycle.setChildOrderId(childOrder.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
highCouponRecycle.setUserId(highUser.getId()); |
|
|
|
|
|
|
|
highCouponRecycle.setUserPhone(highUser.getPhone()); |
|
|
|
|
|
|
|
|
|
|
|
highCouponRecycle.setType(1); // 类型:1.过期 2.退款
|
|
|
|
highCouponRecycle.setType(1); // 类型:1.过期 2.退款
|
|
|
|
highCouponRecycle.setReceiveTime(highUserCoupon.getCreateTime()); // 领取时间
|
|
|
|
highCouponRecycle.setReceiveTime(highUserCoupon.getCreateTime()); // 领取时间
|
|
|
|
highCouponRecycle.setCreateTime(new Date()); |
|
|
|
highCouponRecycle.setCreateTime(new Date()); |
|
|
|
highCouponRecycleService.insertCouponRecycle(highCouponRecycle); |
|
|
|
highCouponRecycleService.insertCouponRecycle(highCouponRecycle); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|