|
|
@ -323,7 +323,7 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
* @return 是否存在
|
|
|
|
* @return 是否存在
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean graphIndexAnalysis(String casePersonName, String queryLang, String caseId, RuleCondition ruleCondition, ModelAtomicResult atomicResult) {
|
|
|
|
private boolean graphIndexAnalysis(String casePersonName, String queryLang, String caseId, RuleCondition ruleCondition, ModelAtomicResult atomicResult) {
|
|
|
|
boolean exist = false;
|
|
|
|
boolean flag = false;
|
|
|
|
Session session = driver.session();
|
|
|
|
Session session = driver.session();
|
|
|
|
//图谱
|
|
|
|
//图谱
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
@ -336,7 +336,7 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
run = session.run(queryLang, params);
|
|
|
|
run = session.run(queryLang, params);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error("图数据库查询出现错误,查询语句{},参数{}", queryLang, JSONUtil.toJsonStr(params), e);
|
|
|
|
log.error("图数据库查询出现错误,查询语句{},参数{}", queryLang, JSONUtil.toJsonStr(params), e);
|
|
|
|
return exist;
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<ResultDTO> res = Neo4jUtils.getResultDTOList(run);
|
|
|
|
List<ResultDTO> res = Neo4jUtils.getResultDTOList(run);
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
@ -357,12 +357,12 @@ public class ModelServiceImpl implements ModelService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//如果关系判断要求“存在”,则判断count是否大于value
|
|
|
|
//如果关系判断要求“不存在”,则判断条数需要大于0,如果关系判断要求“存在”,则判断count是否大于value
|
|
|
|
if (ruleCondition.getRelationalSymbol().equals("3") && StringUtils.isNotEmpty(ruleCondition.getOperator()) && StringUtils.isNotEmpty(ruleCondition.getValue()) && CalculationUtil.evaluateExpression(String.valueOf(count), ruleCondition.getOperator(), ruleCondition.getValue())) {
|
|
|
|
if ((ruleCondition.getRelationalSymbol().equals("4") && count > 0) || ruleCondition.getRelationalSymbol().equals("3") && StringUtils.isNotEmpty(ruleCondition.getOperator()) && StringUtils.isNotEmpty(ruleCondition.getValue()) && CalculationUtil.evaluateExpression(String.valueOf(count), ruleCondition.getOperator(), ruleCondition.getValue())) {
|
|
|
|
exist = true;
|
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
modelAtomicResultService.saveOrUpdate(atomicResult);
|
|
|
|
modelAtomicResultService.saveOrUpdate(atomicResult);
|
|
|
|
return exist;
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|