瀏覽代碼

==修改为equals

release_toaliyun_real
gongbiao 7 年之前
父節點
當前提交
bb09e00b97
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java

+ 5
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java 查看文件

@@ -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);


Loading…
取消
儲存