Commit 94fb23e7 by 周晓航

返回商品服务查询的数据 用于转换购物车商品类型

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 117c0466
......@@ -1160,6 +1160,19 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
shoppingCartGoodsDto.setSendPoint(calculationDiscountResult.getSendPointVo());
}
}
// fisherman 设置 商品的 productType 和商品的类型同步
List<ProductBeanDTO> productList = checkCartRequest.getProductList();
if (CollectionUtils.isNotEmpty(productList)) {
for (ShoppingCartGoodsDto.CartGoodsDetailDto product : shoppingCartGoodsDto.getProducts()) {
if (product.getProductType()==null) {
Optional<ProductBeanDTO> firstProduct = productList.stream().filter(p -> ObjectUtils.equals(p.getPid(), product.getSpuId())).findFirst();
if (!firstProduct.isPresent()) {
continue;
}
product.setProductType(firstProduct.get().getType());
}
}
}
return ResponseUtil.success(shoppingCartGoodsDto);
}
......
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