|
|
|
@ -47,23 +47,10 @@ public class ModelIndexAtomicRelationServiceImpl extends ServiceImpl<ModelIndexA
|
|
|
|
|
log.warn("saveByModelIndex: modelIndexId 为空,不保存关联关系....modelIndex:{}", JSONUtil.toJsonStr(modelIndex));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String judgeLogic = modelIndex.getJudgeLogic();
|
|
|
|
|
IndexRule indexRule = modelIndex.getIndexRule();
|
|
|
|
|
if (StrUtil.isNotEmpty(judgeLogic)){
|
|
|
|
|
List<String> atomicIndexIds = JudgeLogicUtil.pickAtomicIndexIds(judgeLogic);
|
|
|
|
|
atomicIndexIds.forEach(atomicIndexId -> {
|
|
|
|
|
ModelIndexAtomicRelation modelIndexAtomicRelation = new ModelIndexAtomicRelation();
|
|
|
|
|
modelIndexAtomicRelation.setModelIndexId(modelIndex.getId());
|
|
|
|
|
modelIndexAtomicRelation.setAtomicIndexId(atomicIndexId);
|
|
|
|
|
super.save(modelIndexAtomicRelation);
|
|
|
|
|
});
|
|
|
|
|
}else if(Objects.nonNull(indexRule)){
|
|
|
|
|
if(Objects.nonNull(indexRule)){
|
|
|
|
|
Set<String> ids = new HashSet<>();
|
|
|
|
|
indexRule.getRuleConditionGroupList().forEach(ruleConditionGroup -> {
|
|
|
|
|
ruleConditionGroup.getRuleConditionList().forEach(ruleCondition -> {
|
|
|
|
|
ids.add(ruleCondition.getAtomicIndexId());
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
indexRule.getRuleConditionGroupList().forEach(ruleConditionGroup -> ruleConditionGroup.getRuleConditionList().forEach(ruleCondition -> ids.add(ruleCondition.getAtomicIndexId())));
|
|
|
|
|
ids.forEach(atomicIndexId -> {
|
|
|
|
|
ModelIndexAtomicRelation modelIndexAtomicRelation = new ModelIndexAtomicRelation();
|
|
|
|
|
modelIndexAtomicRelation.setModelIndexId(modelIndex.getId());
|
|
|
|
|