diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index e6e2e8cfd..735258abb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -299,7 +299,7 @@ public class WxOrderServiceImpl implements WxOrderService { logger.error("券不存在, couponId: " + couponIdStr); throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); } - if (coupon.getStatus() == EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()) { + if (coupon.getStatus().equals(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode())) { logger.error("券已下架, couponId: " + couponIdStr); throw new MallinkException(ErrorCode.COUPON_ORDER_IS_INVALID); } @@ -309,7 +309,7 @@ public class WxOrderServiceImpl implements WxOrderService { logger.error("商户不存在, couponId: " + couponIdStr); throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); } - if (wxMerchant.getStatus() == EnumMerchantStatus.NOT_VALID.getCode()) { + if (wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { logger.error("商户已禁用, couponId: " + couponIdStr); throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); } @@ -442,12 +442,13 @@ public class WxOrderServiceImpl implements WxOrderService { private WxCouponOrder createCouponOrder(WxCUser user, WxOrder order, WxCoupon coupon) { Date curr = new Date(); Date valid_date = null; - if (coupon.getValidType() == EnumValidStatus.VALID_RANGE.getCode()) + if (coupon.getValidType().equals(EnumValidStatus.VALID_RANGE.getCode())){ valid_date = coupon.getValidEndDate(); + } else { Calendar calendar = Calendar.getInstance(); calendar.setTime(curr); - if (coupon.getType() != EnumCouponType.COUPON_TINGCHE.getCode()) { + if (!coupon.getType().equals(EnumCouponType.COUPON_TINGCHE.getCode())) { // 普通券精确到天 calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0);