|
|
|
@ -2,13 +2,12 @@ package com.supervision.job;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.supervision.common.constant.XxlJobConstants;
|
|
|
|
|
import com.supervision.constant.CaseAnalysisStatusEnum;
|
|
|
|
|
import com.supervision.police.domain.ModelCase;
|
|
|
|
|
import com.supervision.police.domain.NotePrompt;
|
|
|
|
|
import com.supervision.police.domain.TaskCaseRecord;
|
|
|
|
|
import com.supervision.police.domain.TaskRecord;
|
|
|
|
|
import com.supervision.police.service.CaseEvidenceService;
|
|
|
|
|
import com.supervision.police.service.NotePromptService;
|
|
|
|
|
import com.supervision.police.service.TaskCaseRecordService;
|
|
|
|
|
import com.supervision.police.service.TaskRecordService;
|
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
@ -35,6 +34,8 @@ public class XxlJobTask {
|
|
|
|
|
|
|
|
|
|
private final NotePromptService notePromptService;
|
|
|
|
|
|
|
|
|
|
private final ModelCaseService modelCaseService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 睡觉通知
|
|
|
|
|
*/
|
|
|
|
@ -92,7 +93,7 @@ public class XxlJobTask {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (executable) {
|
|
|
|
|
|
|
|
|
|
this.modelCaseAnalyzingStatusCheck(caseId);
|
|
|
|
|
TaskCaseRecord taskCaseRecord = taskCaseRecordService.lambdaQuery().eq(TaskCaseRecord::getCaseId, caseId).eq(TaskCaseRecord::getTaskRecordId, taskId).one();
|
|
|
|
|
if (TASK_STATUS_WAITING.equals(taskCaseRecord.getStatus())) {
|
|
|
|
|
log.info("任务状态为等待中,任务状态更新为处理中,任务案件ID: 【{}】", taskCaseRecord.getId());
|
|
|
|
@ -124,4 +125,21 @@ public class XxlJobTask {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 案件模型分析状态检查
|
|
|
|
|
* 先查询案件模型分析状态,如果是分析中,则等待5秒重新查询案件模型分析状态,如果不是分析中,则执行任务,如果仍然是分析中,继续等待5秒。最多等待2分钟。
|
|
|
|
|
*/
|
|
|
|
|
private void modelCaseAnalyzingStatusCheck(String caseId) throws InterruptedException {
|
|
|
|
|
ModelCase modelCase = modelCaseService.getById(caseId);
|
|
|
|
|
int count = 0;
|
|
|
|
|
while (CaseAnalysisStatusEnum.ANALYZING.getCode() == modelCase.getCaseAnalysisStatus() && count < 24) {
|
|
|
|
|
Thread.sleep(5000);
|
|
|
|
|
modelCase = modelCaseService.getById(caseId);
|
|
|
|
|
count++;
|
|
|
|
|
if (count == 24) {
|
|
|
|
|
log.error("案件模型分析状态检查超时,默认继续执行提取任务。案件ID: 【{}】", caseId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|