Merge branch 'test6.9.6' of http://git.yoho.cn/ufo/ufo-platform into test6.9.6
Showing
1 changed file
with
7 additions
and
3 deletions
@@ -171,8 +171,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -171,8 +171,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
171 | 171 | ||
172 | jsonObject.put("coupons",couponQueryResps); | 172 | jsonObject.put("coupons",couponQueryResps); |
173 | return new ApiResponse.ApiResponseBuilder().data(jsonObject).build(); | 173 | return new ApiResponse.ApiResponseBuilder().data(jsonObject).build(); |
174 | + | ||
174 | } | 175 | } |
175 | 176 | ||
177 | + | ||
178 | + private static final String SKUP_FORBID_TYPE_NONE = "0"; | ||
176 | @Override | 179 | @Override |
177 | public ApiResponse saveOrUpdateCoupon(CouponSaveUpdateReq req) { | 180 | public ApiResponse saveOrUpdateCoupon(CouponSaveUpdateReq req) { |
178 | LOGGER.info("enter saveOrUpdateCoupon,param is {}",req); | 181 | LOGGER.info("enter saveOrUpdateCoupon,param is {}",req); |
@@ -191,10 +194,13 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -191,10 +194,13 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
191 | if (!limitType.matches("\\d+")){ | 194 | if (!limitType.matches("\\d+")){ |
192 | throw new ServiceException(400, "错误:不合法的限制类型"); | 195 | throw new ServiceException(400, "错误:不合法的限制类型"); |
193 | } | 196 | } |
194 | - if (!SkupType.of(Integer.parseInt(limitType)).isPresent()){ | 197 | + if (!SkupType.of(Integer.parseInt(limitType)).isPresent() && !SKUP_FORBID_TYPE_NONE.equals(limitType)){ |
195 | throw new ServiceException(401, "错误:不合法的限制类型"); | 198 | throw new ServiceException(401, "错误:不合法的限制类型"); |
196 | } | 199 | } |
197 | } | 200 | } |
201 | + }else{ | ||
202 | + // 无禁止 | ||
203 | + req.setSkupForbidType(SKUP_FORBID_TYPE_NONE); | ||
198 | } | 204 | } |
199 | 205 | ||
200 | int productLimitType = req.getProductLimitType().intValue(); | 206 | int productLimitType = req.getProductLimitType().intValue(); |
@@ -203,8 +209,6 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | @@ -203,8 +209,6 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ | ||
203 | // 初始化非必填数据 | 209 | // 初始化非必填数据 |
204 | req.setSendNum(null == req.getSendNum()?0:req.getSendNum()); | 210 | req.setSendNum(null == req.getSendNum()?0:req.getSendNum()); |
205 | req.setPid(new UserHelper().getUserId()); | 211 | req.setPid(new UserHelper().getUserId()); |
206 | - req.setCouponType(100); | ||
207 | - | ||
208 | 212 | ||
209 | // 如果是修改获取并校验优惠券信息 | 213 | // 如果是修改获取并校验优惠券信息 |
210 | Coupon coupon = null; | 214 | Coupon coupon = null; |
-
Please register or login to post a comment