|
@@ -610,18 +610,22 @@ public class OrderController {
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
map.put("orderId", orderEntity.getId());
|
|
map.put("orderId", orderEntity.getId());
|
|
List<OrderGoodsEntity> goodsList = orderGoodsService.queryList(map);
|
|
List<OrderGoodsEntity> goodsList = orderGoodsService.queryList(map);
|
|
|
|
+ // 计算订单全部优惠 ,区分积分总抵扣金额 和其他优惠金额
|
|
|
|
|
|
|
|
+ BigDecimal allDiscountedPrice = new BigDecimal(0);
|
|
for (OrderGoodsEntity orderGoodsEntity : goodsList) {
|
|
for (OrderGoodsEntity orderGoodsEntity : goodsList) {
|
|
GoodsEntity goodsEntity = goodsService.queryObject(orderGoodsEntity.getGoodsId());
|
|
GoodsEntity goodsEntity = goodsService.queryObject(orderGoodsEntity.getGoodsId());
|
|
BigDecimal goodsTax = CalculateTax.calculateFinalTax(goodsEntity,orderGoodsEntity.getMarketPrice(),goodsService).setScale(3,RoundingMode.HALF_UP);
|
|
BigDecimal goodsTax = CalculateTax.calculateFinalTax(goodsEntity,orderGoodsEntity.getMarketPrice(),goodsService).setScale(3,RoundingMode.HALF_UP);
|
|
goodsTax = goodsTax.multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_UP);
|
|
goodsTax = goodsTax.multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_UP);
|
|
orderGoodsEntity.setTax(goodsTax);
|
|
orderGoodsEntity.setTax(goodsTax);
|
|
tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
|
|
tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
|
|
-
|
|
|
|
// BigDecimal goodsTax = orderGoodsEntity.getMarketPrice().divide(new BigDecimal(1).add(orderGoodsEntity.getGoodsRate()),2,RoundingMode.HALF_DOWN).multiply(orderGoodsEntity.getGoodsRate())
|
|
// BigDecimal goodsTax = orderGoodsEntity.getMarketPrice().divide(new BigDecimal(1).add(orderGoodsEntity.getGoodsRate()),2,RoundingMode.HALF_DOWN).multiply(orderGoodsEntity.getGoodsRate())
|
|
// .multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_DOWN);
|
|
// .multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_DOWN);
|
|
// tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
|
|
// tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
|
|
|
|
+ allDiscountedPrice = allDiscountedPrice.add(orderGoodsEntity.getDiscountedPrice());
|
|
}
|
|
}
|
|
|
|
+ BigDecimal otherDiscountPrice = allDiscountedPrice.subtract(orderEntity.getIntegralMoney());
|
|
|
|
+ orderEntity.setOtherDiscountedPrice(otherDiscountPrice);
|
|
orderEntity.setTax(tax);
|
|
orderEntity.setTax(tax);
|
|
}
|
|
}
|
|
|
|
|