|
|
|
@ -22,6 +22,7 @@ import com.supervision.police.dto.caseScore.CaseScoreDetailDTO;
|
|
|
|
|
import com.supervision.police.dto.indexRule.IndexRule;
|
|
|
|
|
import com.supervision.police.dto.indexRule.Operand;
|
|
|
|
|
import com.supervision.police.dto.indexRule.OperandUnit;
|
|
|
|
|
import com.supervision.police.dto.indexRule.RuleCondition;
|
|
|
|
|
import com.supervision.police.mapper.*;
|
|
|
|
|
import com.supervision.police.mybatis.RowSqlMapper;
|
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
@ -234,7 +235,7 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
|
operandUnitResultSet.add(relationSymbol == dbIndexAnalysis(caseId, modelAtomicIndex.getQueryLang(), result));
|
|
|
|
|
break;
|
|
|
|
|
case OPERAND_TYPE_GRAPH:
|
|
|
|
|
operandUnitResultSet.add(relationSymbol == graphIndexAnalysis(casePerson.getName(), modelAtomicIndex, analyseCaseDTO, result));
|
|
|
|
|
operandUnitResultSet.add(relationSymbol == graphIndexAnalysis(casePerson.getName(), modelAtomicIndex.getQueryLang(), analyseCaseDTO.getCaseId(), ruleCondition, result));
|
|
|
|
|
break;
|
|
|
|
|
case OPERAND_TYPE_STRUCTURE:
|
|
|
|
|
ruleCondition.getOperandUnitList().forEach(operandUnit -> operandUnitResultSet.add(structureIndexAnalysis(operandUnit, ruleCondition.getAtomicIndexId(), atomicIndices, notePrompts, evidenceDirectories, caseEvidences, result)));
|
|
|
|
@ -327,12 +328,14 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
|
/**
|
|
|
|
|
* 图谱查询指标分析
|
|
|
|
|
*
|
|
|
|
|
* @param casePersonName 行为人
|
|
|
|
|
* @param modelAtomicIndex 原子指标
|
|
|
|
|
* @param analyseCaseDTO 案件信息
|
|
|
|
|
* @param casePersonName 行为人
|
|
|
|
|
* @param queryLang 查询语句
|
|
|
|
|
* @param caseId 案件ID
|
|
|
|
|
* @param ruleCondition 规则条件
|
|
|
|
|
* @param atomicResult 原子指标结果
|
|
|
|
|
* @return 是否存在
|
|
|
|
|
*/
|
|
|
|
|
private boolean graphIndexAnalysis(String casePersonName, ModelAtomicIndex modelAtomicIndex, AnalyseCaseDTO analyseCaseDTO, ModelAtomicResult atomicResult) {
|
|
|
|
|
private boolean graphIndexAnalysis(String casePersonName, String queryLang, String caseId, RuleCondition ruleCondition, ModelAtomicResult atomicResult) {
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
Session session = driver.session();
|
|
|
|
|
//图谱
|
|
|
|
@ -340,21 +343,22 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
|
// 行为人
|
|
|
|
|
params.put("lawActor", casePersonName);
|
|
|
|
|
// 案号
|
|
|
|
|
params.put("caseId", analyseCaseDTO.getCaseId());
|
|
|
|
|
params.put("caseId", caseId);
|
|
|
|
|
Result run;
|
|
|
|
|
try {
|
|
|
|
|
run = session.run(modelAtomicIndex.getQueryLang(), params);
|
|
|
|
|
run = session.run(queryLang, params);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("图数据库查询出现错误,查询语句{},参数{}", modelAtomicIndex.getQueryLang(), JSONUtil.toJsonStr(params), e);
|
|
|
|
|
log.error("图数据库查询出现错误,查询语句{},参数{}", queryLang, JSONUtil.toJsonStr(params), e);
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
List<ResultDTO> res = Neo4jUtils.getResultDTOList(run);
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (!res.isEmpty()) {
|
|
|
|
|
// 进行遍历,如果有存在的,就设置为有
|
|
|
|
|
for (ResultDTO resultDTO : res) {
|
|
|
|
|
if (StringUtils.isNotEmpty(resultDTO.getRelId())) {
|
|
|
|
|
//存在关系
|
|
|
|
|
flag = true;
|
|
|
|
|
count++;
|
|
|
|
|
atomicResult.setAtomicResult(JudgeResultEnum.EXIST.getCode());
|
|
|
|
|
atomicResult.setRecordId(resultDTO.getRecordId());
|
|
|
|
|
// 在退出循环之前先合并相关文本分片id
|
|
|
|
@ -366,6 +370,9 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CalculationUtil.evaluateExpression(String.valueOf(count), ruleCondition.getOperator(), ruleCondition.getValue())) {
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
modelAtomicResultService.saveOrUpdate(atomicResult);
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|