Commit a85de71a by 谌会阳

Revert "fix 新增加料信息"

This reverts commit 72c21db0
parent fef17012
...@@ -172,12 +172,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -172,12 +172,7 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
//商品券已添加情况校验 //商品券已添加情况校验
List<CartGoods.MaterialGoods> productMaterialList =new ArrayList<>(); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = checkGoodsCoupon(oldCartGoodsList, operationType, couponCode,goodsId);
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = checkGoodsCoupon(oldCartGoodsList, operationType, couponCode,goodsId, productMaterialList);
if (CollectionUtils.isNotEmpty(productMaterialList)){
// 复制加料信息
addShoppingCartGoodsRequestVo.setProductMaterialList(adapterProductMateria(productMaterialList));
}
CartGoods addCartGoods = convent2CartGoods(addShoppingCartGoodsRequestVo, goodsId ,vo); CartGoods addCartGoods = convent2CartGoods(addShoppingCartGoodsRequestVo, goodsId ,vo);
setClassificationAndPrice(addCartGoods, productBeanListSpuClass); setClassificationAndPrice(addCartGoods, productBeanListSpuClass);
if(StringUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getGroupName())) { if(StringUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getGroupName())) {
...@@ -206,18 +201,6 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -206,18 +201,6 @@ public class ShoppingCartMCoffeeServiceImpl {
return ResponseUtil.success(shoppingCartGoodsResponseVo); return ResponseUtil.success(shoppingCartGoodsResponseVo);
} }
private List<MaterialRequestVo> adapterProductMateria(List<CartGoods.MaterialGoods> productMaterialList){
List<MaterialRequestVo> materialRequestVos = new ArrayList<>();
for (CartGoods.MaterialGoods materialGoods: productMaterialList) {
MaterialRequestVo vo =new MaterialRequestVo();
vo.setSpuId(materialGoods.getSpuId());
vo.setCustomerCode(materialGoods.getCustomerCode());
vo.setGroupId(materialGoods.getGroupId());
}
return materialRequestVos;
}
private MCoffeeProductIdsVo validCoupon(String partnerId, String storeId, String spuId, List<Long> productIds, String menuType) { private MCoffeeProductIdsVo validCoupon(String partnerId, String storeId, String spuId, List<Long> productIds, String menuType) {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, spuId.substring(CommonsConstant.COUPON_PREFIX.length()), menuType); CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, spuId.substring(CommonsConstant.COUPON_PREFIX.length()), menuType);
CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class); CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class);
...@@ -235,7 +218,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -235,7 +218,7 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
private List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> checkGoodsCoupon(List<CartGoods> oldCartGoodsList, Integer operationType, String couponCode,String goodsId, List<CartGoods.MaterialGoods> productMaterialList) { private List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> checkGoodsCoupon(List<CartGoods> oldCartGoodsList, Integer operationType, String couponCode,String goodsId) {
if (operationType != null && operationType == 1 && StringUtils.isBlank(couponCode)) { if (operationType != null && operationType == 1 && StringUtils.isBlank(couponCode)) {
throw new ServiceException(ResponseResult.PARAMETER_MISSING, "商品券券号为空"); throw new ServiceException(ResponseResult.PARAMETER_MISSING, "商品券券号为空");
} }
...@@ -256,9 +239,6 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -256,9 +239,6 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.setQty(0); cartGoods.setQty(0);
} }
if (StringUtils.isNotEmpty(goodsId) && StringUtils.isNotEmpty(couponCode) && goodsId.equals(cartGoods.getSkuId()) && StringUtils.isBlank(cartGoods.getCouponCode())) { if (StringUtils.isNotEmpty(goodsId) && StringUtils.isNotEmpty(couponCode) && goodsId.equals(cartGoods.getSkuId()) && StringUtils.isBlank(cartGoods.getCouponCode())) {
if (CollectionUtils.isNotEmpty(cartGoods.getProductMaterialList())) {
productMaterialList.addAll(cartGoods.getProductMaterialList());
}
if (cartGoods.getQty() > 1 ){ if (cartGoods.getQty() > 1 ){
cartGoods.setQty(cartGoods.getQty() - 1); cartGoods.setQty(cartGoods.getQty() - 1);
}else { }else {
......
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