规则命中返回配置

This commit is contained in:
andywang
2022-08-10 14:25:46 +08:00
parent f11ba7b1bc
commit 34f868b21b
7 changed files with 29 additions and 10 deletions

View File

@@ -12,4 +12,5 @@ public class SessionData {
private Long organId; // 组织id
private Long engineId; // 引擎id
private Integer reqType;//请求类型
private Integer ruleHitRspConfig; // 规则命中返回配置默认10未命中不返回1未命中返回
}

View File

@@ -272,10 +272,7 @@ public class RuleServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo> imple
@Override
public List<JSONObject> setComplexRuleOutput(Long versionId, Map<String,Object> temp, Map<String, Object> input, String outType) {
List<JSONObject> jsonObjectList = outputService.setOutput(new StrategyOutput(versionId, StrategyType.COMPLEX_RULE,outType), temp);
// for (JSONObject jsonObject : jsonObjectList) {
// input.putAll(jsonObject);
// }
List<JSONObject> jsonObjectList = outputService.setOutput(new StrategyOutput(versionId, StrategyType.COMPLEX_RULE,outType), input, temp);
return jsonObjectList;
}

View File

@@ -24,5 +24,7 @@ public interface StrategyOutputService extends IService<StrategyOutput> {
List<JSONObject> setOutput(StrategyOutput entity, Map<String,Object> input);
List<JSONObject> setOutput(StrategyOutput entity, Map<String,Object> input, Map<String,Object> temp);
boolean judgeOutCondition(String condition,Map<String,Object> input);
}

View File

@@ -130,6 +130,11 @@ public class StrategyOutputServiceImpl extends ServiceImpl<StrategyOutputMapper,
//设置输出传入map向map中放入输出并且返回输出列表
@Override
public List<JSONObject> setOutput(StrategyOutput entity, Map<String, Object> input) {
return setOutput(entity, input, null);
}
@Override
public List<JSONObject> setOutput(StrategyOutput entity, Map<String, Object> input, Map<String,Object> temp) {
List<StrategyOutput> strategyOutputList = this.queryByTactics(entity);
List<JSONObject> jsonList = new ArrayList<>();
if (strategyOutputList != null && strategyOutputList.size() > 0) {
@@ -161,6 +166,9 @@ public class StrategyOutputServiceImpl extends ServiceImpl<StrategyOutputMapper,
if(!field.getIsLocalVariable()){
input.put(fieldEn, value);
}
if(temp != null){
temp.put(fieldEn, value);
}
jsonList.add(json);
}
}