|
|
@ -1,35 +1,71 @@
|
|
|
|
package com.supervision.police.service.impl;
|
|
|
|
package com.supervision.police.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.supervision.common.constant.TaskRecordConstants;
|
|
|
|
import com.supervision.common.constant.TaskRecordConstants;
|
|
|
|
|
|
|
|
import com.supervision.constant.DataStatus;
|
|
|
|
|
|
|
|
import com.supervision.police.domain.ModelCase;
|
|
|
|
|
|
|
|
import com.supervision.police.domain.NotePrompt;
|
|
|
|
|
|
|
|
import com.supervision.police.domain.NoteRecord;
|
|
|
|
import com.supervision.police.domain.TaskRecord;
|
|
|
|
import com.supervision.police.domain.TaskRecord;
|
|
|
|
import com.supervision.police.dto.taskRecord.TaskRecordVo;
|
|
|
|
import com.supervision.police.dto.taskRecord.TaskRecordVo;
|
|
|
|
import com.supervision.police.service.TaskCaseRecordService;
|
|
|
|
|
|
|
|
import com.supervision.police.service.TaskRecordService;
|
|
|
|
|
|
|
|
import com.supervision.police.mapper.TaskRecordMapper;
|
|
|
|
import com.supervision.police.mapper.TaskRecordMapper;
|
|
|
|
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.supervision.common.constant.NotePromptConstants.TYPE_GRAPH_REASONING;
|
|
|
|
|
|
|
|
import static com.supervision.common.constant.NotePromptConstants.TYPE_STRUCTURAL_REASONING;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author dxy
|
|
|
|
* @author dxy
|
|
|
|
* @description 针对表【task_record】的数据库操作Service实现
|
|
|
|
* @description 针对表【task_record】的数据库操作Service实现
|
|
|
|
* @createDate 2024-12-24 14:44:43
|
|
|
|
* @createDate 2024-12-24 14:44:43
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRecord>
|
|
|
|
public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRecord>
|
|
|
|
implements TaskRecordService{
|
|
|
|
implements TaskRecordService {
|
|
|
|
|
|
|
|
|
|
|
|
final TaskCaseRecordService taskCaseRecordService;
|
|
|
|
final TaskCaseRecordService taskCaseRecordService;
|
|
|
|
|
|
|
|
final ModelCaseService modelCaseService;
|
|
|
|
|
|
|
|
final NoteRecordService noteRecordService;
|
|
|
|
|
|
|
|
final CaseEvidenceService caseEvidenceService;
|
|
|
|
|
|
|
|
final NotePromptService notePromptService;
|
|
|
|
|
|
|
|
final XxlJobService xxlJobService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void executePromptExtractTask(TaskRecordVo taskRecordVo) {
|
|
|
|
public void executePromptExtractTask(TaskRecordVo taskRecordVo) {
|
|
|
|
TaskRecord taskRecord = new TaskRecord();
|
|
|
|
TaskRecord taskRecord = new TaskRecord();
|
|
|
|
BeanUtils.copyProperties(taskRecordVo, taskRecord);
|
|
|
|
BeanUtils.copyProperties(taskRecordVo, taskRecord);
|
|
|
|
save(taskRecord);
|
|
|
|
save(taskRecord);
|
|
|
|
|
|
|
|
NotePrompt prompt = notePromptService.getById(taskRecordVo.getPromptId());
|
|
|
|
switch (taskRecord.getType()) {
|
|
|
|
switch (taskRecord.getType()) {
|
|
|
|
case TaskRecordConstants.TASK_TYPE_ALL_CASE:
|
|
|
|
case TaskRecordConstants.TASK_TYPE_ALL_CASE:
|
|
|
|
|
|
|
|
if (TYPE_GRAPH_REASONING.equals(prompt.getType())) {
|
|
|
|
|
|
|
|
//笔录
|
|
|
|
|
|
|
|
List<ModelCase> modelCases = modelCaseService.lambdaQuery().eq(ModelCase::getDataStatus, DataStatus.AVAILABLE.getCode()).list();
|
|
|
|
|
|
|
|
for (ModelCase modelCase : modelCases) {
|
|
|
|
|
|
|
|
List<NoteRecord> noteRecords = noteRecordService.lambdaQuery().eq(NoteRecord::getCaseId, modelCase.getId()).list();
|
|
|
|
|
|
|
|
for (NoteRecord noteRecord : noteRecords) {
|
|
|
|
|
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
|
|
|
|
|
params.put("taskId", taskRecord.getId());
|
|
|
|
|
|
|
|
params.put("caseId", modelCase.getId());
|
|
|
|
|
|
|
|
params.put("executeId", noteRecord.getId());
|
|
|
|
|
|
|
|
params.put("promptId", taskRecordVo.getPromptId());
|
|
|
|
|
|
|
|
//map转String作为参数
|
|
|
|
|
|
|
|
xxlJobService.executeTaskByJobHandler("extractRecordByTask", new JSONObject(params).toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (TYPE_STRUCTURAL_REASONING.equals(prompt.getType())) {
|
|
|
|
|
|
|
|
//证据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TaskRecordConstants.TASK_TYPE_SPECIFIED_CASE:
|
|
|
|
case TaskRecordConstants.TASK_TYPE_SPECIFIED_CASE:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|