Pārlūkot izejas kodu

事后规则匹配优化

0027005599 1 gadu atpakaļ
vecāks
revīzija
3f911d1bef

+ 8 - 21
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/ruleengine/SPELUtil.java

@@ -182,14 +182,12 @@ public class SPELUtil {
      */
     public static Boolean isMemberLeftMapAndRightListMap(Map<String, Object> inMap, List<Map<String, Object>> memberList, String mapKey, String listKey) {
         if (null != inMap && CollectionUtil.isNotEmpty(memberList) && StringUtils.isNotBlank(mapKey) && StringUtils.isNotBlank(listKey)) {
-            List<String> itemValueList = new ArrayList<>();
             Object inStr = inMap.get(mapKey);
             for (Map<String, Object> itemMap : memberList) {
                 Object itemValue = itemMap.get(listKey);
-                itemValueList.add(itemValue.toString());
-            }
-            if (itemValueList.contains(inStr.toString())) {
-                return true;
+                if(startWithKey(itemValue.toString(), inStr.toString())){
+                    return true;
+                }
             }
         }
         return false;
@@ -273,28 +271,17 @@ public class SPELUtil {
     }
 
 
-    public static Boolean isNotMemberLeftMap(Map<String, Object> inMap, List<Map<String, Object>> memberList, String[] keyArr) {
-        return !isMemberLeftMap(inMap, memberList, keyArr);
-    }
-
-    public static Boolean isMemberLeftLong(Long inValue, List<Long> memberList) {
-        if (null != inValue && CollectionUtil.isNotEmpty(memberList)) {
-            if (memberList.contains(inValue)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static Boolean isNotMemberLeftObject(Object inValue, List<Object> memberList) {
-        return !isMemberLeftObject(inValue, memberList);
-    }
 
     public static Boolean isMemberLeftObject(Object inValue, List<Object> memberList) {
         if (null != inValue && CollectionUtil.isNotEmpty(memberList)) {
             if (memberList.contains(inValue)) {
                 return true;
             }
+            for(Object member : memberList){
+                if(startWithKey(member.toString(), inValue.toString())){
+                    return true;
+                }
+            }
         }
         return false;
     }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 85
jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/SpelTest.java


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels