等待时间改为10分钟

This commit is contained in:
CYQ 2025-11-04 17:10:15 +08:00
parent 1acd391857
commit df40fc13e8
3 changed files with 11 additions and 9 deletions

View File

@ -197,8 +197,8 @@ public class MpsFormalBatchMain {
}
// 等待60分钟后重新检查
batchLogger.info("等待60分钟后重新检查状态");
TimeUnit.MINUTES.sleep(60);
batchLogger.info("等待10分钟后重新检查状态");
TimeUnit.MINUTES.sleep(10);
return executeBatch(context); // 递归调用
}
@ -299,6 +299,7 @@ public class MpsFormalBatchMain {
private boolean executeNormalBatch(String batchMonth) {
try {
// 检查是否可以执行预处理批量
// importStatus=0 and (preBatchStatus=0 or preBatchStatus=3)
if (batchStatusService.canExecutePreBatch(batchMonth)) {
// 更新状态为进行中
batchStatusService.updateBatchStatus(
@ -316,6 +317,7 @@ public class MpsFormalBatchMain {
}
// 检查是否可以执行正式批量
// preBatchStatus=1 and checkStatus=1 and (afterBatchStatus=0 or afterBatchStatus=3)
if (batchStatusService.canExecuteMainBatch(batchMonth)) {
// 更新状态为进行中
batchStatusService.updateBatchStatus(
@ -330,14 +332,14 @@ public class MpsFormalBatchMain {
// 如果导入状态未完成等待60分钟
if (!batchStatusService.isImportCompleted(batchMonth)) {
batchLogger.info("导入状态未完成,等待60分钟");
batchLogger.info("导入状态未完成,等待状态修改");
batchStatusService.waitForImportCompletion(batchMonth, MAX_WAIT_HOURS);
return executeNormalBatch(batchMonth); // 递归调用
}
// 如果预处理和核对状态未完成等待60分钟
if (!batchStatusService.isPreBatchCompletedAndChecked(batchMonth)) {
batchLogger.info("预处理和核对状态未完成,等待60分钟");
batchLogger.info("预处理和核对状态未完成,等待状态修改");
batchStatusService.waitForPreBatchCompletion(batchMonth, MAX_WAIT_HOURS);
return executeNormalBatch(batchMonth); // 递归调用
}

View File

@ -76,7 +76,7 @@ public class BIZ017Processor extends AbstractBusinessProcessor {
" SELECT 1 FROM mps_import_zhiefu_indv s " +
" WHERE import_time=? and s.crt_no = m.cust_id ) " +
" THEN '1' ELSE '9' END " +
", check_flag = CASE " +
", check_msg = CASE " +
" WHEN EXISTS ( " +
" SELECT 1 FROM mps_import_zhiefu_indv s " +
" WHERE import_time=? and s.crt_no = m.cust_id ) " +

View File

@ -275,8 +275,8 @@ public class BatchStatusService {
long maxWaitMillis = TimeUnit.HOURS.toMillis(maxWaitHours);
while (System.currentTimeMillis() - startTime < maxWaitMillis) {
batchLogger.info("等待导入状态完成,60分钟后重新检查...");
TimeUnit.MINUTES.sleep(60);
batchLogger.info("等待导入状态完成,10分钟后重新检查...");
TimeUnit.MINUTES.sleep(10);
// 检查导入状态是否完成
if (isImportCompleted(batchMonth)) {
@ -302,8 +302,8 @@ public class BatchStatusService {
long maxWaitMillis = TimeUnit.HOURS.toMillis(maxWaitHours);
while (System.currentTimeMillis() - startTime < maxWaitMillis) {
batchLogger.info("等待预处理和核对状态完成,60分钟后重新检查...");
TimeUnit.MINUTES.sleep(60);
batchLogger.info("等待预处理和核对状态完成,10分钟后重新检查...");
TimeUnit.MINUTES.sleep(10);
// 检查预处理和核对状态是否完成
if (isPreBatchCompletedAndChecked(batchMonth)) {