fix(trade): 修复订单项价格计算逻辑
- 将价格计算从使用原始价格改为使用支付价格 - 确保价格分配计算的准确性 - 解决因价格比例分配可能导致的计算误差问题pull/243/head
parent
92eda45afd
commit
f969670fd3
|
|
@ -258,7 +258,7 @@ public class TradePriceCalculatorHelper {
|
|||
TradeOrderItemDO orderItem = items.get(i);
|
||||
int partPrice;
|
||||
if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减
|
||||
partPrice = (int) (price * (1.0D * orderItem.getPrice() / total));
|
||||
partPrice = (int) (price * (1.0D * orderItem.getPayPrice() / total));
|
||||
remainPrice -= partPrice;
|
||||
} else {
|
||||
partPrice = remainPrice;
|
||||
|
|
|
|||
Loading…
Reference in New Issue