|
@@ -492,10 +492,13 @@ public class AlipayTransferService {
|
|
|
try {
|
|
try {
|
|
|
String syncResult = syncTransferDetail(outBizNo, enterpriseId, orderNo);
|
|
String syncResult = syncTransferDetail(outBizNo, enterpriseId, orderNo);
|
|
|
if (syncResult != null) {
|
|
if (syncResult != null) {
|
|
|
- // SUCCESS 或 FAIL 已由 syncTransferDetail 更新
|
|
|
|
|
- transfer.setRetryCount(4);
|
|
|
|
|
- transfer.setNextRetryAt(null);
|
|
|
|
|
- transferMapper.updateById(transfer);
|
|
|
|
|
|
|
+ // SUCCESS 或 FAIL 已由 syncTransferDetail 更新DB
|
|
|
|
|
+ // 只更新 retryCount/nextRetryAt,避免全字段 updateById 覆盖 syncTransferDetail 写入的 status
|
|
|
|
|
+ TransferEntity patch = new TransferEntity();
|
|
|
|
|
+ patch.setId(transfer.getId());
|
|
|
|
|
+ patch.setRetryCount(4);
|
|
|
|
|
+ patch.setNextRetryAt(null);
|
|
|
|
|
+ transferMapper.updateById(patch);
|
|
|
log.info("[重试任务] out_biz_no={}, retry={}/4, result={}, 已更新",
|
|
log.info("[重试任务] out_biz_no={}, retry={}/4, result={}, 已更新",
|
|
|
outBizNo, retryCount + 1, syncResult);
|
|
outBizNo, retryCount + 1, syncResult);
|
|
|
processed++;
|
|
processed++;
|
|
@@ -514,7 +517,7 @@ public class AlipayTransferService {
|
|
|
|
|
|
|
|
if (retryCount < maxRetries) {
|
|
if (retryCount < maxRetries) {
|
|
|
int accumulated = 0;
|
|
int accumulated = 0;
|
|
|
- for (int i = 0; i < retryCount + 2 && i < RETRY_INTERVALS.length; i++) {
|
|
|
|
|
|
|
+ for (int i = 0; i <= retryCount && i < RETRY_INTERVALS.length; i++) {
|
|
|
accumulated += RETRY_INTERVALS[i];
|
|
accumulated += RETRY_INTERVALS[i];
|
|
|
}
|
|
}
|
|
|
transfer.setRetryCount(retryCount + 1);
|
|
transfer.setRetryCount(retryCount + 1);
|