Commit 340735c1 by 刘鹏飞

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

parent e09a3b6e
...@@ -161,10 +161,36 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -161,10 +161,36 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for(int i = 0 ; i < num-1 ; i++){ for(int i = 0 ; i < num-1 ; i++){
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()));
} }
} }
...@@ -174,4 +200,5 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -174,4 +200,5 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
queryOrderResponseVo.setProducts(masterProducts); queryOrderResponseVo.setProducts(masterProducts);
} }
} }
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