| @@ -299,7 +299,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| logger.error("券不存在, couponId: " + couponIdStr); | logger.error("券不存在, couponId: " + couponIdStr); | ||||
| throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); | 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); | logger.error("券已下架, couponId: " + couponIdStr); | ||||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_INVALID); | throw new MallinkException(ErrorCode.COUPON_ORDER_IS_INVALID); | ||||
| } | } | ||||
| @@ -309,7 +309,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| logger.error("商户不存在, couponId: " + couponIdStr); | logger.error("商户不存在, couponId: " + couponIdStr); | ||||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | 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); | logger.error("商户已禁用, couponId: " + couponIdStr); | ||||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_VALID); | 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) { | private WxCouponOrder createCouponOrder(WxCUser user, WxOrder order, WxCoupon coupon) { | ||||
| Date curr = new Date(); | Date curr = new Date(); | ||||
| Date valid_date = null; | Date valid_date = null; | ||||
| if (coupon.getValidType() == EnumValidStatus.VALID_RANGE.getCode()) | |||||
| if (coupon.getValidType().equals(EnumValidStatus.VALID_RANGE.getCode())){ | |||||
| valid_date = coupon.getValidEndDate(); | valid_date = coupon.getValidEndDate(); | ||||
| } | |||||
| else { | else { | ||||
| Calendar calendar = Calendar.getInstance(); | Calendar calendar = Calendar.getInstance(); | ||||
| calendar.setTime(curr); | 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.HOUR_OF_DAY, 0); | ||||
| calendar.set(Calendar.MINUTE, 0); | calendar.set(Calendar.MINUTE, 0); | ||||