소스 검색

ProcessFirstSend_path试图解决

menglu 3 년 전
부모
커밋
fd7d0ba74c
1개의 변경된 파일20개의 추가작업 그리고 7개의 파일을 삭제
  1. 20 7
      ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/websocket/server/WebSocketUtil.java

+ 20 - 7
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/websocket/server/WebSocketUtil.java

@@ -180,7 +180,7 @@ public class WebSocketUtil {
 
 					// path
 					// ProcessFirstSend_path(Repository, id, sendArray);
-					ProcessFirstSend_path(Repository.objectData, id, sendArray);
+					ProcessFirstSend(Repository.objectData, id, sendArray);
 
 					SendAndClear(id, sendArray);
 				}
@@ -191,8 +191,23 @@ public class WebSocketUtil {
 		}
 	}
 
+	// 支持路径通配符*
+	public static void ProcessFirstSend(SceneDataObject objectData, String id, JSONArray sendArray) {
+		try {
+			for (String key : objectData.keySetSelf()) {
+				if (KeywordUtil.containsKey(key)) {
+					continue;
+				}
+				SceneDataValue sdv = objectData.get(key);
+				ProcessFirstSend_path(sdv, id, sendArray);
+			}
+		} catch (Exception e) {
+			log.error(e.getMessage(), e);
+		}
+	}
+
 	// 严格匹配路径,已废弃
-	public static void ProcessFirstSend_path(RepositoryImpl Repository, String id, JSONArray sendArray) {
+	public static void ProcessFirstSend_path(RepositoryImpl Repository, String id, JSONArray sendArray) throws Exception {
 		List<JSONArray> pathList = id2pathList.get(id);
 		for (JSONArray pathArray : pathList) {
 			Object valueObject = ComputeUtil.getValueObject(Repository, pathArray);
@@ -214,7 +229,7 @@ public class WebSocketUtil {
 	}
 
 	// 支持路径通配符*
-	public static void ProcessFirstSend_path(SceneDataObject objectData, String id, JSONArray sendArray) {
+	public static void ProcessFirstSend_path(SceneDataObject objectData, String id, JSONArray sendArray) throws Exception {
 		for (String key : objectData.keySetSelf()) {
 			if (KeywordUtil.containsKey(key)) {
 				continue;
@@ -225,9 +240,9 @@ public class WebSocketUtil {
 	}
 
 	// 支持路径通配符*
-	public static void ProcessFirstSend_path(SceneDataValue sdv, String id, JSONArray sendArray) {
+	public static void ProcessFirstSend_path(SceneDataValue sdv, String id, JSONArray sendArray) throws Exception {
 		List<JSONArray> pathList = id2pathList.get(id);
-		try {
+		{
 			if (sdv.rel_property != null) {
 				if (sdv.rel_property.propertyValueSchema.equals("JSONObject")) {
 					if (sdv.value_object != null) {
@@ -298,8 +313,6 @@ public class WebSocketUtil {
 				} else if (sdv.value_prim != null) {
 				}
 			}
-		} catch (Exception e) {
-			log.error(e.getMessage(), e);
 		}
 	}