fix:执行计划

1.把收尾处理的逻辑移动到缓存删除的后边。
master
李杰应 2024-11-11 16:16:49 +08:00
parent 09798b8d51
commit 3aa3090fb5
1 changed files with 7 additions and 5 deletions

View File

@ -235,11 +235,7 @@ public class PlanBatchTaskDataUpdateJob {
//获取更新后的批次信息
AtuPlanBatchDetailDto atuPlanBatchDetailDto = planBatchService.queryBatchDetailById(planBatch.getId());
// 收尾处理
AtuPlanInfo batchPlanInfo = planInfoService.findByBatchId(batchId);
if (batchPlanInfo != null) {
handleEnd(batchPlanInfo, atuPlanBatchDetailDto);
}
// 判断是否计划最后一批次
AtuPlanInfo planInfo = planInfoService.queryByLastBatchId(batchId);
if (ObjectUtil.isNotNull(planInfo)) {
@ -264,6 +260,12 @@ public class PlanBatchTaskDataUpdateJob {
// 2.2. 删除缓存中已完成批次的记录
logger.debug("删除批次统计缓存 => " + key);
redisTemplate.delete(key);
// 收尾处理
AtuPlanInfo batchPlanInfo = planInfoService.findByBatchId(batchId);
if (batchPlanInfo != null) {
handleEnd(batchPlanInfo, atuPlanBatchDetailDto);
}
});
logger.debug("同步缓存中计划批次统计数据----end----");
}