|
@@ -205,6 +205,162 @@ public class RWDDownloadUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 网络获取管理范围信息
|
|
|
|
+ *
|
|
|
|
+ * @param path 路径
|
|
|
|
+ * @param LogOfDownload 存储信息
|
|
|
|
+ * @throws Exception 错误信息
|
|
|
|
+ */
|
|
|
|
+ public static void Load_info_point_network(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("info-point-new.xlsx"), true);
|
|
|
|
+// for (String sheetName : sheetMap.keySet()) {
|
|
|
|
+// ExcelSheet sheet = sheetMap.get(sheetName);
|
|
|
|
+// for (int i = 1; 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);
|
|
|
|
+// ibmsSceneCode = ibmsSceneCode == null ? null : ibmsSceneCode.trim();
|
|
|
|
+// ibmsClassCode = ibmsClassCode == null ? null : ibmsClassCode.trim();
|
|
|
|
+// infoType = infoType == null ? null : infoType.trim();
|
|
|
|
+// infoCode = infoCode == null ? null : infoCode.trim();
|
|
|
|
+// infoName = infoName == null ? null : infoName.trim();
|
|
|
|
+// infoAlias = infoAlias == null ? null : infoAlias.trim();
|
|
|
|
+// isVisible = isVisible == null ? null : isVisible.trim();
|
|
|
|
+// isKeyPoint = isKeyPoint == null ? null : isKeyPoint.trim();
|
|
|
|
+// isBatchControlParam = isBatchControlParam == null ? null : isBatchControlParam.trim();
|
|
|
|
+// feedback = feedback == null ? null : feedback.trim();
|
|
|
|
+// force = force == null ? null : force.trim();
|
|
|
|
+// force_feedback = force_feedback == null ? null : force_feedback.trim();
|
|
|
|
+// 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);
|
|
|
|
+// }
|
|
|
|
+// if (feedback != null && feedback.length() > 0) {
|
|
|
|
+// feedback = feedback.substring(0, 1).toLowerCase() + feedback.substring(1);
|
|
|
|
+// }
|
|
|
|
+// if (force != null && force.length() > 0) {
|
|
|
|
+// force = force.substring(0, 1).toLowerCase() + force.substring(1);
|
|
|
|
+// }
|
|
|
|
+// if (force_feedback != null && force_feedback.length() > 0) {
|
|
|
|
+// force_feedback = force_feedback.substring(0, 1).toLowerCase() + force_feedback.substring(1);
|
|
|
|
+// }
|
|
|
|
+// {
|
|
|
|
+// JSONObject pointListItem = new JSONObject();
|
|
|
|
+// pointListItem.put("sequenceNo", i);
|
|
|
|
+// 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);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ /** 查询数据信息 */
|
|
|
|
+ JSONObject paramNetwork = new JSONObject();
|
|
|
|
+ paramNetwork.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
|
+ paramNetwork.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
|
+
|
|
|
|
+ String post_network_result = HttpClientUtil.instance("ibms_config").post(Constant.ibms_config_url + "/sdkStatistics/listInfoPointWithProject",
|
|
|
|
+ paramNetwork.toJSONString());
|
|
|
|
+ JSONObject resultJSONNetwork = JSON.parseObject(post_network_result);
|
|
|
|
+ JSONArray contentNetwork = (JSONArray) resultJSONNetwork.get("content");
|
|
|
|
+
|
|
|
|
+ String get_network_result = HttpClientUtil.instance("ibms_config").get(Constant.ibms_config_url + "/sdkStatistics/listLatestInfoPointRelation");
|
|
|
|
+ JSONObject resultJSONNetworkRelation = JSON.parseObject(get_network_result);
|
|
|
|
+ JSONArray contentNetworkRelation = (JSONArray) resultJSONNetworkRelation.get("content");
|
|
|
|
+
|
|
|
|
+ FileUtil.Save(path + Constant.getSeperator() + "info-point-list" + ".json", FastJsonUtil.toFormatString(contentNetwork));
|
|
|
|
+ FileUtil.Save(path + Constant.getSeperator() + "info-point-relation" + ".json", FastJsonUtil.toFormatString(contentNetworkRelation));
|
|
|
|
+
|
|
|
|
+ if(Constant.scaleplate_enable){
|
|
|
|
+ String[] typeCodes = { "tdb", "rH", "cO2", "cO", "pM2d5" };
|
|
|
|
+ {
|
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
|
+ int value = 29;
|
|
|
|
+ for (String typeCode : typeCodes) {
|
|
|
|
+ JSONObject param = new JSONObject();
|
|
|
|
+ param.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
|
+ param.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
|
+ param.put("typeCode", typeCode);
|
|
|
|
+ String post_result = HttpClientUtil.instance("scaleplate").post(Constant.scaleplate_url + "/listDyeScaleplateByType",
|
|
|
|
+ param.toJSONString());
|
|
|
|
+ JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
|
+ JSONArray content = (JSONArray) resultJSON.get("content");
|
|
|
|
+ for (int i = 0; i < content.size(); i++) {
|
|
|
|
+ JSONObject contentItem = content.getJSONObject(i);
|
|
|
|
+ String upperLimit = contentItem.getString("upperLimit");
|
|
|
|
+ String lowerLimit = contentItem.getString("lowerLimit");
|
|
|
|
+ JSONObject arrayItem = new JSONObject();
|
|
|
|
+ arrayItem.put("typeCode", typeCode);
|
|
|
|
+ arrayItem.put("id", contentItem.get("id"));
|
|
|
|
+ arrayItem.put("数值", value++);
|
|
|
|
+ arrayItem.put("名称", contentItem.get("name"));
|
|
|
|
+ arrayItem.put("颜色", contentItem.get("colorValue"));
|
|
|
|
+ arrayItem.put("上限", (upperLimit == null || upperLimit.length() == 0) ? null : Double.parseDouble(upperLimit));
|
|
|
|
+ arrayItem.put("下限", (lowerLimit == null || lowerLimit.length() == 0) ? null : Double.parseDouble(lowerLimit));
|
|
|
|
+ array.add(arrayItem);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ FileUtil.Save(path + Constant.getSeperator() + "scaleplate" + ".json", FastJsonUtil.toFormatString(array));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
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);
|