Commit e45c234f by 刘鹏飞

coco订单详情展示的商品单价需要加上小料的价格

parent 33268a08
...@@ -143,6 +143,21 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -143,6 +143,21 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for(ProductVo product : masterProducts){ for(ProductVo product : masterProducts){
Integer giftQty = giftMap.get(product.getCid()) == null ? 0 : giftMap.get(product.getCid()); Integer giftQty = giftMap.get(product.getCid()) == null ? 0 : giftMap.get(product.getCid());
product.setQty(product.getQty() + giftQty); product.setQty(product.getQty() + giftQty);
// 商品原单价=商品原单价+小料原单价
List<ProductVo> smallMaterial = product.getSetMaterialProducts();
Long smallMaterialOriTotal = 0L;
if(smallMaterial != null && !smallMaterial.isEmpty()){
for(ProductVo sm : smallMaterial){
smallMaterialOriTotal = smallMaterialOriTotal + sm.getOriginalPrice();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行 // 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = productMap.get(product.getCid()); QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = productMap.get(product.getCid());
if(productBean == null || productBean.getDiscountList() == null || productBean.getDiscountList().isEmpty()){ if(productBean == null || productBean.getDiscountList() == null || productBean.getDiscountList().isEmpty()){
...@@ -162,35 +177,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -162,35 +177,12 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
ProductVo newProduct = JSONObject.parseObject(JSONObject.toJSONString(product),ProductVo.class); ProductVo newProduct = JSONObject.parseObject(JSONObject.toJSONString(product),ProductVo.class);
newProduct.setQty(1); newProduct.setQty(1);
// 商品原单价=商品原单价+小料原单价
List<ProductVo> smallMaterial = newProduct.getSetMaterialProducts();
Long smallMaterialOriTotal = 0L;
if(smallMaterial != null && !smallMaterial.isEmpty()){
for(ProductVo sm : smallMaterial){
smallMaterialOriTotal = smallMaterialOriTotal + sm.getOriginalPrice();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
newProduct.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
productVos.add(newProduct); productVos.add(newProduct);
} }
product.setQty(1); product.setQty(1);
} }
// 商品原单价=商品原单价+小料原单价
List<ProductVo> smallMaterial = product.getSetMaterialProducts();
Long smallMaterialOriTotal = 0L;
if(smallMaterial != null && !smallMaterial.isEmpty()){
for(ProductVo sm : smallMaterial){
smallMaterialOriTotal = smallMaterialOriTotal + sm.getOriginalPrice();
}
}
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : 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