Commit 99a477ad by 周晓航

bugfix=:老代码判断导致npe

parent 1225ea66
...@@ -121,7 +121,10 @@ public class CalculationSharingEquallyService { ...@@ -121,7 +121,10 @@ public class CalculationSharingEquallyService {
Goods find = null; Goods find = null;
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
if (goods!=null) { if (goods!=null) {
find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().orElseGet(null); Optional<Goods> first = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst();
if (first.isPresent()) {
find = first.get();
}
} }
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,shoppingCartInfoRequestVo.getPartnerId()); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,shoppingCartInfoRequestVo.getPartnerId());
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
......
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