Browse Source

[库存][修改]:库存保证同增同减

release_toaliyun_real
Stormeye Wu 7 years ago
parent
commit
619910eefc
2 changed files with 6 additions and 0 deletions
  1. +1
    -0
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  2. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java

+ 1
- 0
mallinkService/src/main/java/com/iformall/common/ErrorCode.java View File

@@ -112,6 +112,7 @@ public enum ErrorCode{
COUPON_STOCK_DATE_NO_CAR(2037, "券库存不支持停车券"), COUPON_STOCK_DATE_NO_CAR(2037, "券库存不支持停车券"),
COUPON_ONLY_FOR_NEW_MEMBER(2038, "您已参加过新会员活动"), COUPON_ONLY_FOR_NEW_MEMBER(2038, "您已参加过新会员活动"),
COUPON_SCORE_NOT_IN_RANGE(2038, "您的成长值/等级与要求不符"), COUPON_SCORE_NOT_IN_RANGE(2038, "您的成长值/等级与要求不符"),
COUPON_STOCK_NO_EQUAL_ERR(2039, "券库存设置要保证同增同减"),


PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"), PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"),
PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"), PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"),


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -579,6 +579,11 @@ public class WxCouponServiceImpl implements WxCouponService {


wxCoupon.setOrgInventory(oldCoupon.getInventory()); wxCoupon.setOrgInventory(oldCoupon.getInventory());
wxCoupon.setOrgRemainInventory(oldCoupon.getRemainInventory()); wxCoupon.setOrgRemainInventory(oldCoupon.getRemainInventory());
if((wxCoupon.getRemainInventory() - wxCoupon.getOrgRemainInventory()) != (wxCoupon.getInventory() - wxCoupon.getOrgInventory())) {
// 库存要保证,同增同减
logger.error("券库存要保证同增同减");
return new ResultData(ErrorCode.COUPON_STOCK_NO_EQUAL_ERR);
}


int ret = wxCouponMapper.updateStockAndValidDate(wxCoupon); int ret = wxCouponMapper.updateStockAndValidDate(wxCoupon);
if(ret != 1) { if(ret != 1) {


Loading…
Cancel
Save