|
|
|
@ -338,7 +338,10 @@ public class BsOrderServiceImpl implements BsOrderService { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券"); |
|
|
|
|
} |
|
|
|
|
if (discountUserRel.getStatus() != 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态不处于待使用"); |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已失效"); |
|
|
|
|
} |
|
|
|
|
if (new Date().compareTo(discountUserRel.getUseEndTime()) >= 1) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已过期,无法使用"); |
|
|
|
|
} |
|
|
|
|
discountUserRel.setStatus(2); |
|
|
|
|
discountUserRel.setUseTime(new Date()); |
|
|
|
|