|
|
|
@ -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);
|
|
|
|
|