|
@@ -223,7 +223,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
JSONObject obj = dimensionData.getJSONObject(i);
|
|
JSONObject obj = dimensionData.getJSONObject(i);
|
|
String value = obj.getString(ruleBase.getIndicatorCode());
|
|
String value = obj.getString(ruleBase.getIndicatorCode());
|
|
- if (MatchLogic.matchCondition(indicator.getString("dataType"), ruleBase.getRuleCondition(), threshold, value, obj)) {
|
|
|
|
|
|
+ if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, value, obj)) {
|
|
complianceList.add(obj);
|
|
complianceList.add(obj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -259,8 +259,6 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
for (RuleBase ruleBase : ruleBaseList) {
|
|
for (RuleBase ruleBase : ruleBaseList) {
|
|
//指标对象
|
|
//指标对象
|
|
JSONObject indicator = indicators.getJSONObject(ruleBase.getIndicatorCode());
|
|
JSONObject indicator = indicators.getJSONObject(ruleBase.getIndicatorCode());
|
|
- //阈值类型
|
|
|
|
- String dataType = indicator.getString("dataType");
|
|
|
|
//指标阈值
|
|
//指标阈值
|
|
String threshold = thresholdObj.getString(ruleBase.getId().toString());
|
|
String threshold = thresholdObj.getString(ruleBase.getId().toString());
|
|
//阈值为空时,或者阈值为“unlimited”(不限),不执行该规则
|
|
//阈值为空时,或者阈值为“unlimited”(不限),不执行该规则
|
|
@@ -298,7 +296,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
//账户维度数据
|
|
//账户维度数据
|
|
if (ACCOUNT.equals(ruleBase.getRuleDimension())) {
|
|
if (ACCOUNT.equals(ruleBase.getRuleDimension())) {
|
|
JSONObject accountEntity = dimensionData.getJSONObject(0);
|
|
JSONObject accountEntity = dimensionData.getJSONObject(0);
|
|
- if (MatchLogic.matchCondition(dataType, ruleBase.getRuleCondition(), threshold, accountEntity.getString(ruleBase.getIndicatorCode()), accountEntity)) {
|
|
|
|
|
|
+ if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, accountEntity.getString(ruleBase.getIndicatorCode()), accountEntity)) {
|
|
accountDatas.add(accountEntity);
|
|
accountDatas.add(accountEntity);
|
|
} else {
|
|
} else {
|
|
if (!Check.isNull(accountDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
@@ -316,7 +314,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} else if (PLAN.equals(ruleBase.getRuleDimension())) {
|
|
} else if (PLAN.equals(ruleBase.getRuleDimension())) {
|
|
- planDatas = getOKData(planDatas, dimensionData, ruleBase, dataType, threshold);
|
|
|
|
|
|
+ planDatas = getOKData(planDatas, dimensionData, ruleBase, indicator, threshold);
|
|
if (Check.isNull(planDatas)) {
|
|
if (Check.isNull(planDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
accountDatas = null;
|
|
accountDatas = null;
|
|
@@ -333,7 +331,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} else if (CREATIVE.equals(ruleBase.getRuleDimension())) {
|
|
} else if (CREATIVE.equals(ruleBase.getRuleDimension())) {
|
|
- creativeDatas = getOKData(creativeDatas, dimensionData, ruleBase, dataType, threshold);
|
|
|
|
|
|
+ creativeDatas = getOKData(creativeDatas, dimensionData, ruleBase, indicator, threshold);
|
|
if (Check.isNull(creativeDatas)) {
|
|
if (Check.isNull(creativeDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
accountDatas = null;
|
|
accountDatas = null;
|
|
@@ -350,7 +348,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} else if ("target".equals(ruleBase.getRuleDimension())) {
|
|
} else if ("target".equals(ruleBase.getRuleDimension())) {
|
|
- targetDatas = getOKData(targetDatas, dimensionData, ruleBase, dataType, threshold);
|
|
|
|
|
|
+ targetDatas = getOKData(targetDatas, dimensionData, ruleBase, indicator, threshold);
|
|
if (Check.isNull(targetDatas)) {
|
|
if (Check.isNull(targetDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
if (!Check.isNull(accountDatas)) {
|
|
accountDatas = null;
|
|
accountDatas = null;
|
|
@@ -385,13 +383,13 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
* @throws
|
|
* @throws
|
|
* @author ZHAOXA
|
|
* @author ZHAOXA
|
|
*/
|
|
*/
|
|
- private JSONArray getOKData(JSONArray ruleDatas, JSONArray dimensionData, RuleBase ruleBase, String type, String threshold) {
|
|
|
|
|
|
+ private JSONArray getOKData(JSONArray ruleDatas, JSONArray dimensionData, RuleBase ruleBase, JSONObject indicator, String threshold) {
|
|
if (!Check.isNull(ruleDatas)) {
|
|
if (!Check.isNull(ruleDatas)) {
|
|
JSONArray okData = new JSONArray();
|
|
JSONArray okData = new JSONArray();
|
|
for (int i = 0; i < ruleDatas.size(); i++) {
|
|
for (int i = 0; i < ruleDatas.size(); i++) {
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
- if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
|
|
|
|
+ if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
okData.add(targetEntity);
|
|
okData.add(targetEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -400,7 +398,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
for (int i = 0; i < dimensionData.size(); i++) {
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
JSONObject targetEntity = dimensionData.getJSONObject(i);
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
String value = targetEntity.getString(ruleBase.getIndicatorCode());
|
|
- if (MatchLogic.matchCondition(type, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
|
|
|
|
+ if (MatchLogic.matchCondition(indicator, ruleBase.getRuleCondition(), threshold, value, targetEntity)) {
|
|
ruleDatas.add(targetEntity);
|
|
ruleDatas.add(targetEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|