Browse Source

信息点通过json加载,下一步excel转json

menglu 3 years ago
parent
commit
a5a43b4a8f

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

@@ -35,6 +35,8 @@ public class Constant {
 	public static boolean ibms_physical_world_refresh_enable;
 	public static String config;
 	public static boolean config_refresh_enable;
+	public static String info_point;
+	public static boolean info_point_enable;
 	public static String iot_websocket_url;
 	public static String iot_collect_url;
 	public static String iot_project_url;
@@ -127,6 +129,12 @@ public class Constant {
 					config = element.attribute("path").getValue();
 					config_refresh_enable = Boolean.parseBoolean(element.attribute("refresh_enable").getValue());
 				}
+				iter = document.selectNodes("/root/info_point").iterator();
+				if (iter.hasNext()) {
+					element = (Element) iter.next();
+					info_point = element.attribute("path").getValue();
+					info_point_enable = Boolean.parseBoolean(element.attribute("enable").getValue());
+				}
 
 				iter = document.selectNodes("/root/iot_websocket").iterator();
 				if (iter.hasNext()) {

+ 19 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDLoadUtil.java

@@ -854,6 +854,25 @@ public class RWDLoadUtil {
 		}
 	}
 
+	public static void LoadInfoPoint(RepositoryImpl Repository) throws Exception {
+		String validPath = Constant.info_point;
+
+		{
+			JSONArray classArray = FastJsonReaderUtil.Instance()
+					.ReadJSONArray(new File(validPath + Constant.getSeperator() + "info-point-list.json"));
+			SceneDataSet SceneDataSet = new SceneDataSet(false);
+			SceneDataSet.set = RWDUtil.array2SDOList(classArray);
+			Repository.InfoPointListArray = SceneDataSet;
+		}
+		{
+			JSONArray classArray = FastJsonReaderUtil.Instance()
+					.ReadJSONArray(new File(validPath + Constant.getSeperator() + "info-point-relation.json"));
+			SceneDataSet SceneDataSet = new SceneDataSet(false);
+			SceneDataSet.set = RWDUtil.array2SDOList(classArray);
+			Repository.InfoPointRelationArray = SceneDataSet;
+		}
+	}
+
 	private static String getValidName(SceneDataObject sdo) {
 		String result = null;
 		if (sdo.containsKey("localName")) {

+ 7 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDRepositoryUtil.java

@@ -35,6 +35,10 @@ public class RWDRepositoryUtil {
 				log.warn("LoadIBMSPhysicalWorld");
 				RWDLoadUtil.LoadIBMSPhysicalWorld(Repository);
 			}
+			if(Constant.info_point_enable){
+				log.warn("LoadInfoPoint");
+				RWDLoadUtil.LoadInfoPoint(Repository);
+			}
 
 			log.warn("LoadAlarm");
 			if (Constant.alarm_enable) {
@@ -68,6 +72,9 @@ public class RWDRepositoryUtil {
 
 			Repository.IBMSGroupArray = RepositoryContainer.instance.IBMSGroupArray;
 			Repository.IBMSArrayDic = RepositoryContainer.instance.IBMSArrayDic;
+
+			Repository.InfoPointListArray = RepositoryContainer.instance.InfoPointListArray;
+			Repository.InfoPointRelationArray = RepositoryContainer.instance.InfoPointRelationArray;
 		}
 
 		log.warn("LoadConfig");

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

@@ -57,6 +57,10 @@ public class RepositoryImpl extends RepositoryBase {
 	public SceneDataSet IBMSCalendarModel = new SceneDataSet(false, true);
 	public SceneDataSet IBMSCalendarBinding = new SceneDataSet(false, true);
 
+	// 信息点
+	public SceneDataSet InfoPointListArray = new SceneDataSet(false);
+	public SceneDataSet InfoPointRelationArray = new SceneDataSet(false);
+
 	public ConcurrentHashMap<SceneDataValue, String> sdv2point() {
 		return RepositoryBase.sdv2point;
 	}
@@ -153,6 +157,10 @@ public class RepositoryImpl extends RepositoryBase {
 			result = this.ZKTAlarmTypeArray;
 		} else if (Source.equals("alarm")) {
 			result = this.RepositoryBase.alarmArray;
+		} else if (Source.equals("info-point-list")) {
+			result = this.InfoPointListArray;
+		} else if (Source.equals("info-point-relation")) {
+			result = this.InfoPointRelationArray;
 		}
 		return result;
 	}

+ 4 - 2
ibms-data-sdk/src/main/resources/config.xml

@@ -5,14 +5,15 @@
 	<sdk_version>SDK-D</sdk_version>
 	<!-- zkt-dmp的服务地址 -->
 	<rwd url="http://192.168.100.33:9976/" />
+	<config path="D-config" refresh_enable="true" />
 	<physical_world path="D-physical_world" refresh_enable="true" />
 	<zkt_physical_world path="D-zkt_physical_world" enable="true" refresh_enable="true" />
 	<ibms_physical_world path="D-ibms_physical_world" enable="true" refresh_enable="true" />
+	<info_point path="D-info-point" enable="true" />
 	<!-- zkt-monitor的服务地址 -->
 	<zkt_monitor url="http://192.168.100.33:9909/zkt-monitor/" />
 	<!-- zkt-control的服务地址 -->
 	<zkt_control url="http://192.168.100.33:9909/zkt-control/" />
-	<config path="D-config" refresh_enable="true" />
 	<!-- iot-collect的服务地址 -->
 	<iot_collect url="http://192.168.100.33:9909/iot-collect/" />
 	<!-- iot-project的websocket地址 -->
@@ -26,6 +27,7 @@
 	<alarm enable="true" websocket="ws://192.168.100.76:8870/webSocketServer" url="http://192.168.100.33:9909/ibms-alarm/" service_name="ibms-alarm" />
 	<!-- <alarm enable="true" websocket="http://39.102.43.179:9993/webSocketServer" url="http://39.102.43.179:9993/" service_name="ibms-alarm" /> -->
 
+	<!-- 场景/产品模块编码与后台tab页名称的对应关系 -->
 	<SceneCode2TabName sceneCode="ggzm" tabName="公共照明" />
 	<SceneCode2TabName sceneCode="yjzm" tabName="夜景照明" />
 
@@ -43,7 +45,7 @@
 	<ConfigRelation graphCode="ValveRelationship" relCode="Vv2Eq" objFrom="equipment" objTo="equipment" nameInFrom="限制设备" multiplicityFrom="n" nameInTo="被设备限制" multiplicityTo="n" />
 	<ConfigRelation graphCode="ArchForArch" relCode="Sp2Sp" objFrom="space" objTo="space" nameInFrom="服务于空间" multiplicityFrom="n" nameInTo="被空间服务" multiplicityTo="n" />
 
-	<!-- 中转服务的编码、请求类型、url服务地址 -->
+	<!-- 中转服务的编码、请求类型、url服务地址(根据实际情况添加)-->
 	<Redirect code="获取报警时长" http_request_type="get" url="http://39.102.43.179:9982/alarmTime/query">
 		<!-- 中转服务的header,有几项就写几行 -->
 		<header key="Content-Type" value="application/json" />