Browse Source

1.1.3_0.0.36 完善日志,使用新版excel信息点

menglu 3 years ago
parent
commit
77bdd5ce0a

+ 2 - 2
ibms-data-sdk/pom.xml

@@ -2,7 +2,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>com.persagy</groupId>
 	<artifactId>ibms-data-sdk</artifactId>
-	<version>1.1.2</version>
+	<version>1.1.3</version>
 
 	<repositories>
 		<repository>
@@ -214,7 +214,7 @@
 		<dependency>
 			<groupId>com.persagy</groupId>
 			<artifactId>sailfish</artifactId>
-			<version>0.0.35</version>
+			<version>0.0.36</version>
 		</dependency>
 	</dependencies>
 

+ 50 - 54
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/DaemonThread.java

@@ -15,7 +15,6 @@ import com.persagy.ibms.core.util.LogOfDownload;
 import com.persagy.ibms.core.util.LogOfRun;
 import com.persagy.ibms.core.util.LogUtil;
 import com.persagy.ibms.core.util.RepositoryComputeThread;
-import com.persagy.ibms.data.sdk.test.CheckTest;
 import com.persagy.ibms.data.sdk.util.Constant;
 import com.persagy.ibms.data.sdk.util.DeamonUtil;
 import com.persagy.ibms.data.sdk.util.RWDLoadUtil;
@@ -48,11 +47,6 @@ public class DaemonThread extends Thread {
 	}
 
 	public static boolean dir_already = false;
-	public static boolean initialized = false;
-	public static String path_config;
-	public static String path_physical_world;
-	public static String path_zkt_physical_world;
-	public static String path_ibms_physical_world;
 
 	public static List<RepositoryComputeThread> threadList = new CopyOnWriteArrayList<RepositoryComputeThread>();
 
@@ -96,16 +90,15 @@ public class DaemonThread extends Thread {
 				RepositoryContainer.RepositoryProject.SuccessLogOfDownloadListMap.put("ibms_physical_world",
 						new CopyOnWriteArrayList<LogOfDownload>());
 			}
