Commit 453ec46c by 张跃

加价购优化

parent af20b456
......@@ -75,13 +75,8 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
if (Integer.valueOf("5").equals(showType) && !org.springframework.util.CollectionUtils.isEmpty(chooseSendGoodList)) {
chooseSendGoodList.forEach(good -> {
ListCartGoodsBO.SendGoods first = null;
if (sendGoods != null) {
if (sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getPid())).findFirst().isPresent()) {
first = sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getPid())).findFirst().get();
} else {
return;
}
}
first = sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getSkuId()) || a.getGoodsId().equals(good.getSpuId())).findFirst().orElse(null);
if (first == null) return;
CartGoods cartGoods = new CartGoods();
cartGoods.setSpuId(good.getSpuId());
cartGoods.setSkuId(good.getSkuId());
......
......@@ -787,11 +787,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if(Integer.valueOf("5").equals(showType) && !org.springframework.util.CollectionUtils.isEmpty(chooseSendGoodList)){
chooseSendGoodList.forEach(good->{
ShoppingCartInfoRequestVo.SendGoods first = null;
if (sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getPid())).findFirst().isPresent()) {
first = sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getPid())).findFirst().get();
} else {
return;
}
first = sendGoods.stream().filter(a -> a.getGoodsId().equals(good.getSkuId()) || a.getGoodsId().equals(good.getSpuId())).findFirst().orElse(null);
if (first == null) return;
CartGoods cartGoods = new CartGoods();
cartGoods.setSpuId(good.getSpuId());
cartGoods.setSkuId(good.getSkuId());
......
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