diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index d3213fa93..a6065f9ee 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -188,7 +188,11 @@ public class WxCouponController extends BaseController { if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); } - if(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getValidDays().intValue() <= coupon.getValidDays().intValue()){ + if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() <= coupon.getInventory().intValue() ){ + return new ResultData(ErrorCode.COUPON_STOCK_INV_ERR); + } + + if(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getValidDays().intValue() < coupon.getValidDays().intValue()){ return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); } } diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index de8d35768..fbd871021 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -114,6 +114,7 @@ public enum ErrorCode{ COUPON_SCORE_NOT_IN_RANGE(2038, "您的成长值/等级与要求不符"), COUPON_STOCK_NO_EQUAL_ERR(2039, "券库存设置要保证同增同减"), COUPON_STOCK_ENDTIME_ERR(2043, "抱歉,有效期截止时间只能增加不能减少!"), + COUPON_STOCK_INV_ERR(20144, "抱歉,库存只能增加不能减少!"), PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"), PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"), diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index c55231e77..111e98205 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -208,7 +208,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } } - WxCouponChannel wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setEndTime(endTime); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index fae2b2921..88e769a91 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -359,7 +359,7 @@ public class WxFlowServiceImpl implements WxFlowService { dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - dynamicContentMap.put("bustype","有价卷"); + dynamicContentMap.put("bustype","有价券"); dynamicContentMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(dynamicContentMap); @@ -438,7 +438,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); @@ -863,7 +863,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); @@ -885,7 +885,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); @@ -917,7 +917,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); @@ -939,7 +939,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); @@ -1087,7 +1087,7 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("bustype","有价券"); msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap);