|
@@ -694,20 +694,20 @@ public class RWDLoadUtil {
|
|
|
svInner.value_prim.value = ibmsClassCode;
|
|
|
sdo.put("ibmsClassCode", svInner);
|
|
|
}
|
|
|
-// {
|
|
|
-// SceneDataValue svInner = new SceneDataValue(null, null, null, null);
|
|
|
-// svInner.finish = true;
|
|
|
-// svInner.value_prim = new SceneDataPrimitive();
|
|
|
-// svInner.value_prim.value = arrayItem.get("ibmsxianshimingcheng");
|
|
|
-// sdo.put("ibmsxianshimingcheng", svInner);
|
|
|
-// }
|
|
|
-// {
|
|
|
-// SceneDataValue svInner = new SceneDataValue(null, null, null, null);
|
|
|
-// svInner.finish = true;
|
|
|
-// svInner.value_prim = new SceneDataPrimitive();
|
|
|
-// svInner.value_prim.value = arrayItem.get("ibmsxianshibianma");
|
|
|
-// sdo.put("ibmsxianshibianma", svInner);
|
|
|
-// }
|
|
|
+ // {
|
|
|
+ // SceneDataValue svInner = new SceneDataValue(null, null, null, null);
|
|
|
+ // svInner.finish = true;
|
|
|
+ // svInner.value_prim = new SceneDataPrimitive();
|
|
|
+ // svInner.value_prim.value = arrayItem.get("ibmsxianshimingcheng");
|
|
|
+ // sdo.put("ibmsxianshimingcheng", svInner);
|
|
|
+ // }
|
|
|
+ // {
|
|
|
+ // SceneDataValue svInner = new SceneDataValue(null, null, null, null);
|
|
|
+ // svInner.finish = true;
|
|
|
+ // svInner.value_prim = new SceneDataPrimitive();
|
|
|
+ // svInner.value_prim.value = arrayItem.get("ibmsxianshibianma");
|
|
|
+ // sdo.put("ibmsxianshibianma", svInner);
|
|
|
+ // }
|
|
|
SceneDataObject sodChild = new SceneDataObject(Repository, null, null, SceneDataValue, null, null, sdo);
|
|
|
SceneDataSet.set.add(sodChild);
|
|
|
}
|
|
@@ -818,7 +818,7 @@ public class RWDLoadUtil {
|
|
|
SceneDataSet SceneDataSet_level1 = new SceneDataSet(false);
|
|
|
SceneDataSet_level1.set = RWDUtil.array2SDOList(level1);
|
|
|
arrayDic.put("一级编组", SceneDataSet_level1);
|
|
|
- FileUtil.Save(product + "-" + "一级编组" + ".json", FastJsonUtil.toFormatString(level1));
|
|
|
+ FileUtil.Save("tmp-" + product + "-" + "一级编组" + ".json", FastJsonUtil.toFormatString(level1));
|
|
|
// 自动生成二级编组
|
|
|
JSONArray level2 = new JSONArray();
|
|
|
for (SceneDataObject sdo : Repository.IBMSGroupArray.set) {
|
|
@@ -851,7 +851,7 @@ public class RWDLoadUtil {
|
|
|
SceneDataSet SceneDataSet_level2 = new SceneDataSet(false);
|
|
|
SceneDataSet_level2.set = RWDUtil.array2SDOList(level2);
|
|
|
arrayDic.put("二级编组", SceneDataSet_level2);
|
|
|
- FileUtil.Save(product + "-" + "二级编组" + ".json", FastJsonUtil.toFormatString(level2));
|
|
|
+ FileUtil.Save("tmp-" + product + "-" + "二级编组" + ".json", FastJsonUtil.toFormatString(level2));
|
|
|
// 自动生成回路
|
|
|
SceneDataSet zhaominghuilu = arrayDic.get("zhaominghuilu");
|
|
|
if (zhaominghuilu == null) {
|
|
@@ -941,7 +941,7 @@ public class RWDLoadUtil {
|
|
|
SceneDataSet huilu = new SceneDataSet(false);
|
|
|
huilu.set = RWDUtil.array2SDOList(huiluArray);
|
|
|
arrayDic.put("回路", huilu);
|
|
|
- FileUtil.Save(product + "-" + "回路" + ".json", FastJsonUtil.toFormatString(huiluArray));
|
|
|
+ FileUtil.Save("tmp-" + product + "-" + "回路" + ".json", FastJsonUtil.toFormatString(huiluArray));
|
|
|
|
|
|
for (SceneDataObject sdo : huilu.set) {
|
|
|
String id = (String) sdo.get("回路编号").value_prim.value;
|
|
@@ -986,14 +986,6 @@ public class RWDLoadUtil {
|
|
|
SceneDataSet.set = RWDUtil.array2SDOList(classArray);
|
|
|
Repository.InfoPointRelationArray = SceneDataSet;
|
|
|
}
|
|
|
-
|
|
|
- File file_interval_range = new File(validPath + Constant.getSeperator() + "interval-range.json");
|
|
|
- if (file_interval_range.exists()) {
|
|
|
- JSONArray classArray = FastJsonReaderUtil.Instance().ReadJSONArray(new File(validPath + Constant.getSeperator() + "interval-range.json"));
|
|
|
- SceneDataSet SceneDataSet = new SceneDataSet(false, "interval-range");
|
|
|
- SceneDataSet.set = RWDUtil.array2SDOList(classArray);
|
|
|
- Repository.IntervalRangeListArray = SceneDataSet;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static void Load_info_point_old(RepositoryImpl Repository) throws Exception {
|
|
@@ -1062,15 +1054,6 @@ public class RWDLoadUtil {
|
|
|
SceneDataSet.set = RWDUtil.array2SDOList(classArray);
|
|
|
Repository.InfoPointRelationArray = SceneDataSet;
|
|
|
}
|
|
|
-
|
|
|
- RWDDownloadUtil.Load_interval_range(validPath);
|
|
|
- File file_interval_range = new File(validPath + Constant.getSeperator() + "interval-range.json");
|
|
|
- if (file_interval_range.exists()) {
|
|
|
- JSONArray classArray = FastJsonReaderUtil.Instance().ReadJSONArray(new File(validPath + Constant.getSeperator() + "interval-range.json"));
|
|
|
- SceneDataSet SceneDataSet = new SceneDataSet(false, "interval-range");
|
|
|
- SceneDataSet.set = RWDUtil.array2SDOList(classArray);
|
|
|
- Repository.IntervalRangeListArray = SceneDataSet;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
private static String getValidName(SceneDataObject sdo) {
|
|
@@ -1086,7 +1069,7 @@ public class RWDLoadUtil {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public static void LoadCalendar(RepositoryImpl Repository) throws Exception {
|
|
|
+ public static void Read_calendar(RepositoryImpl Repository) throws Exception {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
Date currDate = new Date();
|
|
|
String dateString = sdf.format(currDate);
|
|
@@ -1119,6 +1102,7 @@ public class RWDLoadUtil {
|
|
|
modelMap.put(modelId, modelName);
|
|
|
}
|
|
|
}
|
|
|
+ FileUtil.Save("tmp-" + "IBMSCalendarModel" + ".json", FastJsonUtil.toFormatString(array));
|
|
|
Repository.IBMSCalendarModel.set = RWDUtil.array2SDOList(array);
|
|
|
}
|
|
|
{
|
|
@@ -1151,11 +1135,12 @@ public class RWDLoadUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ FileUtil.Save("tmp-" + "IBMSCalendarBinding" + ".json", FastJsonUtil.toFormatString(arrayToday));
|
|
|
Repository.IBMSCalendarBinding.set = RWDUtil.array2SDOList(arrayToday);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void LoadWeather(RepositoryImpl Repository) throws Exception {
|
|
|
+ public static void Read_weather(RepositoryImpl Repository) throws Exception {
|
|
|
String cityCode = RepositoryContainer.RepositoryProject.projectId.substring(2, 8);
|
|
|
{
|
|
|
JSONObject arrayItem = new JSONObject();
|
|
@@ -1221,9 +1206,44 @@ public class RWDLoadUtil {
|
|
|
}
|
|
|
JSONArray array = new JSONArray();
|
|
|
array.add(arrayItem);
|
|
|
- Repository.weather.set.clear();
|
|
|
- Repository.weather.set.addAll(RWDUtil.array2SDOList(array));
|
|
|
+ FileUtil.Save("tmp-" + "weather" + ".json", FastJsonUtil.toFormatString(array));
|
|
|
+ Repository.weather.set = RWDUtil.array2SDOList(array);
|
|
|
Repository.addWaitCompute(Repository.weather);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static void Read_scaleplate(RepositoryImpl Repository) throws Exception {
|
|
|
+ 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("tmp-" + "scaleplate" + ".json", FastJsonUtil.toFormatString(array));
|
|
|
+ Repository.scaleplate.set = RWDUtil.array2SDOList(array);
|
|
|
+ Repository.addWaitCompute(Repository.scaleplate);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|