mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 修改校验分账的方法
This commit is contained in:
@@ -1483,7 +1483,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
*/
|
||||
private OrderSettleResult verifyOrderConfirmAmount(List<String> paymentIds, String orderCode, BigDecimal settleAmount, String wechatAppId) {
|
||||
// 分账金额
|
||||
BigDecimal confirmAmt = BigDecimal.ZERO;
|
||||
BigDecimal totalConfirmAmt = BigDecimal.ZERO;
|
||||
// 手续费
|
||||
BigDecimal feeAmt = BigDecimal.ZERO;
|
||||
// 通过支付id查询分账情况
|
||||
@@ -1499,8 +1499,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
JSONObject jsonObject = JSON.parseObject(confirm.getDescription());
|
||||
if (StringUtils.equals(jsonObject.getString("orderCode"), orderCode)) {
|
||||
// 订单号对的上,累计分账金额
|
||||
BigDecimal amount = new BigDecimal(confirm.getConfirmAmt());
|
||||
confirmAmt = confirmAmt.add(amount);
|
||||
BigDecimal confirmAmt = new BigDecimal(confirm.getConfirmAmt());
|
||||
BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt());
|
||||
BigDecimal orderConfirmedAmt = confirmedAmt.compareTo(BigDecimal.ZERO) == 0
|
||||
? confirmedAmt
|
||||
: confirmAmt;
|
||||
totalConfirmAmt = totalConfirmAmt.add(orderConfirmedAmt);
|
||||
feeAmt = feeAmt.add(new BigDecimal(confirm.getFeeAmt()));
|
||||
}
|
||||
}
|
||||
@@ -1511,11 +1515,11 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
OrderSettleResult result = new OrderSettleResult();
|
||||
result.setOrderCode(orderCode);
|
||||
result.setSettleAmt(settleAmount.toString());
|
||||
result.setConfirmAmt(confirmAmt.toString());
|
||||
result.setConfirmAmt(totalConfirmAmt.toString());
|
||||
result.setFeeAmt(feeAmt.toString());
|
||||
String status;
|
||||
// 如果确认金额和结算金额相等,返回succeeded,其他情况返回PENDING
|
||||
if (settleAmount.compareTo(confirmAmt) == 0) {
|
||||
if (settleAmount.compareTo(totalConfirmAmt) == 0) {
|
||||
// 返回succeeded 标识该笔订单已经完成了分账,不要再次执行分账
|
||||
status = AdapayStatusEnum.SUCCEEDED.getValue();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user