-			dir_already = true;
-		}
-
-		if (Constant.check) {
-			try {
-				CheckTest.test(new String[0]);
-			} catch (Exception e) {
-				log.error(e.getMessage(), e);
+			if (Constant.info_point_enable && Constant.info_point_version.equals("new")) {
+				File root = new File(Constant.info_point);
+				if (!root.exists()) {
+					root.mkdir();
+				}
+				RepositoryContainer.RepositoryProject.LogOfDownloadListMap.put("info_point", new CopyOnWriteArrayList<LogOfDownload>());
+				RepositoryContainer.RepositoryProject.SuccessLogOfDownloadListMap.put("info_point", new CopyOnWriteArrayList<LogOfDownload>());
 			}
-			return;
+			dir_already = true;
 		}
 
 		// 初始加载后break
@@ -117,31 +110,33 @@ public class DaemonThread extends Thread {
 			}
 
 			boolean dir_all_valid = true;
-			String tmp_config = null;
 			{
-				tmp_config = Constant.getLatestPath(Constant.config, false, false);
-				if (tmp_config == null) {
+				String tmp_dir = Constant.getLatestPath(Constant.config, false, true);
+				if (tmp_dir == null) {
 					dir_all_valid = false;
 				}
 			}
-			String tmp_physical_world = null;
 			{
-				tmp_physical_world = Constant.getLatestPath(Constant.physical_world, true, false);
-				if (tmp_physical_world == null) {
+				String tmp_dir = Constant.getLatestPath(Constant.physical_world, true, true);
+				if (tmp_dir == null) {
 					dir_all_valid = false;
 				}
 			}
-			String tmp_zkt_physical_world = null;
 			if (Constant.zkt_physical_world_enable) {
-				tmp_zkt_physical_world = Constant.getLatestPath(Constant.zkt_physical_world, true, false);
-				if (tmp_zkt_physical_world == null) {
+				String tmp_dir = Constant.getLatestPath(Constant.zkt_physical_world, true, true);
+				if (tmp_dir == null) {
 					dir_all_valid = false;
 				}
 			}
-			String tmp_ibms_physical_world = null;
 			if (Constant.ibms_physical_world_enable) {
-				tmp_ibms_physical_world = Constant.getLatestPath(Constant.ibms_physical_world, true, false);
-				if (tmp_ibms_physical_world == null) {
+				String tmp_dir = Constant.getLatestPath(Constant.ibms_physical_world, true, true);
+				if (tmp_dir == null) {
+					dir_all_valid = false;
+				}
+			}
+			if (Constant.info_point_enable && Constant.info_point_version.equals("new")) {
+				String tmp_dir = Constant.getLatestPath(Constant.info_point, true, true);
+				if (tmp_dir == null) {
 					dir_all_valid = false;
 				}
 			}
@@ -151,27 +146,40 @@ public class DaemonThread extends Thread {
 
 			LogOfRun LogOfRun = new LogOfRun();
 			RepositoryContainer.RepositoryProject.AddLogOfRun(LogOfRun);
-			LogOfRun.setTime("config", null, tmp_config);
-			LogOfRun.setTime("physical_world", null, tmp_physical_world);
-			if (Constant.zkt_physical_world_enable) {
-				LogOfRun.setTime("zkt_physical_world", null, tmp_zkt_physical_world);
-			}
-			if (Constant.ibms_physical_world_enable) {
-				LogOfRun.setTime("ibms_physical_world", null, tmp_ibms_physical_world);
-			}
 			try {
 				RepositoryImpl Repository = new RepositoryImpl(RepositoryContainer.RepositoryProject, Constant.use_thread, Constant.enable_factor,
 						Constant.compute_thread_count, Constant.compute_thread_sdv_interval);
-				RWDRepositoryUtil.DoRepository(Repository, true);
+				RWDRepositoryUtil.DoRepository(LogOfRun, Repository, true);
 				RepositoryContainer.instance = Repository;
 				Repository.threadStart();
+				RepositoryContainer.RepositoryProject.compute_finish = true;
 				log.warn("compute finish");
-				path_config = tmp_config;
-				path_physical_world = tmp_physical_world;
-				path_zkt_physical_world = tmp_zkt_physical_world;
-				path_ibms_physical_world = tmp_ibms_physical_world;
-				DaemonThread.initialized = true;
+				for (String resource : LogOfRun.resourceTime_new.keySet()) {
+					RepositoryContainer.RepositoryProject.resourceMap_valid.put(resource, LogOfRun.resourceTime_new.get(resource));
+				}
+
+				LogOfRun.status = "success";
+				RepositoryContainer.RepositoryProject.AddSuccessLogOfRun(LogOfRun);
+
+				if (LogOfRun.errorList.size() == 0) {
+					A.perfect();
+				} else {
+					A.good();
+				}
+			} catch (Exception e) {
+				String message = LogUtil.GetExceptionStackTrace(e);
+				log.error(e.getMessage(), e);
+				LogOfRun.error(null, message);
+				LogOfRun.status = "failure";
 
+				A.bad();
+			}
+			for (String resource : LogOfRun.resourceTime_new.keySet()) {
+				RepositoryContainer.RepositoryProject.resourceMap_try.put(resource, LogOfRun.resourceTime_new.get(resource));
+			}
+			LogOfRun.endTime = new Date();
+
+			try {
 				if (Constant.iot_websocket_url != null) {
 					log.warn("iot-websocket");
 					IOTWebSocketClient.client = new IOTWebSocketClient(new URI(Constant.iot_websocket_url + "?projectId="
@@ -196,26 +204,14 @@ public class DaemonThread extends Thread {
 					// log.info("连接成功");
 					Thread.sleep(1000L);
 				}
-
-				LogOfRun.status = "success";
-				RepositoryContainer.RepositoryProject.AddSuccessLogOfRun(LogOfRun);
-
-				if (LogOfRun.errorList.size() == 0) {
-					A.perfect();
-				} else {
-					A.good();
-				}
 			} catch (Exception e) {
 				String message = LogUtil.GetExceptionStackTrace(e);
 				log.error(e.getMessage(), e);
 				LogOfRun.error(null, message);
 				LogOfRun.status = "failure";
-
-				A.bad();
 			}
-			LogOfRun.endTime = new Date();
 
-			if (DaemonThread.initialized) {
+			if (RepositoryContainer.RepositoryProject.compute_finish) {
 				break;
 			}
 		}

+ 1 - 1
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/DownloadThread_config.java

@@ -95,7 +95,7 @@ public class DownloadThread_config extends Thread {
 		String validPath = Constant.getLatestPath(Constant.config, false);
 
 		String tmpPath = Constant.config + Constant.getSeperator() + "tmp" + ".json";
-		RWDDownloadUtil.LoadConfig(tmpPath, LogOfDownload);
+		RWDDownloadUtil.Load_config(tmpPath, LogOfDownload);
 		File tmp = new File(tmpPath);
 
 		boolean compare_valid = false;

+ 122 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/DownloadThread_info_point.java

@@ -0,0 +1,122 @@
+package com.persagy.ibms.data.sdk.service;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+
+import org.springframework.stereotype.Component;
+
+import com.persagy.ibms.core.util.ConfigRefresh;
+import com.persagy.ibms.core.util.FileUtil;
+import com.persagy.ibms.core.util.LogOfDownload;
+import com.persagy.ibms.core.util.LogUtil;
+import com.persagy.ibms.data.sdk.util.Constant;
+import com.persagy.ibms.data.sdk.util.RWDDownloadUtil;
+import com.persagy.ibms.data.sdk.util.RepositoryContainer;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Component
+public class DownloadThread_info_point extends Thread {
+	@PostConstruct
+	public void init() {
+		new Thread(this).start();
+	}
+
+	private volatile boolean stop = false;
+
+	public void requestStop() {
+		stop = true;
+		try {
+			this.join();
+		} catch (InterruptedException e) {
+			log.error(e.getMessage(), e);
+		}
+	}
+
+	public void run() {
+		while (true) {
+			try {
+				Thread.sleep(1000L);
+			} catch (InterruptedException e) {
+				log.error(e.getMessage(), e);
+			}
+
+			if (DaemonThread.dir_already) {
+				break;
+			}
+		}
+
+		String name = "info_point";
+		ConfigRefresh ConfigRefresh = Constant.ConfigRefreshMap.get(name);
+		while (!stop) {
+			try {
+				Thread.sleep(1000L);
+			} catch (InterruptedException e) {
+				log.error(e.getMessage(), e);
+			}
+
+			Date currTime = new Date();
+			boolean changed = false;
+			if (ConfigRefresh.last_refresh == null
+					|| currTime.getTime() - ConfigRefresh.last_refresh.getTime() > 1000L * ConfigRefresh.interval_second) {
+				if (ConfigRefresh.enable && Constant.info_point_version.equals("new")) {
+					LogOfDownload LogOfDownload = new LogOfDownload();
+					RepositoryContainer.RepositoryProject.AddLogOfDownload(name, LogOfDownload);
+					try {
+						log.warn(name + " check begin");
+						changed = Process(LogOfDownload);
+						if (changed) {
+							String validPath = Constant.getLatestPath(Constant.info_point, false, false);
+							log.warn(name + " check end " + validPath);
+						} else {
+							log.warn(name + " check end");
+						}
+						LogOfDownload.status = "success";
+						RepositoryContainer.RepositoryProject.AddSuccessLogOfDownload(name, LogOfDownload);
+					} catch (Exception e) {
+						String message = LogUtil.GetExceptionStackTrace(e);
+						log.error(e.getMessage(), e);
+						LogOfDownload.error(null, message);
+						LogOfDownload.status = "failure";
+					}
+					LogOfDownload.endTime = new Date();
+				}
+				ConfigRefresh.last_refresh = currTime;
+			}
+		}
+	}
+
+	private boolean Process(LogOfDownload LogOfDownload) throws Exception {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+		String validPath = Constant.getLatestPath(Constant.info_point, true);
+
+		String tmpPath = Constant.info_point + Constant.getSeperator() + "tmp1";
+		RWDDownloadUtil.Load_info_point_new(tmpPath, LogOfDownload);
+		File tmp = new File(tmpPath);
+
+		boolean compare_valid = false;
+		if (validPath != null) {
+			File valid = new File(validPath);
+			compare_valid = FileUtil.compareRecursive(valid, tmp, LogOfDownload);
+			LogOfDownload.pathOld = validPath;
+		}
+		boolean result;
+		if (!compare_valid) {
+			Date currTime = new Date();
+			String pathNew = Constant.info_point + Constant.getSeperator() + sdf.format(currTime);
+			tmp.renameTo(new File(pathNew));
+			result = true;
+			LogOfDownload.pathNew = pathNew;
+		} else {
+			result = false;
+		}
+		if (Constant.clear_old_dir) {
+			RWDDownloadUtil.Clear(Constant.info_point, true);
+		}
+		return result;
+	}
+}

+ 26 - 54
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/RefreshThread.java

@@ -26,11 +26,6 @@ public class RefreshThread extends Thread {
 
 	private volatile boolean stop = false;
 
-	String path_config;
-	String path_physical_world;
-	String path_zkt_physical_world;
-	String path_ibms_physical_world;
-
 	public void requestStop() {
 		stop = true;
 		try {
@@ -48,16 +43,11 @@ public class RefreshThread extends Thread {
 				log.error(e.getMessage(), e);
 			}
 
-			if (DaemonThread.initialized) {
+			if (RepositoryContainer.RepositoryProject.compute_finish) {
 				break;
 			}
 		}
 
-		this.path_config = DaemonThread.path_config;
-		this.path_physical_world = DaemonThread.path_physical_world;
-		this.path_zkt_physical_world = DaemonThread.path_zkt_physical_world;
-		this.path_ibms_physical_world = DaemonThread.path_ibms_physical_world;
-
 		while (!stop) {
 			try {
 				Thread.sleep(1000L);
@@ -69,53 +59,39 @@ public class RefreshThread extends Thread {
 			boolean changed_physical_world = false;
 			boolean changed_zkt_physical_world = false;
 			boolean changed_ibms_physical_world = false;
-			String tmp_config = null;
+			boolean changed_info_point = false;
 			{
-				tmp_config = Constant.getLatestPath(Constant.config, false, false);
-				if (tmp_config != null && tmp_config.compareTo(this.path_config) > 0) {
+				String tmp_dir = Constant.getLatestPath(Constant.config, false, true);
+				if (tmp_dir != null && tmp_dir.compareTo(RepositoryContainer.RepositoryProject.resourceMap_try.get("config")) > 0) {
 					changed_config = true;
 				}
 			}
-			String tmp_physical_world = null;
 			{
-				tmp_physical_world = Constant.getLatestPath(Constant.physical_world, true, false);
-				if (tmp_physical_world != null && tmp_physical_world.compareTo(this.path_physical_world) > 0) {
+				String tmp_dir = Constant.getLatestPath(Constant.physical_world, true, true);
+				if (tmp_dir != null && tmp_dir.compareTo(RepositoryContainer.RepositoryProject.resourceMap_try.get("physical_world")) > 0) {
 					changed_physical_world = true;
 				}
 			}
-			String tmp_zkt_physical_world = null;
 			if (Constant.zkt_physical_world_enable) {
-				tmp_zkt_physical_world = Constant.getLatestPath(Constant.zkt_physical_world, true, false);
-				if (tmp_zkt_physical_world != null && tmp_zkt_physical_world.compareTo(this.path_zkt_physical_world) > 0) {
+				String tmp_dir = Constant.getLatestPath(Constant.zkt_physical_world, true, true);
+				if (tmp_dir != null && tmp_dir.compareTo(RepositoryContainer.RepositoryProject.resourceMap_try.get("zkt_physical_world")) > 0) {
 					changed_zkt_physical_world = true;
 				}
 			}
-			String tmp_ibms_physical_world = null;
 			if (Constant.ibms_physical_world_enable) {
-				tmp_ibms_physical_world = Constant.getLatestPath(Constant.ibms_physical_world, true, false);
-				if (tmp_ibms_physical_world != null && tmp_ibms_physical_world.compareTo(this.path_ibms_physical_world) > 0) {
+				String tmp_dir = Constant.getLatestPath(Constant.ibms_physical_world, true, true);
+				if (tmp_dir != null && tmp_dir.compareTo(RepositoryContainer.RepositoryProject.resourceMap_try.get("ibms_physical_world")) > 0) {
 					changed_ibms_physical_world = true;
 				}
 			}
-
-			if (changed_config || changed_physical_world || changed_zkt_physical_world || changed_ibms_physical_world) {
-				if (changed_config) {
-					log.warn("config: " + this.path_config + " -> " + tmp_config);
-				}
-				if (changed_physical_world) {
-					log.warn("physical_world: " + this.path_physical_world + " -> " + tmp_physical_world);
-				}
-				if (changed_zkt_physical_world) {
-					log.warn("zkt_physical_world: " + this.path_zkt_physical_world + " -> " + tmp_zkt_physical_world);
+			if (Constant.info_point_enable && Constant.info_point_version.equals("new")) {
+				String tmp_dir = Constant.getLatestPath(Constant.info_point, true, true);
+				if (tmp_dir != null && tmp_dir.compareTo(RepositoryContainer.RepositoryProject.resourceMap_try.get("info_point")) > 0) {
+					changed_info_point = true;
 				}
-				if (changed_ibms_physical_world) {
-					log.warn("ibms_physical_world: " + this.path_ibms_physical_world + " -> " + tmp_ibms_physical_world);
-				}
-				this.path_config = tmp_config;
-				this.path_physical_world = tmp_physical_world;
-				this.path_zkt_physical_world = tmp_zkt_physical_world;
-				this.path_ibms_physical_world = tmp_ibms_physical_world;
+			}
 
+			if (changed_config || changed_physical_world || changed_zkt_physical_world || changed_ibms_physical_world || changed_info_point) {
 				try {
 					Thread.sleep(1000L);
 				} catch (InterruptedException e) {
@@ -124,21 +100,15 @@ public class RefreshThread extends Thread {
 
 				LogOfRun LogOfRun = new LogOfRun();
 				RepositoryContainer.RepositoryProject.AddLogOfRun(LogOfRun);
-				LogOfRun.setTime("config", changed_config ? DaemonThread.path_config : null, tmp_config);
-				LogOfRun.setTime("physical_world", changed_physical_world ? DaemonThread.path_physical_world : null, tmp_physical_world);
-				if (Constant.zkt_physical_world_enable) {
-					LogOfRun.setTime("zkt_physical_world", changed_zkt_physical_world ? DaemonThread.path_zkt_physical_world : null,
-							tmp_zkt_physical_world);
-				}
-				if (Constant.ibms_physical_world_enable) {
-					LogOfRun.setTime("ibms_physical_world", changed_ibms_physical_world ? DaemonThread.path_ibms_physical_world : null,
-							tmp_ibms_physical_world);
+				for (String resource : RepositoryContainer.RepositoryProject.resourceMap_valid.keySet()) {
+					LogOfRun.resourceTime_old.put(resource, RepositoryContainer.RepositoryProject.resourceMap_valid.get(resource));
 				}
 				try {
 					log.warn("recompute begin");
 					RepositoryImpl Repository = new RepositoryImpl(RepositoryContainer.RepositoryProject, Constant.use_thread, Constant.enable_factor,
 							Constant.compute_thread_count, Constant.compute_thread_sdv_interval);
-					RWDRepositoryUtil.DoRepository(Repository, changed_physical_world || changed_zkt_physical_world || changed_ibms_physical_world);
+					RWDRepositoryUtil.DoRepository(LogOfRun, Repository,
+							changed_physical_world || changed_zkt_physical_world || changed_ibms_physical_world || changed_info_point);
 					RepositoryImpl RepositoryOld = RepositoryContainer.instance;
 					RepositoryContainer.instance = Repository;
 					// 停止老的计算线程
@@ -152,10 +122,9 @@ public class RefreshThread extends Thread {
 					int[] recomputeAlarm_count = Repository.recomputeAlarm();
 					log.warn("recomputeAlarm item: " + recomputeAlarm_count[0] + " affect: " + recomputeAlarm_count[1]);
 					log.warn("recompute finish");
-					DaemonThread.path_config = this.path_config;
-					DaemonThread.path_physical_world = this.path_physical_world;
-					DaemonThread.path_zkt_physical_world = this.path_zkt_physical_world;
-					DaemonThread.path_ibms_physical_world = this.path_ibms_physical_world;
+					for (String resource : LogOfRun.resourceTime_new.keySet()) {
+						RepositoryContainer.RepositoryProject.resourceMap_valid.put(resource, LogOfRun.resourceTime_new.get(resource));
+					}
 
 					LogOfRun.status = "success";
 					RepositoryContainer.RepositoryProject.AddSuccessLogOfRun(LogOfRun);
@@ -173,6 +142,9 @@ public class RefreshThread extends Thread {
 
 					A.bad();
 				}
+				for (String resource : LogOfRun.resourceTime_new.keySet()) {
+					RepositoryContainer.RepositoryProject.resourceMap_try.put(resource, LogOfRun.resourceTime_new.get(resource));
+				}
 				LogOfRun.endTime = new Date();
 			}
 		}

+ 0 - 81
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/test/CheckTest.java

@@ -1,81 +0,0 @@
-package com.persagy.ibms.data.sdk.test;
-
-import java.io.File;
-import java.util.List;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.persagy.ibms.core.data.SceneObject;
-import com.persagy.ibms.core.data.SceneProperty;
-import com.persagy.ibms.core.util.ComputeUtil;
-import com.persagy.ibms.core.util.FastJsonReaderUtil;
-import com.persagy.ibms.core.util.FastJsonUtil;
-import com.persagy.ibms.data.sdk.util.Constant;
-import com.persagy.ibms.data.sdk.util.RWDLoadUtil;
-import com.persagy.ibms.data.sdk.util.RWDRepositoryUtil;
-import com.persagy.ibms.data.sdk.util.RepositoryContainer;
-import com.persagy.ibms.data.sdk.util.RepositoryImpl;
-
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-public class CheckTest {
-
-	public static void test(String[] args) throws Exception {
-		RepositoryImpl Repository = new RepositoryImpl(RepositoryContainer.RepositoryProject, Constant.use_thread, Constant.enable_factor,
-				Constant.compute_thread_count, Constant.compute_thread_sdv_interval);
-		RWDRepositoryUtil.DoRepository(Repository, true);
-		RepositoryContainer.instance = Repository;
-		{
-			Repository.property2SDV_enable = true;
-			Repository.property2SDV.clear();
-
-			log.warn("LoadConfig");
-			SceneObject sceneObject = new SceneObject();
-			{
-				JSONObject sceneJSON_ori = FastJsonReaderUtil.Instance().ReadJSONObject(new File(Constant.getLatestPath(Constant.config, false)));
-				JSONArray PropertyList_ori = sceneJSON_ori.getJSONArray("PropertyList");
-				JSONObject sceneJSON = new JSONObject();
-				JSONArray PropertyList = new JSONArray();
-				for (int i = 0; i < PropertyList_ori.size(); i++) {
-					JSONObject Property = PropertyList_ori.getJSONObject(i);
-					String PropertyName = Property.getString("PropertyName");
-					if (PropertyName.equals("general_query")) {
-					} else {
-						PropertyList.add(Property);
-					}
-				}
-				sceneJSON.put("PropertyList", PropertyList);
-				FastJsonUtil.Set_JavaObject(sceneJSON, sceneObject);
-				Repository.sceneJSON = sceneJSON;
-			}
-			Repository.sceneObject = sceneObject;
-			ComputeUtil.RefreshRepository(Repository);
-			List<List<SceneProperty>> spListList = ComputeUtil.computePrepare(Repository);
-
-			log.warn("LoadPhysicalWorld");
-			RWDLoadUtil.LoadPhysicalWorld(Repository);
-			log.warn("LoadReference");
-			RWDLoadUtil.LoadReference(Repository);
-			if (Constant.zkt_physical_world_enable) {
-				log.warn("LoadZKTPhysicalWorld");
-				RWDLoadUtil.LoadZKTPhysicalWorld(Repository);
-			}
-			if (Constant.ibms_physical_world_enable) {
-				log.warn("LoadIBMSPhysicalWorld");
-				RWDLoadUtil.LoadIBMSPhysicalWorld(Repository);
-			}
-			if (Constant.alarm_enable) {
-				log.warn("LoadAlarm");
-				RWDLoadUtil.LoadAlarm(Repository, true);
-			}
-			log.warn("computeAll");
-			ComputeUtil.computeAll(Repository, spListList);
-
-			Repository.property2SDV_enable = false;
-			Repository.property2SDV.clear();
-		}
-		log.warn("compute finish");
-		// RepositoryContainer.RepositoryBase.compute_finish = true;
-	}
-}

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

@@ -47,6 +47,7 @@ public class Constant {
 	public static boolean ibms_physical_world_enable;
 	public static String info_point;
 	public static boolean info_point_enable;
+	public static String info_point_version;
 	public static String iot_websocket_url;
 	public static String iot_collect_url;
 	public static String iot_project_url;
@@ -176,6 +177,12 @@ public class Constant {
 					element = (Element) iter.next();
 					info_point = element.attribute("path").getValue();
 					info_point_enable = Boolean.parseBoolean(element.attribute("enable").getValue());
+					info_point_version = element.attribute("version").getValue();
+					if (info_point_enable) {
+						boolean enable = Boolean.parseBoolean(element.attribute("refresh_enable").getValue());
+						long interval_second = Long.parseLong(element.attribute("refresh_interval_second").getValue());
+						ConfigRefreshMap.put("info_point", new ConfigRefresh(enable, interval_second));
+					}
 				}
 
 				iter = document.selectNodes("/root/iot_websocket").iterator();

+ 114 - 55
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/ExeclReadEquipStaticInfoUtil.java

@@ -12,39 +12,13 @@ import org.apache.poi.ss.util.CellRangeAddress;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.persagy.ibms.core.data.SceneDataObject;
+import com.persagy.ibms.core.util.FastJsonUtil;
 import com.persagy.ibms.core.util.FileUtil;
 import com.persagy.ibms.data.sdk.service.rest.RestUtil;
 
 public class ExeclReadEquipStaticInfoUtil {
 
-	public static JSONObject ReadEquipStaticInfo(String firstName, String sheetName) throws Exception {
-		FileInputStream fis = new FileInputStream(FileUtil.file(firstName + ".xlsx"));
-		Workbook workbook = WorkbookFactory.create(new BufferedInputStream(fis));
-		Sheet sheet = workbook.getSheet(sheetName);
-		JSONObject object = new JSONObject();
-		for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
-			// 获取合并单元格的值
-			CellRangeAddress ca = sheet.getMergedRegion(i);
-			int firstRow = ca.getFirstRow();
-			Row fRow = sheet.getRow(firstRow);
-			Cell fCell = fRow.getCell(0);
-			String caVal = getCellValue(fCell);
-			// 获取合并单元格之后的值,形成树形结构
-			JSONArray dic = new JSONArray();
-			for (int j = firstRow; j <= ca.getLastRow(); j++) {
-				Row row = sheet.getRow(j);
-				JSONObject obj = new JSONObject();
-				obj.put("name", getCellValue(row.getCell(1)));
-				obj.put("code", getCellValue(row.getCell(2)));
-				obj.put("enable", row.getCell(3).getBooleanCellValue());
-				dic.add(obj);
-			}
-			object.put(caVal, dic);
-		}
-		fis.close();
-		return object;
-	}
-
 	public static JSONObject ReadEquipStaticInfoById(String objId) throws Exception {
 		String ibmsSceneCode = null;
 		String ibmsClassCode = null;
@@ -73,44 +47,129 @@ public class ExeclReadEquipStaticInfoUtil {
 		return object;
 	}
 
+	public static JSONObject ReadEquipStaticInfo(String ibmsSceneCode, String ibmsClassCode) throws Exception {
+		RepositoryImpl Repository = RepositoryContainer.instance;
+		JSONObject object = new JSONObject();
+		if (Constant.info_point_version.equals("old")) {
+			FileInputStream fis = new FileInputStream(FileUtil.file(ibmsSceneCode + ".xlsx"));
+			Workbook workbook = WorkbookFactory.create(new BufferedInputStream(fis));
+			Sheet sheet = workbook.getSheet(ibmsClassCode);
+			for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
+				// 获取合并单元格的值
+				CellRangeAddress ca = sheet.getMergedRegion(i);
+				int firstRow = ca.getFirstRow();
+				Row fRow = sheet.getRow(firstRow);
+				Cell fCell = fRow.getCell(0);
+				String caVal = getCellValue(fCell);
+				// 获取合并单元格之后的值,形成树形结构
+				JSONArray dic = new JSONArray();
+				for (int j = firstRow; j <= ca.getLastRow(); j++) {
+					Row row = sheet.getRow(j);
+					JSONObject obj = new JSONObject();
+					obj.put("name", getCellValue(row.getCell(1)));
+					obj.put("code", getCellValue(row.getCell(2)));
+					obj.put("enable", row.getCell(3).getBooleanCellValue());
+					dic.add(obj);
+				}
+				object.put(caVal, dic);
+			}
+			fis.close();
+		} else if (Constant.info_point_version.equals("new")) {
+			String infoClass = "基本参数";
+			JSONArray dic = new JSONArray();
+			for (SceneDataObject sdo : Repository.InfoPointListArray.set) {
+				String ibmsSceneCodeInner = (String) sdo.get("ibmsSceneCode").value_prim.value;
+				String ibmsClassCodeInner = (String) sdo.get("ibmsClassCode").value_prim.value;
+				if (!ibmsSceneCodeInner.equals(ibmsSceneCode) || !ibmsClassCodeInner.equals(ibmsClassCode)) {
+					continue;
+				}
+				String infoType = (String) sdo.get("infoType").value_prim.value;
+				String infoCode = (String) sdo.get("infoCode").value_prim.value;
+				String infoName = (String) sdo.get("infoName").value_prim.value;
+				boolean isVisible = (Boolean) sdo.get("isVisible").value_prim.value;
+				if (infoType.equals(infoClass)) {
+					JSONObject obj = new JSONObject();
+					obj.put("name", infoName);
+					obj.put("code", infoCode);
+					obj.put("enable", isVisible);
+					dic.add(obj);
+				}
+			}
+			object.put(infoClass, dic);
+		}
+		return object;
+	}
+
 	public static JSONObject ReadEquipStaticInfoById(String ibmsSceneCode, String ibmsClassCode, String classCode, JSONObject queryObj)
 			throws Exception {
 		RepositoryImpl Repository = RepositoryContainer.instance;
 		JSONObject object = new JSONObject();
 		// 根据ibmsSceneCode和ibmsClassCode查询对应的excel获取台账信息点
-		FileInputStream fis = new FileInputStream(FileUtil.file(ibmsSceneCode + ".xlsx"));
-		Workbook workbook = WorkbookFactory.create(new BufferedInputStream(fis));
-		Sheet sheet = workbook.getSheet(ibmsClassCode);
-		for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
-			// 获取合并单元格的值
-			CellRangeAddress ca = sheet.getMergedRegion(i);
-			int firstRow = ca.getFirstRow();
-			Row fRow = sheet.getRow(firstRow);
-			Cell fCell = fRow.getCell(0);
-			String caVal = getCellValue(fCell);
-			// 获取合并单元格之后的值,形成树形结构
+		if (Constant.info_point_version.equals("old")) {
+			FileInputStream fis = new FileInputStream(FileUtil.file(ibmsSceneCode + ".xlsx"));
+			Workbook workbook = WorkbookFactory.create(new BufferedInputStream(fis));
+			Sheet sheet = workbook.getSheet(ibmsClassCode);
+			for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
+				// 获取合并单元格的值
+				CellRangeAddress ca = sheet.getMergedRegion(i);
+				int firstRow = ca.getFirstRow();
+				Row fRow = sheet.getRow(firstRow);
+				Cell fCell = fRow.getCell(0);
+				String caVal = getCellValue(fCell);
+				// 获取合并单元格之后的值,形成树形结构
+				JSONArray dic = new JSONArray();
+				// 获取这个设备类的信息点列表
+				JSONArray array = Repository.infoArrayJson.get(classCode);
+				for (int j = firstRow; j <= ca.getLastRow(); j++) {
+					Row row = sheet.getRow(j);
+					String codeInfo = getCellValue(row.getCell(1));
+					for (int z = 0; z < array.size(); z++) {
+						JSONObject obj = (JSONObject) FastJsonUtil.Clone_JSON(array.get(z));
+						String codeVal = obj.get("code").toString();
+						if (codeVal.equals(codeInfo)) {
+							if (queryObj != null) {
+								obj.put("data", queryObj.get(codeInfo));
+							}
+							obj.put("enable", row.getCell(2).getBooleanCellValue());
+							dic.add(obj);
+							break;
+						}
+					}
+				}
+				object.put(caVal, dic);
+			}
+			fis.close();
+		} else if (Constant.info_point_version.equals("new")) {
+			JSONArray infoArray = Repository.infoArrayJson.get(classCode);
+
+			String infoClass = "基本参数";
 			JSONArray dic = new JSONArray();
-			// 获取这个设备类的信息点列表
-			JSONArray array = Repository.infoArrayJson.get(classCode);
-			for (int j = firstRow; j <= ca.getLastRow(); j++) {
-				Row row = sheet.getRow(j);
-				String codeInfo = getCellValue(row.getCell(1));
-				for (int z = 0; z < array.size(); z++) {
-					JSONObject obj = (JSONObject) array.get(z);
-					String codeVal = obj.get("code").toString();
-					if (codeVal.equals(codeInfo)) {
-						if (queryObj != null) {
-							obj.put("data", queryObj.get(codeInfo));
+			for (SceneDataObject sdo : Repository.InfoPointListArray.set) {
+				String ibmsSceneCodeInner = (String) sdo.get("ibmsSceneCode").value_prim.value;
+				String ibmsClassCodeInner = (String) sdo.get("ibmsClassCode").value_prim.value;
+				if (!ibmsSceneCodeInner.equals(ibmsSceneCode) || !ibmsClassCodeInner.equals(ibmsClassCode)) {
+					continue;
+				}
+				String infoType = (String) sdo.get("infoType").value_prim.value;
+				String infoCode = (String) sdo.get("infoCode").value_prim.value;
+				boolean isVisible = (Boolean) sdo.get("isVisible").value_prim.value;
+				if (infoType.equals(infoClass)) {
+					for (int z = 0; z < infoArray.size(); z++) {
+						JSONObject obj = (JSONObject) FastJsonUtil.Clone_JSON(infoArray.get(z));
+						String codeVal = obj.get("code").toString();
+						if (codeVal.equals(infoCode)) {
+							if (queryObj != null) {
+								obj.put("data", queryObj.get(infoCode));
+							}
+							obj.put("enable", isVisible);
+							dic.add(obj);
+							break;
 						}
-						obj.put("enable", row.getCell(2).getBooleanCellValue());
-						dic.add(obj);
-						break;
 					}
 				}
 			}
-			object.put(caVal, dic);
+			object.put(infoClass, dic);
 		}
-		fis.close();
 		return object;
 	}
 

+ 89 - 10
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDDownloadUtil.java

@@ -22,7 +22,7 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class RWDDownloadUtil {
 
-	public static void LoadConfig(String path, LogOfDownload LogOfDownload) throws Exception {
+	public static void Load_config(String path, LogOfDownload LogOfDownload) throws Exception {
 		FileUtil.deleteRecursive(new File(path));
 		JSONArray classArray = null;
 		List<String> groupCodeList = new CopyOnWriteArrayList<String>();
@@ -57,6 +57,85 @@ public class RWDDownloadUtil {
 		}
 	}
 
+	public static void Load_info_point_new(String path, LogOfDownload LogOfDownload) throws Exception {
+		FileUtil.deleteRecursive(new File(path));
+		{
+			File root = new File(path);
+			if (!root.exists()) {
+				root.mkdir();
+			}
+		}
+
+		JSONArray InfoPointListArray = new JSONArray();
+		JSONArray InfoPointRelationArray = new JSONArray();
+		Map<String, ExcelSheet> sheetMap = ExcelCommonUtil.Read(Constant.getStream("new-info-point.xlsx"), true);
+		for (String sheetName : sheetMap.keySet()) {
+			ExcelSheet sheet = sheetMap.get(sheetName);
+			for (int i = 0; i < sheet.contentListList.size(); i++) {
+				String ibmsSceneCode = ExcelCommonUtil.getContentInner(sheet, "模块编码", i);
+				String ibmsClassCode = ExcelCommonUtil.getContentInner(sheet, "IBMS编码", i);
+				String infoType = ExcelCommonUtil.getContentInner(sheet, "信息点类型", i);
+				String infoCode = ExcelCommonUtil.getContentInner(sheet, "信息点编码", i);
+				String infoName = ExcelCommonUtil.getContentInner(sheet, "信息点名称", i);
+				String infoAlias = ExcelCommonUtil.getContentInner(sheet, "信息点别名", i);
+				String isVisible = ExcelCommonUtil.getContentInner(sheet, "是否显示", i);
+				String isKeyPoint = ExcelCommonUtil.getContentInner(sheet, "是否关键参数", i);
+				String isBatchControlParam = ExcelCommonUtil.getContentInner(sheet, "是否批量控制", i);
+				String feedback = ExcelCommonUtil.getContentInner(sheet, "控制反馈点编码", i);
+				String force = ExcelCommonUtil.getContentInner(sheet, "强制模式", i);
+				String force_feedback = ExcelCommonUtil.getContentInner(sheet, "强制模式反馈", i);
+				if (ibmsSceneCode == null || ibmsSceneCode.length() == 0) {
+					continue;
+				}
+				if (ibmsClassCode == null || ibmsClassCode.length() == 0) {
+					continue;
+				}
+				if (infoType == null || infoType.length() == 0) {
+					continue;
+				}
+				if (infoCode == null || infoCode.length() == 0) {
+					continue;
+				}
+				{
+					infoCode = infoCode.substring(0, 1).toLowerCase() + infoCode.substring(1);
+				}
+				{
+					JSONObject pointListItem = new JSONObject();
+					pointListItem.put("ibmsSceneCode", ibmsSceneCode);
+					pointListItem.put("ibmsClassCode", ibmsClassCode);
+					pointListItem.put("infoCode", infoCode);
+					pointListItem.put("infoType", infoType);
+					pointListItem.put("infoName", infoName != null && infoName.length() > 0 ? infoName : null);
+					pointListItem.put("infoAlias", infoAlias != null && infoAlias.length() > 0 ? infoAlias : null);
+					pointListItem.put("isKeyPoint", (isKeyPoint != null && isKeyPoint.equals("Y")) ? true : false);
+					pointListItem.put("isBatchControlParam", (isBatchControlParam != null && isBatchControlParam.equals("Y")) ? true : false);
+					pointListItem.put("isVisible", (isVisible != null && isVisible.equals("Y")) ? true : false);
+					InfoPointListArray.add(pointListItem);
+				}
+				{
+					JSONObject pointRelationItem = new JSONObject();
+					if (feedback != null) {
+						pointRelationItem.put("控制反馈点", feedback);
+					}
+					if (force != null) {
+						pointRelationItem.put("强制模式", force);
+					}
+					if (force_feedback != null) {
+						pointRelationItem.put("强制模式反馈", force_feedback);
+					}
+					if (pointRelationItem.size() > 0) {
+						pointRelationItem.put("ibmsSceneCode", ibmsSceneCode);
+						pointRelationItem.put("ibmsClassCode", ibmsClassCode);
+						pointRelationItem.put("控制点", infoCode);
+						InfoPointRelationArray.add(pointRelationItem);
+					}
+				}
+			}
+		}
+		FileUtil.Save(path + Constant.getSeperator() + "info-point-list" + ".json", FastJsonUtil.toFormatString(InfoPointListArray));
+		FileUtil.Save(path + Constant.getSeperator() + "info-point-relation" + ".json", FastJsonUtil.toFormatString(InfoPointRelationArray));
+	}
+
 	public static boolean Process_physical_world(LogOfDownload LogOfDownload) throws Exception {
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
 		String validPath = Constant.getLatestPath(Constant.physical_world, true);
@@ -65,13 +144,13 @@ public class RWDDownloadUtil {
 		{
 			String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp1";
 			dir1 = new File(tmpPath);
-			RWDDownloadUtil.LoadPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_physical_world(tmpPath, LogOfDownload);
 		}
 		File dir2;
 		{
 			String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp2";
 			dir2 = new File(tmpPath);
-			RWDDownloadUtil.LoadPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_physical_world(tmpPath, LogOfDownload);
 		}
 		// 检查一致性
 		boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
@@ -103,7 +182,7 @@ public class RWDDownloadUtil {
 		return result;
 	}
 
-	public static void LoadPhysicalWorld(String path, LogOfDownload LogOfDownload) throws Exception {
+	public static void Load_physical_world(String path, LogOfDownload LogOfDownload) throws Exception {
 		log.debug("Download physical world refresh dir");
 		FileUtil.deleteRecursive(new File(path));
 		{
@@ -252,13 +331,13 @@ public class RWDDownloadUtil {
 		{
 			String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp1";
 			dir1 = new File(tmpPath);
-			RWDDownloadUtil.LoadZKTPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_zkt_physical_world(tmpPath, LogOfDownload);
 		}
 		File dir2;
 		{
 			String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp2";
 			dir2 = new File(tmpPath);
-			RWDDownloadUtil.LoadZKTPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_zkt_physical_world(tmpPath, LogOfDownload);
 		}
 		// 检查一致性
 		boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
@@ -290,7 +369,7 @@ public class RWDDownloadUtil {
 		return result;
 	}
 
-	public static void LoadZKTPhysicalWorld(String path, LogOfDownload LogOfDownload) throws Exception {
+	public static void Load_zkt_physical_world(String path, LogOfDownload LogOfDownload) throws Exception {
 		log.debug("Download zkt physical world refresh dir");
 		FileUtil.deleteRecursive(new File(path));
 		{
@@ -490,13 +569,13 @@ public class RWDDownloadUtil {
 		{
 			String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp1";
 			dir1 = new File(tmpPath);
-			RWDDownloadUtil.LoadIBMSPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_ibms_physical_world(tmpPath, LogOfDownload);
 		}
 		File dir2;
 		{
 			String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp2";
 			dir2 = new File(tmpPath);
-			RWDDownloadUtil.LoadIBMSPhysicalWorld(tmpPath, LogOfDownload);
+			RWDDownloadUtil.Load_ibms_physical_world(tmpPath, LogOfDownload);
 		}
 		// 检查一致性
 		boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
@@ -573,7 +652,7 @@ public class RWDDownloadUtil {
 		return result;
 	}
 
-	public static void LoadIBMSPhysicalWorld(String path, LogOfDownload LogOfDownload) throws Exception {
+	public static void Load_ibms_physical_world(String path, LogOfDownload LogOfDownload) throws Exception {
 		log.debug("Download ibms physical world refresh dir");
 		FileUtil.deleteRecursive(new File(path));
 		{

+ 29 - 4
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDLoadUtil.java

@@ -20,6 +20,7 @@ import com.persagy.ibms.core.data.SceneDataValue;
 import com.persagy.ibms.core.util.FastJsonReaderUtil;
 import com.persagy.ibms.core.util.FastJsonUtil;
 import com.persagy.ibms.core.util.FileUtil;
+import com.persagy.ibms.core.util.LogOfRun;
 import com.persagy.ibms.core.util.LogUtil;
 import com.persagy.ibms.core.util.RWDUtil;
 
@@ -27,8 +28,9 @@ import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
 public class RWDLoadUtil {
-	public static void LoadPhysicalWorld(RepositoryImpl Repository) throws Exception {
+	public static void Load_physical_world(LogOfRun LogOfRun, RepositoryImpl Repository) throws Exception {
 		String validPath = Constant.getLatestPath(Constant.physical_world, true);
+		LogOfRun.setTime_new("physical_world", validPath);
 
 		{
 			JSONArray classArray = FastJsonReaderUtil.Instance().ReadJSONArray(new File(validPath + Constant.getSeperator() + "classArray.json"));
@@ -560,8 +562,9 @@ public class RWDLoadUtil {
 		}
 	}
 
-	public static void LoadZKTPhysicalWorld(RepositoryImpl Repository) throws Exception {
+	public static void Load_zkt_physical_world(LogOfRun LogOfRun, RepositoryImpl Repository) throws Exception {
 		String validPath = Constant.getLatestPath(Constant.zkt_physical_world, true);
+		LogOfRun.setTime_new("zkt_physical_world", validPath);
 
 		String objectPath = validPath + Constant.getSeperator() + "object";
 		{
@@ -712,8 +715,10 @@ public class RWDLoadUtil {
 		}
 	}
 
-	public static void LoadIBMSPhysicalWorld(RepositoryImpl Repository) throws Exception {
+	public static void Load_ibms_physical_world(LogOfRun LogOfRun, RepositoryImpl Repository) throws Exception {
 		String validPath = Constant.getLatestPath(Constant.ibms_physical_world, true);
+		LogOfRun.setTime_new("ibms_physical_world", validPath);
+
 		{
 			JSONArray array = FastJsonReaderUtil.Instance().ReadJSONArray(new File(validPath + Constant.getSeperator() + "groupArray.json"));
 			for (int i = 0; i < array.size(); i++) {
@@ -927,7 +932,27 @@ public class RWDLoadUtil {
 		}
 	}
 
-	public static void LoadInfoPoint(RepositoryImpl Repository) throws Exception {
+	public static void Load_info_point_new(LogOfRun LogOfRun, RepositoryImpl Repository) throws Exception {
+		String validPath = Constant.getLatestPath(Constant.info_point, true);
+		LogOfRun.setTime_new("info_point", validPath);
+
+		{
+			JSONArray classArray = FastJsonReaderUtil.Instance()
+					.ReadJSONArray(new File(validPath + Constant.getSeperator() + "info-point-list.json"));
+			SceneDataSet SceneDataSet = new SceneDataSet(false, "info-point-list");
+			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, "info-point-relation");
+			SceneDataSet.set = RWDUtil.array2SDOList(classArray);
+			Repository.InfoPointRelationArray = SceneDataSet;
+		}
+	}
+
+	public static void Load_info_point_old(RepositoryImpl Repository) throws Exception {
 		String validPath = Constant.info_point;
 
 		{

+ 13 - 6
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RWDRepositoryUtil.java

@@ -13,31 +13,36 @@ import com.persagy.ibms.core.data.SceneProperty;
 import com.persagy.ibms.core.util.ComputeUtil;
 import com.persagy.ibms.core.util.FastJsonReaderUtil;
 import com.persagy.ibms.core.util.FastJsonUtil;
+import com.persagy.ibms.core.util.LogOfRun;
 
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
 public class RWDRepositoryUtil {
 
-	public static void DoRepository(RepositoryImpl Repository, boolean load_physical_world) throws Exception {
+	public static void DoRepository(LogOfRun LogOfRun, RepositoryImpl Repository, boolean load_physical_world) throws Exception {
 		if (load_physical_world) {
 			log.warn("LoadPhysicalWorld");
-			RWDLoadUtil.LoadPhysicalWorld(Repository);
+			RWDLoadUtil.Load_physical_world(LogOfRun, Repository);
 			log.warn("LoadReference");
 			RWDLoadUtil.LoadReference(Repository);
 
 			if (Constant.zkt_physical_world_enable) {
 				log.warn("LoadZKTPhysicalWorld");
-				RWDLoadUtil.LoadZKTPhysicalWorld(Repository);
+				RWDLoadUtil.Load_zkt_physical_world(LogOfRun, Repository);
 			}
 
 			if (Constant.ibms_physical_world_enable) {
 				log.warn("LoadIBMSPhysicalWorld");
-				RWDLoadUtil.LoadIBMSPhysicalWorld(Repository);
+				RWDLoadUtil.Load_ibms_physical_world(LogOfRun, Repository);
 			}
 			if (Constant.info_point_enable) {
 				log.warn("LoadInfoPoint");
-				RWDLoadUtil.LoadInfoPoint(Repository);
+				if (Constant.info_point_version.equals("old")) {
+					RWDLoadUtil.Load_info_point_old(Repository);
+				} else if (Constant.info_point_version.equals("new")) {
+					RWDLoadUtil.Load_info_point_new(LogOfRun, Repository);
+				}
 			}
 
 			log.warn("LoadAlarm");
@@ -88,7 +93,9 @@ public class RWDRepositoryUtil {
 		log.warn("LoadConfig");
 		SceneObject sceneObject = new SceneObject();
 		{
-			JSONObject sceneJSON_ori = FastJsonReaderUtil.Instance().ReadJSONObject(new File(Constant.getLatestPath(Constant.config, false)));
+			String validPath = Constant.getLatestPath(Constant.config, false);
+			LogOfRun.setTime_new("config", validPath);
+			JSONObject sceneJSON_ori = FastJsonReaderUtil.Instance().ReadJSONObject(new File(validPath));
 			JSONArray PropertyList_ori = sceneJSON_ori.getJSONArray("PropertyList");
 			JSONObject sceneJSON = new JSONObject();
 			JSONArray PropertyList = new JSONArray();

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

@@ -359,7 +359,7 @@ public class RepositoryImpl extends RepositoryBase {
 
 	@Override
 	public void log_step_begin(int step, int property_count, int value_count) {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		JSONObject stepJSON = new JSONObject();
 		stepJSON.put("property_count", property_count);
 		stepJSON.put("value_count", value_count);
@@ -369,7 +369,7 @@ public class RepositoryImpl extends RepositoryBase {
 
 	@Override
 	public void log_step_end(int step, int finish_count) {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		JSONObject stepJSON = this.RepositoryProject.LogOfRun.stepList.get(this.RepositoryProject.LogOfRun.stepList.size() - 1);
 		stepJSON.put("finish_count", finish_count);
 		stepJSON.put("endTime", sdf.format(new Date()));

+ 5 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/RepositoryProject.java

@@ -16,6 +16,11 @@ public class RepositoryProject {
 	public String groupCode;
 	public String projectId;
 
+	public boolean compute_finish = false;
+
+	public Map<String, String> resourceMap_try = new ConcurrentHashMap<String, String>();
+	public Map<String, String> resourceMap_valid = new ConcurrentHashMap<String, String>();
+
 	// IOT采集数据
 	public ConcurrentHashMap<String, SceneDataValue> point2sdv = new ConcurrentHashMap<String, SceneDataValue>();
 	public ConcurrentHashMap<SceneDataValue, String> sdv2point = new ConcurrentHashMap<SceneDataValue, String>();

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

@@ -12,7 +12,7 @@
 	<physical_world path="D-physical_world" refresh_enable="true" refresh_interval_second="3600" />
 	<zkt_physical_world path="D-zkt_physical_world" enable="true" refresh_enable="true" refresh_interval_second="3600" />
 	<ibms_physical_world path="D-ibms_physical_world" enable="true" refresh_enable="true" refresh_interval_second="60" />
-	<info_point path="D-info-point" enable="true" />
+	<info_point path="D-info-point" enable="true" version="new" refresh_enable="true" refresh_interval_second="60"/>
 	<!-- zkt-monitor的服务地址 -->
 	<zkt_monitor url="http://192.168.100.33:9909/zkt-monitor/" />
 	<!-- zkt-control的服务地址 -->

BIN
ibms-data-sdk/src/main/resources/new-info-point.xlsx