Commit 46c060fb by 徐康

套餐固定搭配单规格加料

parent 28f51e34
......@@ -263,8 +263,7 @@ public class AssortmentSdkService {
request.setStoreId(storeId);
request.setTrackingNo(LogThreadLocal.getTrackingNo());
request.setMenuType(BusinessTypeEnum.getByType(menuType).getCode());
BaseResponse<List<ProductBeanDTO>> baseResponse =
shoppingCartService.getProductsInfo(request);
BaseResponse<List<ProductBeanDTO>> baseResponse = shoppingCartService.getProductsInfo(request);
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_PRODUCT_NOT_EXIST);
}
......
......@@ -1582,9 +1582,9 @@ public class ShoppingCartMCoffeeServiceImpl {
.collect(Collectors.toMap(ProductBeanDTO.ProductComboType::getProductId, ProductBeanDTO.ProductComboType::getQuantity, (k1,k2) -> k1+k2));
Map<String, Integer> cartGoodsMap = cartGoods.getProductComboList().stream()
.collect(Collectors.toMap(CartGoods.ComboxGoods::getGoodsId, CartGoods.ComboxGoods::getQty, (k1, k2) -> k1+k2));
.collect(Collectors.toMap(CartGoods.ComboxGoods::getSpuId, CartGoods.ComboxGoods::getQty, (k1, k2) -> k1+k2));
if(productMap.entrySet().stream().filter(o -> o.getValue() != cartGoodsMap.get(o.getKey())).findFirst().isPresent()) {
if(productMap.entrySet().stream().filter(o -> !o.getValue().equals(cartGoodsMap.get(o.getKey()))).findFirst().isPresent()) {
throw new ServiceException(ResponseResult.SHOPPING_CART_VERSION_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