Commit eca2b43e by yu.sun

sunyu::update::fix bug about monthCard

parent 3b256404
...@@ -101,6 +101,7 @@ public enum ResponseResult { ...@@ -101,6 +101,7 @@ public enum ResponseResult {
SHOPPING_CART_BUY_ONE_SEND_GOODS_NOT_EMPTY("44032", "未查询到寄件活动商品"), SHOPPING_CART_BUY_ONE_SEND_GOODS_NOT_EMPTY("44032", "未查询到寄件活动商品"),
SHOPPING_CART_BUY_ONE_SEND_GOODS_ERR("44033", "寄件活动商品错误"), SHOPPING_CART_BUY_ONE_SEND_GOODS_ERR("44033", "寄件活动商品错误"),
SHOPPING_CART_COUPON_MIX_NOT_EXIST("44034", "券商品不存在"), SHOPPING_CART_COUPON_MIX_NOT_EXIST("44034", "券商品不存在"),
SHOPPING_CART_QTY_LIMIT_ERR("44035", "该商品超过限制数量,不可更新"),
/** /**
* 订单状态码 * 订单状态码
...@@ -178,7 +179,8 @@ public enum ResponseResult { ...@@ -178,7 +179,8 @@ public enum ResponseResult {
/** /**
* coco验证券错误 * coco验证券错误
*/ */
COCO_COUPON_VALIDATOR_FAIL("49000", "优惠券验证错误") COCO_COUPON_VALIDATOR_FAIL("49000", "优惠券验证错误"),
NEW_PURCHASE("49001", "超过限购数量了")
; ;
......
...@@ -176,10 +176,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -176,10 +176,11 @@ public class ShoppingCartMCoffeeServiceImpl {
if (mcCafeTablewareSkuId.equals(cartGoods.getSkuId())) { if (mcCafeTablewareSkuId.equals(cartGoods.getSkuId())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_ERROR.getCode(), "不能重复添加餐具商品"); return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_ERROR.getCode(), "不能重复添加餐具商品");
} }
if (Objects.equals(addShoppingCartGoodsRequestVo.getIsMonthCard(),1) && cartGoods.getQty()>9){ if (Objects.equals(addShoppingCartGoodsRequestVo.getIsMonthCard(),1) && cartGoods.getQty()>10){
shoppingCartGoodsResponseVo.setChanged(false); shoppingCartGoodsResponseVo.setChanged(false);
shoppingCartGoodsResponseVo.setToastMsg("月享卡最多购买10张"); shoppingCartGoodsResponseVo.setToastMsg("月享卡最多购买10张");
return ResponseUtil.success(shoppingCartGoodsResponseVo); cartGoods.setQty(10);
break;
} }
} }
} }
...@@ -355,6 +356,12 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -355,6 +356,12 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
} }
for (CartGoods goods : cartGoodsList) {
if (Objects.equals(1,goods.getIsMonthCard()) && updateShoppingCartGoodsQtyRequestVo.getOldQty()>=10){
throw new ServiceException(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR);
}
}
if (cartGoods == null) { if (cartGoods == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR); throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
} }
......
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