|
@@ -17,6 +17,7 @@ import com.persagy.ibms.core.util.FastJsonUtil;
|
|
import com.persagy.ibms.core.util.FileUtil;
|
|
import com.persagy.ibms.core.util.FileUtil;
|
|
import com.persagy.ibms.core.util.LogOfDownload;
|
|
import com.persagy.ibms.core.util.LogOfDownload;
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
|
|
+import com.persagy.ibms.core.util.RWDUtil;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -170,6 +171,74 @@ public class RWDDownloadUtil {
|
|
}
|
|
}
|
|
FileUtil.Save(path + Constant.getSeperator() + "info-point-list" + ".json", FastJsonUtil.toFormatString(InfoPointListArray));
|
|
FileUtil.Save(path + Constant.getSeperator() + "info-point-list" + ".json", FastJsonUtil.toFormatString(InfoPointListArray));
|
|
FileUtil.Save(path + Constant.getSeperator() + "info-point-relation" + ".json", FastJsonUtil.toFormatString(InfoPointRelationArray));
|
|
FileUtil.Save(path + Constant.getSeperator() + "info-point-relation" + ".json", FastJsonUtil.toFormatString(InfoPointRelationArray));
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ 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 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);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public static boolean Process_physical_world(LogOfDownload LogOfDownload) throws Exception {
|
|
public static boolean Process_physical_world(LogOfDownload LogOfDownload) throws Exception {
|