|
@@ -22,7 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class RWDDownloadUtil {
|
|
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));
|
|
FileUtil.deleteRecursive(new File(path));
|
|
JSONArray classArray = null;
|
|
JSONArray classArray = null;
|
|
List<String> groupCodeList = new CopyOnWriteArrayList<String>();
|
|
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 {
|
|
public static boolean Process_physical_world(LogOfDownload LogOfDownload) throws Exception {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
String validPath = Constant.getLatestPath(Constant.physical_world, true);
|
|
String validPath = Constant.getLatestPath(Constant.physical_world, true);
|
|
@@ -65,13 +144,13 @@ public class RWDDownloadUtil {
|
|
{
|
|
{
|
|
String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp1";
|
|
String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp1";
|
|
dir1 = new File(tmpPath);
|
|
dir1 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
File dir2;
|
|
File dir2;
|
|
{
|
|
{
|
|
String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp2";
|
|
String tmpPath = Constant.physical_world + Constant.getSeperator() + "tmp2";
|
|
dir2 = new File(tmpPath);
|
|
dir2 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
// 检查一致性
|
|
// 检查一致性
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
@@ -103,7 +182,7 @@ public class RWDDownloadUtil {
|
|
return result;
|
|
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");
|
|
log.debug("Download physical world refresh dir");
|
|
FileUtil.deleteRecursive(new File(path));
|
|
FileUtil.deleteRecursive(new File(path));
|
|
{
|
|
{
|
|
@@ -252,13 +331,13 @@ public class RWDDownloadUtil {
|
|
{
|
|
{
|
|
String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp1";
|
|
String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp1";
|
|
dir1 = new File(tmpPath);
|
|
dir1 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadZKTPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_zkt_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
File dir2;
|
|
File dir2;
|
|
{
|
|
{
|
|
String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp2";
|
|
String tmpPath = Constant.zkt_physical_world + Constant.getSeperator() + "tmp2";
|
|
dir2 = new File(tmpPath);
|
|
dir2 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadZKTPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_zkt_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
// 检查一致性
|
|
// 检查一致性
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
@@ -290,7 +369,7 @@ public class RWDDownloadUtil {
|
|
return result;
|
|
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");
|
|
log.debug("Download zkt physical world refresh dir");
|
|
FileUtil.deleteRecursive(new File(path));
|
|
FileUtil.deleteRecursive(new File(path));
|
|
{
|
|
{
|
|
@@ -490,13 +569,13 @@ public class RWDDownloadUtil {
|
|
{
|
|
{
|
|
String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp1";
|
|
String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp1";
|
|
dir1 = new File(tmpPath);
|
|
dir1 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadIBMSPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_ibms_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
File dir2;
|
|
File dir2;
|
|
{
|
|
{
|
|
String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp2";
|
|
String tmpPath = Constant.ibms_physical_world + Constant.getSeperator() + "tmp2";
|
|
dir2 = new File(tmpPath);
|
|
dir2 = new File(tmpPath);
|
|
- RWDDownloadUtil.LoadIBMSPhysicalWorld(tmpPath, LogOfDownload);
|
|
|
|
|
|
+ RWDDownloadUtil.Load_ibms_physical_world(tmpPath, LogOfDownload);
|
|
}
|
|
}
|
|
// 检查一致性
|
|
// 检查一致性
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
boolean compare = FileUtil.compareRecursive(dir1, dir2, null);
|
|
@@ -573,7 +652,7 @@ public class RWDDownloadUtil {
|
|
return result;
|
|
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");
|
|
log.debug("Download ibms physical world refresh dir");
|
|
FileUtil.deleteRecursive(new File(path));
|
|
FileUtil.deleteRecursive(new File(path));
|
|
{
|
|
{
|