Browse Source

设定值也可以自动触发了

menglu 3 years ago
parent
commit
7750a41051

+ 14 - 3
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/DependencyUtil.java

@@ -34,9 +34,20 @@ public class DependencyUtil {
 		if (type.equals("point")) {
 			String point = (String) param.get("point");
 			result = new JSONObject();
-			List<ObjectInfo> ObjectInfoList = Repository.point2ObjectInfoList.get(point);
-			for (ObjectInfo ObjectInfo : ObjectInfoList) {
-				result.put(ObjectInfo.objId, ObjectInfo.infoCode);
+			if (Repository.point2ObjectInfoList.containsKey(point)) {
+				List<ObjectInfo> ObjectInfoList = Repository.point2ObjectInfoList.get(point);
+				for (ObjectInfo ObjectInfo : ObjectInfoList) {
+					result.put(ObjectInfo.objId, ObjectInfo.infoCode);
+				}
+			}
+		} else if (type.equals("set")) {
+			String point = (String) param.get("set");
+			result = new JSONObject();
+			if (Repository.set2ObjectInfoList.containsKey(point)) {
+				List<ObjectInfo> ObjectInfoList = Repository.set2ObjectInfoList.get(point);
+				for (ObjectInfo ObjectInfo : ObjectInfoList) {
+					result.put(ObjectInfo.objId, ObjectInfo.infoCode);
+				}
 			}
 		} else if (type.equals("path")) {
 			JSONArray path = (JSONArray) param.get("path");

+ 8 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RepositoryImpl.java

@@ -329,6 +329,14 @@ public class RepositoryImpl extends RepositoryBase {
 					add_count += this.addWaitCompute(sdv);
 				}
 			}
+			if (this.set2ObjectInfoList.containsKey(point)) {
+				List<ObjectInfo> ObjectInfoList = this.set2ObjectInfoList.get(point);
+				for (ObjectInfo ObjectInfo : ObjectInfoList) {
+					SceneDataValue sdv = ObjectInfo.obj.get(ObjectInfo.infoCode);
+					// this.ComputeOccur(sdv);
+					add_count += this.addWaitCompute(sdv);
+				}
+			}
 		}
 		return add_count;
 	}