Commit 036acadf by 孙昱

sunyu::update::new function about coupon conflicts

parent df1f42b6
...@@ -9,6 +9,7 @@ public class ResponseCodeConstant { ...@@ -9,6 +9,7 @@ public class ResponseCodeConstant {
public final static String RESPONSE_SUCCESS_STR = "100"; public final static String RESPONSE_SUCCESS_STR = "100";
public final static String RESPONSE_CONFLICTS_STR = "105";
// coco券校验异常的错误 // coco券校验异常的错误
public final static String COCO_RESPONSE_COUPON_ERR_STR = "700"; public final static String COCO_RESPONSE_COUPON_ERR_STR = "700";
...@@ -25,6 +26,7 @@ public class ResponseCodeConstant { ...@@ -25,6 +26,7 @@ public class ResponseCodeConstant {
successResponseCodeSet.add(RESPONSE_SUCCESS_OK); successResponseCodeSet.add(RESPONSE_SUCCESS_OK);
successResponseCodeSet.add(RESPONSE_SUCCESS_1); successResponseCodeSet.add(RESPONSE_SUCCESS_1);
successResponseCodeSet.add(RESPONSE_SUCCESS_0_STR); successResponseCodeSet.add(RESPONSE_SUCCESS_0_STR);
successResponseCodeSet.add(RESPONSE_CONFLICTS_STR);
} }
public static boolean isSuccessRespinseCode(Object o) { public static boolean isSuccessRespinseCode(Object o) {
......
...@@ -144,6 +144,7 @@ public enum ResponseResult { ...@@ -144,6 +144,7 @@ public enum ResponseResult {
COUPON_SHOP_NOTSUPPORT("46010", "优惠券在当前门店不可用"), COUPON_SHOP_NOTSUPPORT("46010", "优惠券在当前门店不可用"),
COUPON_ORDER_WAY_ERROR("46011", "您选择得优惠券不适用该点餐方式"), COUPON_ORDER_WAY_ERROR("46011", "您选择得优惠券不适用该点餐方式"),
COUPON_VERIFICATION_FAIL("46012", "优惠券核销失败"), COUPON_VERIFICATION_FAIL("46012", "优惠券核销失败"),
COUPON_CONFLICTS_ERROR("46013","当前使用的券列表存在互斥"),
/** /**
* 加价购商品 * 加价购商品
......
...@@ -159,6 +159,10 @@ public class CalculationServiceImpl { ...@@ -159,6 +159,10 @@ public class CalculationServiceImpl {
ErrorLog.printErrorLog("calculation_discount_error", "/calculation/discount/sharding", discountRequest, ex); ErrorLog.printErrorLog("calculation_discount_error", "/calculation/discount/sharding", discountRequest, ex);
throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN); throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN);
} }
//优惠券互斥
if (null != activityCalculationDiscountResponseDto && StringUtils.equals(activityCalculationDiscountResponseDto.getStatusCode(),ResponseCodeConstant.RESPONSE_CONFLICTS_STR)){
throw new ServiceException(ResponseResult.COUPON_CONFLICTS_ERROR);
}
// 返回成功 // 返回成功
if (activityCalculationDiscountResponseDto == null || !StringUtils.equals(activityCalculationDiscountResponseDto.getStatusCode(), ResponseCodeConstant.RESPONSE_SUCCESS_STR)) { if (activityCalculationDiscountResponseDto == null || !StringUtils.equals(activityCalculationDiscountResponseDto.getStatusCode(), ResponseCodeConstant.RESPONSE_SUCCESS_STR)) {
throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN); throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment