diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 48c1ebf..225c525 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -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());