Commit e9195f64 by 刘鹏飞

coco订单详情的商品总价需要包含赠品的价格

parent 4ac6c077
......@@ -137,7 +137,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
});
}
// 赠品原总价
Long giftOriTotalAmount = 0L;
List<ProductVo> productVos = new ArrayList<>();
if(null != masterProducts && !masterProducts.isEmpty()){
for(ProductVo product : masterProducts){
......@@ -155,7 +156,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
giftOriTotalAmount = giftOriTotalAmount + product.getOriginalPrice() * giftQty;
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
......@@ -190,6 +191,9 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts);
// 商品总价需要包含赠品的价格
queryOrderResponseVo.setItemAmount(queryOrderResponseVo.getItemAmount() + giftOriTotalAmount);
}
}
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