Commit 46187e73 by 刘鹏飞

判空

parent 19fe05a4
...@@ -286,15 +286,20 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation ...@@ -286,15 +286,20 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial> smallMaterial = goodsDiscountsMap.get(product.getCartGoodsUid()).getSmallMaterial(); List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial> smallMaterial = goodsDiscountsMap.get(product.getCartGoodsUid()).getSmallMaterial();
Integer smallMaterialOriTotal = 0; Integer smallMaterialOriTotal = 0;
Long halfSmallMaterialOriTotal = 0L; Long halfSmallMaterialOriTotal = 0L;
if(smallMaterial != null && !smallMaterial.isEmpty()){
for(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial sm : smallMaterial){ for(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial sm : smallMaterial){
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount> smDiscounts = sm.getDiscounts(); List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount> smDiscounts = sm.getDiscounts();
if(smDiscounts != null && !smDiscounts.isEmpty()){
for(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount smDiscount : smDiscounts){ for(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount smDiscount : smDiscounts){
if(ObjectUtils.equals(smDiscount.getType(),ActivityTypeEnum.TYPE_53.getCode())){ if(ObjectUtils.equals(smDiscount.getType(),ActivityTypeEnum.TYPE_53.getCode())){
halfSmallMaterialOriTotal = halfSmallMaterialOriTotal + smDiscount.getSignleDiscount(); halfSmallMaterialOriTotal = halfSmallMaterialOriTotal + smDiscount.getSignleDiscount();
} }
} }
}
smallMaterialOriTotal = smallMaterialOriTotal + sm.getOriginalPrice(); smallMaterialOriTotal = smallMaterialOriTotal + sm.getOriginalPrice();
} }
}
// 商品的单价 = 商品单价+小料单价 // 商品的单价 = 商品单价+小料单价
Long originalPrice = (new Long(smallMaterialOriTotal) + product.getOriginalPrice()); Long originalPrice = (new Long(smallMaterialOriTotal) + product.getOriginalPrice());
......
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