|
|
|
@ -8,6 +8,7 @@ import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
@ -56,8 +57,6 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
|
|
|
|
|
private final ModelCaseMapper modelCaseMapper;
|
|
|
|
|
|
|
|
|
|
private final CasePersonService casePersonService;
|
|
|
|
|
|
|
|
|
|
private final CaseStatusManageService caseStatusManageService;
|
|
|
|
|
|
|
|
|
|
private final LangChainChatService langChainChatService;
|
|
|
|
@ -66,6 +65,10 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private NoteRecordSplitService noteRecordSplitService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private NoteRecordService noteRecordService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CasePersonService casePersonService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询列表
|
|
|
|
@ -198,10 +201,13 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
LangChainChatRes<Object> langChainChatRes = langChainChatService.deleteBase(modelCase.getCaseNo());
|
|
|
|
|
if (200 != langChainChatRes.getCode()) {
|
|
|
|
|
log.error("删除知识库失败:{}, caseNo:{}", langChainChatRes.getMsg(), modelCase.getCaseNo());
|
|
|
|
|
throw new BusinessException("删除知识库失败");
|
|
|
|
|
// throw new BusinessException("删除知识库失败");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
noteRecordService.list(new QueryWrapper<NoteRecord>().in("case_id", ids)).forEach(noteRecord -> noteRecordSplitService.delRecords(noteRecord.getId()));
|
|
|
|
|
List<String> personIds = casePersonService.list(new QueryWrapper<CasePerson>().in("case_id", ids)).stream().map(CasePerson::getId).collect(Collectors.toList());
|
|
|
|
|
personIds.forEach(personId -> casePersonService.removeById(personId));
|
|
|
|
|
int i = modelCaseMapper.deleteBatchIds(ids);
|
|
|
|
|
if (i > 0) {
|
|
|
|
|
return R.okMsg("删除成功");
|
|
|
|
@ -358,7 +364,7 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
Assert.notEmpty(query.getCaseId(), "案件id不能为空");
|
|
|
|
|
Assert.notEmpty(query.getIndexType(), "指标类型不能为空");
|
|
|
|
|
|
|
|
|
|
IPage<IndexDetail> iPage = modelCaseMapper.pageListIndexResult(query,Page.of(pageNum, pageSize));
|
|
|
|
|
IPage<IndexDetail> iPage = modelCaseMapper.pageListIndexResult(query, Page.of(pageNum, pageSize));
|
|
|
|
|
List<IndexDetail> records = iPage.getRecords();
|
|
|
|
|
|
|
|
|
|
// 添加 附属内容
|
|
|
|
@ -370,11 +376,12 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加 指标结果附属内容
|
|
|
|
|
* @param caseId 案件id
|
|
|
|
|
*
|
|
|
|
|
* @param caseId 案件id
|
|
|
|
|
* @param indexDetails 指标结果
|
|
|
|
|
*/
|
|
|
|
|
private void attachRecord(String caseId,List<IndexDetail> indexDetails) {
|
|
|
|
|
if (CollUtil.isEmpty(indexDetails)){
|
|
|
|
|
private void attachRecord(String caseId, List<IndexDetail> indexDetails) {
|
|
|
|
|
if (CollUtil.isEmpty(indexDetails)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|