Commit ae5c54ef by xiaoer.li@freemud.com

Merge remote-tracking branch 'remotes/origin/feature/1.9.32_商品加料' into qa

parents ea00187b 9d16dd1b
......@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//查询多个商品库存信息
queryManyGoodsStocks(addShoppingCartGoodsRequestVo, productIds, productBeanListSpuClass, skuId, checkQty);
//this.checkMaterial(productBeanListSpuClass, cartGoods);
this.checkMaterial(productBeanListSpuClass, cartGoods);
//ShoppingCartConvertAdapter.setClassification(cartGoods, productBeanListSpuClass);
String productName = null;
// 当添加的商品不是商品券时
......@@ -1650,7 +1650,19 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
public void checkMaterial(List<ProductBeanDTO> productBeanListSpuClass, CartGoods cartGoods) {
if (CollectionUtils.isEmpty(cartGoods.getProductMaterialList())) return;
if (CollectionUtils.isEmpty(productBeanListSpuClass.get(0).getAdditionalGroupList())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_VERSION_ERROR);
throw new ServiceException(ResponseResult.SHOPPING_CART_MATERIAL_ERROR);
}
Boolean tips = false;
for (CartGoods.MaterialGoods materialGoods : cartGoods.getProductMaterialList()) {
for (ProductBeanDTO.ProductGroupType productGroupType : productBeanListSpuClass.get(0).getAdditionalGroupList()) {
long l = productGroupType.getGroupDetail().stream().filter(e -> e.getProductId().equals(materialGoods.getSpuId())).count();
if (l == 0) {
tips = true;
break;
}
}
if (tips) break;
}
if (tips) throw new ServiceException(ResponseResult.SHOPPING_CART_MATERIAL_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