Просмотр исходного кода

==修改为equals

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
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);
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);


Загрузка…
Отмена
Сохранить