|
|
|
@ -135,19 +135,19 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { |
|
|
|
|
map.put("status", "1"); |
|
|
|
|
map.put("couponCodeId", code.getId()); |
|
|
|
|
List<HighUserCoupon> list = highUserCouponService.getUserCouponList(map); |
|
|
|
|
for (HighUserCoupon userCoupon : list) { |
|
|
|
|
userCoupon.setStatus(2); |
|
|
|
|
userCoupon.setConsumeTime(useTime); |
|
|
|
|
|
|
|
|
|
HighChildOrder order = highOrderService.getChildOrderByUserGoods(userCoupon.getUserId(), 1, userCoupon.getCouponId()); |
|
|
|
|
if (order == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
for (HighUserCoupon userCoupon : list) { |
|
|
|
|
userCoupon.setStatus(2); |
|
|
|
|
userCoupon.setConsumeTime(useTime); |
|
|
|
|
HighChildOrder order = highOrderService.getChildOrderByUserGoods(userCoupon.getUserId(), 1, userCoupon.getCouponId()); |
|
|
|
|
if (order == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|
|
} |
|
|
|
|
userCoupon.setConsumeTime(new Date()); |
|
|
|
|
userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
highUserCouponService.updateUserCoupon(userCoupon); |
|
|
|
|
highOrderService.childOrderComplete(order.getId()); |
|
|
|
|
} |
|
|
|
|
userCoupon.setConsumeTime(new Date()); |
|
|
|
|
userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用
|
|
|
|
|
highUserCouponService.updateUserCoupon(userCoupon); |
|
|
|
|
|
|
|
|
|
highOrderService.childOrderComplete(order.getId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|