1. 添加查询案件原子指标列表(listCaseAtomicIndex)接口

topo_dev
xueqingkun 9 months ago
parent 42d9366236
commit a2495827a7

@ -100,7 +100,7 @@ public class ModelIndexController {
/**
*
*
* @return
*/
@GetMapping("/listCaseAtomicIndex")

@ -49,6 +49,11 @@ public class ModelAtomicResult implements Serializable {
*/
private String recordsId;
/**
*
*/
private String remark;
/**
* ID

@ -62,7 +62,7 @@ public class CaseAtomicIndexDTO {
this.atomicResult = modelAtomicResult.getAtomicResult();
this.atomicResultId = modelAtomicResult.getId();
this.caseId = modelAtomicResult.getCaseId();
// todo: this.remark = modelAtomicResult.getRemark();
this.remark = modelAtomicResult.getRemark();
}
}
}

@ -28,6 +28,12 @@ public interface ModelIndexService extends IService<ModelIndex> {
R<?> delAtomic(String id);
/**
*
* @param caseId id
* @param indexSource
* @return
*/
List<CaseAtomicIndexDTO> listCaseAtomicIndex(String caseId, String indexSource);
}

@ -167,7 +167,10 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
Assert.notEmpty(caseType, "案件类型不能为空");
// 获取案件类型对应的指标
List<ModelIndex> modelIndexList = modelIndexMapper.selectByCaseType(caseType);
List<ModelIndex> modelIndexList = modelIndexMapper.selectList(
Wrappers.lambdaQuery(ModelIndex.class)
.eq(ModelIndex::getCaseType, caseType)
.eq(ModelIndex::getIndexType, indexSource).eq(ModelIndex::getDataStatus, "1"));
if (CollUtil.isEmpty(modelIndexList)){
return new ArrayList<>(1);
}
@ -189,7 +192,9 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
Map<String, ModelAtomicIndex> modelAtomicIndexMap = modelAtomicIndexList.stream().collect(Collectors.toMap(ModelAtomicIndex::getId, v -> v, (v1, v2) -> v1));
// 查询判定结果数据
List<ModelAtomicResult> modelAtomicResults = modelAtomicResultMapper.selectList(Wrappers.lambdaQuery(ModelAtomicResult.class).eq(ModelAtomicResult::getCaseId, caseId));
List<ModelAtomicResult> modelAtomicResults = modelAtomicResultMapper.selectList(
Wrappers.lambdaQuery(ModelAtomicResult.class).eq(ModelAtomicResult::getCaseId, caseId)
.in(ModelAtomicResult::getAtomicId, automicIndexIds));
Map<String, ModelAtomicResult> modelAtomicResultMap = modelAtomicResults.stream()
.filter(modelAtomicResult -> StrUtil.isEmpty(modelAtomicResult.getAtomicId())).collect(Collectors.toMap(ModelAtomicResult::getAtomicId, v -> v, (v1, v2) -> v1));
@ -197,11 +202,16 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
return modelIndexList.stream().flatMap(modelIndex -> {
String judgeLogic = modelIndex.getJudgeLogic();
List<String> indexIds = pickAtomicIndexIds(judgeLogic);
return indexIds.stream().map(id ->
new CaseAtomicIndexDTO(modelAtomicIndexMap.get(id), modelIndex, modelAtomicResultMap.get(id))).toList().stream();
return indexIds.stream().map(indexId ->
new CaseAtomicIndexDTO(modelAtomicIndexMap.get(indexId), modelIndex, modelAtomicResultMap.get(indexId))).toList().stream();
}).toList();
}
/**
* id
* @param judgeLogic json
* @return id()
*/
private List<String> pickAtomicIndexIds(String judgeLogic) {
List<String> ids = new ArrayList<>();
List<JudgeLogic> logic = JSONUtil.toList(judgeLogic, JudgeLogic.class);

Loading…
Cancel
Save