diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java index fb6683750..a13751591 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java @@ -10,7 +10,6 @@ import com.iformall.domain.po.WxCouponChannel; import org.apache.ibatis.annotations.CacheNamespace; import org.apache.ibatis.annotations.Param; -@CacheNamespace public interface WxCouponChannelMapper extends CommonMapper { List findList(WxCouponChannel wxCouponChannel); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index ebdc457b0..4499e8443 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -9,7 +9,6 @@ import org.apache.ibatis.annotations.CacheNamespace; import org.apache.ibatis.annotations.Param; import com.iformall.domain.po.WxCoupon; -@CacheNamespace public interface WxCouponMapper extends CommonMapper { List findPressData(WxCoupon wxCoupon); List findCouponData(WxCoupon wxCoupon); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 9d7f513ad..a013bba60 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -588,12 +588,14 @@ public class WxCouponServiceImpl implements WxCouponService { // 库存 是否改变 bChanged = true; } - if(wxCoupon.getInventory()-wxCoupon.getRemainInventory() != oldCoupon.getInventory() - oldCoupon.getRemainInventory()) { + Integer newSale = wxCoupon.getInventory()-wxCoupon.getRemainInventory(); + Integer oldSale = oldCoupon.getInventory() - oldCoupon.getRemainInventory(); + if (!newSale.equals(oldSale)) { // 已售卖数不变 - logger.error("已售卖数不变"); - return new ResultData(ErrorCode.COUPON_STOCK_ERR.getCode(), "已售卖数不变"); + logger.error("券库存要保证同增同减"); + return new ResultData(ErrorCode.COUPON_STOCK_ERR.getCode(), "券库存要保证同增同减"); } - if(wxCoupon.getValidType() != oldCoupon.getValidType()) { + if (!wxCoupon.getValidType().equals(oldCoupon.getValidType())) { // 券有效期类型不能改变 logger.error("券有效期类型不能改变"); return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR.getCode(), "券有效期类型不能改变"); @@ -625,7 +627,9 @@ public class WxCouponServiceImpl implements WxCouponService { wxCoupon.setOrgInventory(oldCoupon.getInventory()); wxCoupon.setOrgRemainInventory(oldCoupon.getRemainInventory()); - if((wxCoupon.getRemainInventory() - wxCoupon.getOrgRemainInventory()) != (wxCoupon.getInventory() - wxCoupon.getOrgInventory())) { + Integer newSale1 = wxCoupon.getRemainInventory() - wxCoupon.getOrgRemainInventory(); + Integer oldSale1 = wxCoupon.getInventory() - wxCoupon.getOrgInventory(); + if (!newSale1.equals(oldSale1)) { // 库存要保证,同增同减 logger.error("券库存要保证同增同减"); return new ResultData(ErrorCode.COUPON_STOCK_NO_EQUAL_ERR);