|
|
|
@ -103,13 +103,13 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
taskRecord.setType(TASK_TYPE_ONE_CLICK);
|
|
|
|
|
taskRecord.setName(this.generateTaskName(taskRecord.getType()));
|
|
|
|
|
super.save(taskRecord);
|
|
|
|
|
//异步调用xxl-job执行任务
|
|
|
|
|
Thread thread = new Thread(() -> {
|
|
|
|
|
notePromptService.list(new LambdaQueryWrapper<NotePrompt>().eq(NotePrompt::getType, TYPE_GRAPH_REASONING).or().eq(NotePrompt::getType, TYPE_STRUCTURAL_REASONING)).forEach(notePrompt -> {
|
|
|
|
|
try {
|
|
|
|
|
NotePrompt prompt = notePromptService.getById(notePrompt.getId());
|
|
|
|
|
List<ModelCase> modelCases = this.getModelCases(taskRecord);
|
|
|
|
|
if (!CollUtil.isEmpty(modelCases)) {
|
|
|
|
|
//异步调用xxl-job执行任务
|
|
|
|
|
Thread thread = new Thread(() -> {
|
|
|
|
|
for (ModelCase modelCase : modelCases) {
|
|
|
|
|
String caseId = modelCase.getId();
|
|
|
|
|
List<String> ids = this.getIds(taskRecord, caseId, prompt.getType());
|
|
|
|
@ -120,8 +120,6 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
log.info("案件【{}】没有笔录或证据", caseId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
thread.start();
|
|
|
|
|
} else {
|
|
|
|
|
log.info("查无案件");
|
|
|
|
|
}
|
|
|
|
@ -131,6 +129,8 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
log.error("任务执行失败", e);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
thread.start();
|
|
|
|
|
stopWatch.stop();
|
|
|
|
|
log.info("一键提取任务触发完成。耗时:{}", stopWatch.getTotalTimeSeconds());
|
|
|
|
|
}
|
|
|
|
@ -316,7 +316,7 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager", rollbackFor = Exception.class)
|
|
|
|
|
public void completeTask(String taskId, String executeId,String promptId, boolean isSuccess) {
|
|
|
|
|
public void completeTask(String taskId, String executeId, String promptId, boolean isSuccess) {
|
|
|
|
|
if (StrUtil.isEmpty(taskId)) {
|
|
|
|
|
log.info("completeTask:任务ID为空");
|
|
|
|
|
return;
|
|
|
|
@ -331,7 +331,7 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskCaseRecord taskCaseRecord = taskCaseRecordService.updateStatus(taskId, executeId,promptId, isSuccess);
|
|
|
|
|
TaskCaseRecord taskCaseRecord = taskCaseRecordService.updateStatus(taskId, executeId, promptId, isSuccess);
|
|
|
|
|
log.info("completeTask:任务ID:【{}】,执行ID:【{}】,任务状态:【{}】", taskId, executeId, taskCaseRecord.getStatus());
|
|
|
|
|
// 校验总体任务是否是取消中
|
|
|
|
|
if (StrUtil.equalsAny(taskRecord.getStatus(), TASK_STATUS_CANCELLING, TASK_STATUS_CANCELED)) {
|
|
|
|
@ -351,7 +351,7 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
log.info("completeTask:任务ID:【{}】,初始任务案件状态:【{}】,计算后任务状态:【{}】", taskId, taskCaseRecord.getStatus(), taskStatus);
|
|
|
|
|
if (!StrUtil.equals(taskStatus, taskRecord.getStatus())) {
|
|
|
|
|
taskRecord.setStatus(taskStatus);
|
|
|
|
|
if (StrUtil.equals(taskStatus, TASK_STATUS_SUCCESS)){
|
|
|
|
|
if (StrUtil.equals(taskStatus, TASK_STATUS_SUCCESS)) {
|
|
|
|
|
taskRecord.setFinishTime(LocalDateTime.now());
|
|
|
|
|
}
|
|
|
|
|
super.updateById(taskRecord);
|
|
|
|
|