Commit f57ae071 by 刘鹏飞

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

parent e9195f64
......@@ -136,7 +136,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
giftMap.put(giftProduct.getOcid(),giftProduct.getQty());
});
}
Long itemAmount = 0L;
// 赠品原总价
Long giftOriTotalAmount = 0L;
List<ProductVo> productVos = new ArrayList<>();
......@@ -156,6 +156,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
itemAmount = itemAmount + product.getOriginalPrice() * product.getQty();
giftOriTotalAmount = giftOriTotalAmount + product.getOriginalPrice() * giftQty;
......@@ -191,8 +192,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts);
// 商品总价需要包含赠品的价格
queryOrderResponseVo.setItemAmount(queryOrderResponseVo.getItemAmount() + giftOriTotalAmount);
// 商品总价
queryOrderResponseVo.setItemAmount(itemAmount + 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