|
@@ -1,6 +1,7 @@
|
|
|
package org.diagbot.rule.crisis;
|
|
|
|
|
|
import org.diagbot.common.push.bean.CrisisDetail;
|
|
|
+import org.diagbot.common.push.bean.PreResult;
|
|
|
import org.diagbot.common.push.bean.Rule;
|
|
|
import org.diagbot.common.push.bean.RuleApp;
|
|
|
import org.diagbot.common.push.bean.SearchData;
|
|
@@ -41,7 +42,7 @@ public class CrisisApplication {
|
|
|
for (Rule suitRule : suitRules.getValue()) {
|
|
|
if (ruleId.equals(suitRule.getId())) {
|
|
|
isFindRule = true;
|
|
|
- standardText += suitRule.getPub_name() + ";";
|
|
|
+ standardText = mergeStandardText(suitRule);
|
|
|
originText += suitRule.getOriginText() + ";";
|
|
|
break;
|
|
|
}
|
|
@@ -77,4 +78,25 @@ public class CrisisApplication {
|
|
|
}
|
|
|
return crisisMap;
|
|
|
}
|
|
|
+
|
|
|
+ private String mergeStandardText(Rule rule) {
|
|
|
+ //标准值最优先匹配
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(rule.getEq_value())) {
|
|
|
+ sb.append(rule.getPub_name()).append(rule.getEq_operator()).append(rule.getEq_value());
|
|
|
+ } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(rule.getMax_value()) && org.apache.commons.lang3.StringUtils.isNotEmpty(rule.getMin_value())) {
|
|
|
+ sb.append(rule.getPub_name()).append(rule.getMin_operator()).append(rule.getMin_value())
|
|
|
+ .append(rule.getMin_unit()).append(";")
|
|
|
+ .append(rule.getPub_name()).append(rule.getMax_operator()).append(rule.getMax_value())
|
|
|
+ .append(rule.getMax_unit());
|
|
|
+ } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(rule.getMin_value())) {
|
|
|
+ sb.append(rule.getPub_name()).append(rule.getMin_operator()).append(rule.getMin_value())
|
|
|
+ .append(rule.getMin_unit());
|
|
|
+ } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(rule.getMax_value())) {
|
|
|
+ sb.append(rule.getPub_name()).append(rule.getMax_operator()).append(rule.getMax_value())
|
|
|
+ .append(rule.getMax_unit());
|
|
|
+ }
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
}
|