## Opt - 调整分账保留小数逻辑&比例
This commit is contained in:
parent
afa7e63a25
commit
dbbb6fec0b
|
@ -265,8 +265,8 @@ public class JdPayServiceImpl implements IJdPayService {
|
|||
if(i == separateAccounts.size() - 1){
|
||||
subTradeAmount = remaining;
|
||||
}else{
|
||||
subTradeAmount = tradeAmount.subtract(tradeAmount.multiply(separateAccount.getProportion().setScale(2, BigDecimal.ROUND_HALF_UP)));
|
||||
remaining = remaining.subtract(subTradeAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
subTradeAmount = tradeAmount.subtract(tradeAmount.multiply(separateAccount.getProportion().setScale(2, BigDecimal.ROUND_DOWN)).setScale(2, BigDecimal.ROUND_DOWN));
|
||||
remaining = remaining.subtract(subTradeAmount).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
JdPayDivisionAccountTradeInfo divisionAccountTradeInfo = new JdPayDivisionAccountTradeInfo();
|
||||
divisionAccountTradeInfo.setMerchantNo(separateAccount.getAccount());
|
||||
|
|
|
@ -111,9 +111,9 @@ jd:
|
|||
# refundNotifyUrl: https://b747-218-57-66-5.ngrok-free.app/pay/jd-refund/trade-notify
|
||||
separateAccounts:
|
||||
- account: 153428607007
|
||||
proportion: 0.5
|
||||
proportion: 0.7
|
||||
- account: 153428607005
|
||||
proportion: 0.5
|
||||
proportion: 0.3
|
||||
wechat-alipay:
|
||||
## 二级商户号
|
||||
merchantNo: 153428607006
|
||||
|
@ -138,9 +138,9 @@ jd:
|
|||
refundNotifyUrl: https://b747-218-57-66-5.ngrok-free.app/pay/jd-refund/trade-notify
|
||||
separateAccounts:
|
||||
- account: 153428607008
|
||||
proportion: 0.5
|
||||
proportion: 0.7
|
||||
- account: 153428607006
|
||||
proportion: 0.5
|
||||
proportion: 0.3
|
||||
transfer-out:
|
||||
## 二级商户号
|
||||
merchantNo: 153428607004
|
||||
|
|
Loading…
Reference in New Issue