|
@@ -23,6 +23,7 @@ import java.lang.reflect.Method;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
@@ -420,18 +421,18 @@ public class SPELUtil {
|
|
|
// Date now = new Date();
|
|
|
// System.out.println(getProjectUseDay(now));
|
|
|
|
|
|
- String s = "234sdfsafasdf423";
|
|
|
- System.out.println(isMemberObjectAndObject(s, "safasd"));
|
|
|
-
|
|
|
- Long day = 1607475808000l;
|
|
|
- System.out.println(getProjectUseDay(day));
|
|
|
-
|
|
|
- ExpressionParser ep = new SpelExpressionParser();
|
|
|
- // 创建上下文变量
|
|
|
- EvaluationContext ctx = new StandardEvaluationContext();
|
|
|
- ctx.setVariable("alarmTime", "2018-09-26 13:00:00");
|
|
|
- ctx.setVariable("location", "二楼201机房");
|
|
|
- System.out.println(ep.parseExpression("告警发生时间 #{#alarmTime},位置是在#{#location}", new TemplateParserContext()).getValue(ctx));
|
|
|
+// String s = "234sdfsafasdf423";
|
|
|
+// System.out.println(isMemberObjectAndObject(s, "safasd"));
|
|
|
+//
|
|
|
+// Long day = 1607475808000l;
|
|
|
+// System.out.println(getProjectUseDay(day));
|
|
|
+//
|
|
|
+// ExpressionParser ep = new SpelExpressionParser();
|
|
|
+// // 创建上下文变量
|
|
|
+// EvaluationContext ctx = new StandardEvaluationContext();
|
|
|
+// ctx.setVariable("alarmTime", "2018-09-26 13:00:00");
|
|
|
+// ctx.setVariable("location", "二楼201机房");
|
|
|
+// System.out.println(ep.parseExpression("告警发生时间 #{#alarmTime},位置是在#{#location}", new TemplateParserContext()).getValue(ctx));
|
|
|
// String test ="A0123123";
|
|
|
// System.out.println(isNumeric(test));
|
|
|
// String[] rolesArr = new String []{"correlationMedicalDiagnoseCode","111"};
|
|
@@ -441,5 +442,22 @@ public class SPELUtil {
|
|
|
// String srcStr = "sfdsalfjasldfjsadlfjsald;fj1123";
|
|
|
// String key = "fdsalf";
|
|
|
// System.out.println(startWithKey(srcStr, key));
|
|
|
+
|
|
|
+
|
|
|
+ Set<String> sortSet = new TreeSet<String>(new Comparator<String>() {
|
|
|
+ @Override
|
|
|
+ public int compare(String o1, String o2) {
|
|
|
+ int lleng = o1.length();
|
|
|
+ int rleng = o2.length();
|
|
|
+ return rleng-lleng;//降序排列
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Set<String> condStrParamName = new HashSet<>();
|
|
|
+ condStrParamName.add("sdfsdf");
|
|
|
+ condStrParamName.add("123333333");
|
|
|
+ condStrParamName.add("1");
|
|
|
+ condStrParamName.add("2343");
|
|
|
+ sortSet.addAll(condStrParamName);
|
|
|
+ System.out.println(sortSet);
|
|
|
}
|
|
|
}
|