...
|
...
|
@@ -171,8 +171,11 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
|
|
|
jsonObject.put("coupons",couponQueryResps);
|
|
|
return new ApiResponse.ApiResponseBuilder().data(jsonObject).build();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
private static final String SKUP_FORBID_TYPE_NONE = "0";
|
|
|
@Override
|
|
|
public ApiResponse saveOrUpdateCoupon(CouponSaveUpdateReq req) {
|
|
|
LOGGER.info("enter saveOrUpdateCoupon,param is {}",req);
|
...
|
...
|
@@ -191,10 +194,13 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
if (!limitType.matches("\\d+")){
|
|
|
throw new ServiceException(400, "错误:不合法的限制类型");
|
|
|
}
|
|
|
if (!SkupType.of(Integer.parseInt(limitType)).isPresent()){
|
|
|
if (!SkupType.of(Integer.parseInt(limitType)).isPresent() && !SKUP_FORBID_TYPE_NONE.equals(limitType)){
|
|
|
throw new ServiceException(401, "错误:不合法的限制类型");
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
// 无禁止
|
|
|
req.setSkupForbidType(SKUP_FORBID_TYPE_NONE);
|
|
|
}
|
|
|
|
|
|
int productLimitType = req.getProductLimitType().intValue();
|
...
|
...
|
@@ -203,8 +209,6 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
// 初始化非必填数据
|
|
|
req.setSendNum(null == req.getSendNum()?0:req.getSendNum());
|
|
|
req.setPid(new UserHelper().getUserId());
|
|
|
req.setCouponType(100);
|
|
|
|
|
|
|
|
|
// 如果是修改获取并校验优惠券信息
|
|
|
Coupon coupon = null;
|
...
|
...
|
|