update 分账task

This commit is contained in:
Guoqs
2026-03-13 15:20:29 +08:00
parent a07cef51ea
commit a6d6f9b0fb
3 changed files with 32 additions and 13 deletions

View File

@@ -497,14 +497,14 @@ public class JsowellTask {
failed++;
log.error("处理未分账数据到默认账户异常, paymentId:{}, orderCode:{}, confirmAmt:{}",
paymentId, orderCode, confirmAmt, e);
markSplitResult(paymentId, "FAILED");
markSplitResult(paymentId, "FAILED", "请求异常: " + e.getMessage());
continue;
}
if (response != null && response.isSuccess()) {
success++;
updateConfirmedSplitAmount(item, confirmAmt, paymentId);
markSplitResult(paymentId, "SUCCESS");
markSplitResult(paymentId, "SUCCESS", "分账金额: " + confirmAmt.toPlainString());
log.info("处理未分账数据成功, paymentId:{}, orderCode:{}, confirmAmt:{}, response:{}",
paymentId, orderCode, confirmAmt, JSON.toJSONString(response));
} else {
@@ -513,7 +513,7 @@ public class JsowellTask {
String errorMsg = response == null ? "response_is_null" : response.getError_msg();
log.error("处理未分账数据失败, paymentId:{}, orderCode:{}, confirmAmt:{}, errorCode:{}, errorMsg:{}",
paymentId, orderCode, confirmAmt, errorCode, errorMsg);
markSplitResult(paymentId, "FAILED");
markSplitResult(paymentId, "FAILED", errorCode + ": " + errorMsg);
}
}
@@ -605,6 +605,7 @@ public class JsowellTask {
if (confirmAmt.compareTo(BigDecimal.ZERO) <= 0) {
skipped.incrementAndGet();
log.info("[processUnsplitRecordBatch] 可分账金额为0跳过, paymentId:{}, orderCode:{}", paymentId, orderCode);
markSplitResult(paymentId, "SKIPPED", "可分账金额为0");
return;
}
@@ -628,14 +629,14 @@ public class JsowellTask {
failed.incrementAndGet();
log.error("[processUnsplitRecordBatch] 发起分账请求异常, paymentId:{}, orderCode:{}, confirmAmt:{}",
paymentId, orderCode, confirmAmt, e);
markSplitResult(paymentId, "FAILED");
markSplitResult(paymentId, "FAILED", "请求异常: " + e.getMessage());
return;
}
if (response != null && response.isSuccess()) {
success.incrementAndGet();
updateConfirmedSplitAmount(item, confirmAmt, paymentId);
markSplitResult(paymentId, "SUCCESS");
markSplitResult(paymentId, "SUCCESS", "分账金额: " + confirmAmt.toPlainString());
log.info("[processUnsplitRecordBatch] 分账成功, paymentId:{}, orderCode:{}, confirmAmt:{}",
paymentId, orderCode, confirmAmt);
} else {
@@ -644,7 +645,7 @@ public class JsowellTask {
String errorMsg = response == null ? "response_is_null" : response.getError_msg();
log.error("[processUnsplitRecordBatch] 分账失败, paymentId:{}, orderCode:{}, confirmAmt:{}, errorCode:{}, errorMsg:{}",
paymentId, orderCode, confirmAmt, errorCode, errorMsg);
markSplitResult(paymentId, "FAILED");
markSplitResult(paymentId, "FAILED", errorCode + ": " + errorMsg);
}
})
).get();
@@ -928,10 +929,11 @@ public class JsowellTask {
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
}
private void markSplitResult(String paymentId, String splitFlag) {
private void markSplitResult(String paymentId, String splitFlag, String splitRemark) {
AdapayUnsplitRecord updateRecord = new AdapayUnsplitRecord();
updateRecord.setPaymentId(paymentId);
updateRecord.setSplitFlag(splitFlag);
updateRecord.setSplitRemark(splitRemark);
updateRecord.setUpdateTime(DateUtils.getNowDate());
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
}