|
@@ -1,25 +1,17 @@
|
|
package com.persagy.ibms.data.sdk.service.rest;
|
|
package com.persagy.ibms.data.sdk.service.rest;
|
|
|
|
|
|
-import java.text.ParseException;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
-import java.util.Date;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-
|
|
|
|
-import org.springframework.core.io.FileSystemResource;
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
-import com.persagy.ibms.core.data.SceneDataObject;
|
|
|
|
import com.persagy.ibms.core.data.SceneDataPrimitive;
|
|
import com.persagy.ibms.core.data.SceneDataPrimitive;
|
|
import com.persagy.ibms.core.data.SceneDataSet;
|
|
import com.persagy.ibms.core.data.SceneDataSet;
|
|
import com.persagy.ibms.core.data.SceneDataValue;
|
|
import com.persagy.ibms.core.data.SceneDataValue;
|
|
@@ -29,16 +21,13 @@ import com.persagy.ibms.core.util.ExceptionItem;
|
|
import com.persagy.ibms.core.util.ExceptionWrapper;
|
|
import com.persagy.ibms.core.util.ExceptionWrapper;
|
|
import com.persagy.ibms.core.util.FastJsonCompareUtil;
|
|
import com.persagy.ibms.core.util.FastJsonCompareUtil;
|
|
import com.persagy.ibms.core.util.FilterUtil;
|
|
import com.persagy.ibms.core.util.FilterUtil;
|
|
-import com.persagy.ibms.core.util.IntWrapper;
|
|
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
import com.persagy.ibms.core.util.QueryAssist;
|
|
import com.persagy.ibms.core.util.QueryAssist;
|
|
import com.persagy.ibms.core.util.QueryUtil;
|
|
import com.persagy.ibms.core.util.QueryUtil;
|
|
import com.persagy.ibms.core.util.RecursiveUtil;
|
|
import com.persagy.ibms.core.util.RecursiveUtil;
|
|
import com.persagy.ibms.data.sdk.util.Constant;
|
|
import com.persagy.ibms.data.sdk.util.Constant;
|
|
import com.persagy.ibms.data.sdk.util.ControlUtil;
|
|
import com.persagy.ibms.data.sdk.util.ControlUtil;
|
|
-import com.persagy.ibms.data.sdk.util.DrawUtil;
|
|
|
|
import com.persagy.ibms.data.sdk.util.ExeclReadEquipStaticInfoUtil;
|
|
import com.persagy.ibms.data.sdk.util.ExeclReadEquipStaticInfoUtil;
|
|
-import com.persagy.ibms.data.sdk.util.ExportUtil;
|
|
|
|
import com.persagy.ibms.data.sdk.util.HttpClientUtil;
|
|
import com.persagy.ibms.data.sdk.util.HttpClientUtil;
|
|
import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
|
|
import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
|
|
import com.persagy.ibms.data.sdk.util.RepositoryContainer;
|
|
import com.persagy.ibms.data.sdk.util.RepositoryContainer;
|
|
@@ -137,101 +126,6 @@ public class RestUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public static String showTree() {
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- JSONObject JSON = (JSONObject) Repository.objectData.toJSON(-1);
|
|
|
|
- return JSONObject.toJSONString(JSON, SerializerFeature.WriteMapNullValue);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String desc(String param) {
|
|
|
|
- JSONArray path = JSON.parseArray(param);
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- Object valueObject = ComputeUtil.getValueObject(Repository, path);
|
|
|
|
- String result;
|
|
|
|
- if (valueObject instanceof SceneDataValue) {
|
|
|
|
- SceneDataValue currData = (SceneDataValue) valueObject;
|
|
|
|
- RecursiveUtil.print_variable_set(path.toJSONString(), currData);
|
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
|
- sb.append("SceneDataValue: ");
|
|
|
|
- if (currData.parentObjectData != null) {
|
|
|
|
- sb.append(currData.parentObjectData.myPropertyName);
|
|
|
|
- sb.append("\t");
|
|
|
|
- } else {
|
|
|
|
- sb.append("null");
|
|
|
|
- sb.append("\t");
|
|
|
|
- }
|
|
|
|
- sb.append(currData.myPropertyName);
|
|
|
|
- sb.append("\t");
|
|
|
|
- if (currData.value_array != null) {
|
|
|
|
- sb.append(currData.value_array.getRowChange() + "\t" + currData.value_array.getColChange());
|
|
|
|
- } else if (currData.value_object != null) {
|
|
|
|
- sb.append(currData.value_object.getRowChange() + "\t" + currData.value_array.getColChange());
|
|
|
|
- } else if (currData.value_prim != null) {
|
|
|
|
- sb.append(currData.value_prim.change);
|
|
|
|
- }
|
|
|
|
- sb.append("(");
|
|
|
|
- if (currData.rel_property != null) {
|
|
|
|
- sb.append(currData.rel_property.propertyName);
|
|
|
|
- }
|
|
|
|
- sb.append(")");
|
|
|
|
- result = sb.toString();
|
|
|
|
- } else {
|
|
|
|
- SceneDataObject currData = (SceneDataObject) valueObject;
|
|
|
|
- RecursiveUtil.print_variable_set(path.toJSONString(), currData);
|
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
|
- sb.append("SceneDataObject: ");
|
|
|
|
- if (currData.parentObjectData != null) {
|
|
|
|
- sb.append(currData.parentObjectData.myPropertyName);
|
|
|
|
- sb.append("\t");
|
|
|
|
- } else {
|
|
|
|
- sb.append("null");
|
|
|
|
- sb.append("\t");
|
|
|
|
- }
|
|
|
|
- sb.append(currData.myPropertyName);
|
|
|
|
- sb.append("\t");
|
|
|
|
- if (currData.parentArrayData != null) {
|
|
|
|
- sb.append(currData.parentArrayData.myPropertyName);
|
|
|
|
- sb.append("\t");
|
|
|
|
- } else {
|
|
|
|
- sb.append("null");
|
|
|
|
- sb.append("\t");
|
|
|
|
- }
|
|
|
|
- sb.append(currData.getRowChange() + "\t" + currData.getColChange());
|
|
|
|
- sb.append("(");
|
|
|
|
- if (currData.rel_object != null) {
|
|
|
|
- sb.append(currData.rel_object);
|
|
|
|
- }
|
|
|
|
- sb.append(")");
|
|
|
|
- result = sb.toString();
|
|
|
|
- }
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String show(String param) {
|
|
|
|
- JSONObject json = JSON.parseObject(param);
|
|
|
|
- JSONArray path = json.getJSONArray("path");
|
|
|
|
- int read_level = json.getIntValue("read_level");
|
|
|
|
- String result = RestUtil.show(path, read_level);
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String show(JSONArray valuePath, int read_level) {
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- try {
|
|
|
|
- Object valueObject = ComputeUtil.getValueObject(Repository, valuePath);
|
|
|
|
- if (!Repository.enable_factor) {
|
|
|
|
- RecursiveUtil.refreshObject(Repository, valueObject);
|
|
|
|
- }
|
|
|
|
- Object valueJSON = ComputeUtil.getValueJSON(valueObject, read_level, true);
|
|
|
|
- return JSONObject.toJSONString(valueJSON, SerializerFeature.WriteMapNullValue);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error(e.getMessage(), e);
|
|
|
|
- String message = LogUtil.GetExceptionStackTrace(e);
|
|
|
|
- log.error(message);
|
|
|
|
- return message;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public static JSONArray post_batch(JSONArray pathArray) {
|
|
public static JSONArray post_batch(JSONArray pathArray) {
|
|
JSONArray batchResult = new JSONArray();
|
|
JSONArray batchResult = new JSONArray();
|
|
for (int i = 0; i < pathArray.size(); i++) {
|
|
for (int i = 0; i < pathArray.size(); i++) {
|
|
@@ -375,247 +269,6 @@ public class RestUtil {
|
|
return ip;
|
|
return ip;
|
|
}
|
|
}
|
|
|
|
|
|
- public static String fjd_query(String param) {
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
- Date currTime = new Date((new Date()).getTime() / (1000L * 60 * 15) * (1000L * 60 * 15));
|
|
|
|
- Date time_from = new Date(
|
|
|
|
- (currTime.getTime() + (1000L * 60 * 60 * 8)) / (1000L * 60 * 60 * 24) * (1000L * 60 * 60 * 24) - (1000L * 60 * 60 * 8));
|
|
|
|
- Date time_to = currTime;
|
|
|
|
- if (time_to.getTime() - time_from.getTime() < 1000L * 60 * 60 * 6) {
|
|
|
|
- time_from = new Date(time_from.getTime() - (1000L * 60 * 60 * 12));
|
|
|
|
- }
|
|
|
|
- JSONObject parseObject = JSON.parseObject(param);
|
|
|
|
- String objId = parseObject.getString("objId");
|
|
|
|
- String code = parseObject.getString("code");
|
|
|
|
- String pointString = Repository.object2info2point.get(objId).get(code);
|
|
|
|
- int index_ = pointString.lastIndexOf('-');
|
|
|
|
- String meter = pointString.substring(0, index_);
|
|
|
|
- int funcid = Integer.parseInt(pointString.substring(index_ + 1));
|
|
|
|
- String result = fjd_query_history(meter, funcid, null, "15min", sdf.format(time_from), sdf.format(time_to));
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String fjd_query_history(String param) {
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- JSONObject parseObject = JSON.parseObject(param);
|
|
|
|
- String objId = parseObject.getString("objId");
|
|
|
|
- String code = parseObject.getString("code");
|
|
|
|
- String pointString = Repository.object2info2point.get(objId).get(code);
|
|
|
|
- int index_ = pointString.lastIndexOf('-');
|
|
|
|
- String meter = pointString.substring(0, index_);
|
|
|
|
- int funcid = Integer.parseInt(pointString.substring(index_ + 1));
|
|
|
|
- String data_type = parseObject.getString("data_type");
|
|
|
|
- String time_period = parseObject.getString("time_period");
|
|
|
|
- if (time_period == null) {
|
|
|
|
- time_period = "15min";
|
|
|
|
- }
|
|
|
|
- String time_from = parseObject.getString("time_from");
|
|
|
|
- String time_to = parseObject.getString("time_to");
|
|
|
|
- String result = fjd_query_history(meter, funcid, data_type, time_period, time_from, time_to);
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String fjd_query_history_batch(String param) {
|
|
|
|
- JSONObject result = new JSONObject();
|
|
|
|
- try {
|
|
|
|
- JSONArray parseArray = JSON.parseArray(param);
|
|
|
|
- fjd_query_history_batch_fill(parseArray);
|
|
|
|
- result.put("Content", parseArray);
|
|
|
|
- result.put("Result", "success");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error(e.getMessage(), e);
|
|
|
|
- String message = LogUtil.GetExceptionStackTrace(e);
|
|
|
|
- log.error(message);
|
|
|
|
- result.put("Result", "failure");
|
|
|
|
- result.put("ResultMsg", message);
|
|
|
|
- result.put("ResultCode", 250);
|
|
|
|
- }
|
|
|
|
- return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static ResponseEntity<FileSystemResource> fjd_query_history_batch_export(String param) throws Exception {
|
|
|
|
- JSONArray parseArray = JSON.parseArray(param);
|
|
|
|
- fjd_query_history_batch_fill(parseArray);
|
|
|
|
- ResponseEntity<FileSystemResource> fsr = ExportUtil.fjd_export(parseArray);
|
|
|
|
- return fsr;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void fjd_query_history_batch_export_hutool(String param, HttpServletResponse response) throws Exception {
|
|
|
|
- JSONArray parseArray = JSON.parseArray(param);
|
|
|
|
- fjd_query_history_batch_fill(parseArray);
|
|
|
|
- ExportUtil.fjd_export(parseArray, response);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void fjd_query_history_batch_fill(JSONArray parseArray) throws Exception {
|
|
|
|
- RepositoryImpl Repository = RepositoryContainer.instance;
|
|
|
|
- for (int i = 0; i < parseArray.size(); i++) {
|
|
|
|
- JSONObject parseObject = parseArray.getJSONObject(i);
|
|
|
|
- String objId = parseObject.getString("objId");
|
|
|
|
- String code = parseObject.getString("code");
|
|
|
|
- String pointString = Repository.object2info2point.get(objId).get(code);
|
|
|
|
- int index_ = pointString.lastIndexOf('-');
|
|
|
|
- String meter = pointString.substring(0, index_);
|
|
|
|
- int funcid = Integer.parseInt(pointString.substring(index_ + 1));
|
|
|
|
- String data_type = parseObject.getString("data_type");
|
|
|
|
- String time_period = parseObject.getString("time_period");
|
|
|
|
- if (time_period == null) {
|
|
|
|
- time_period = "15min";
|
|
|
|
- }
|
|
|
|
- String time_from = parseObject.getString("time_from");
|
|
|
|
- String time_to = parseObject.getString("time_to");
|
|
|
|
- JSONArray dataArray = fjd_query_inner(meter, funcid, data_type, time_period, time_from, time_to);
|
|
|
|
- parseObject.put("datas", dataArray);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String fjd_query_history(String meter, int funcid, String data_type, String time_period, String time_from, String time_to) {
|
|
|
|
- JSONObject result = new JSONObject();
|
|
|
|
- try {
|
|
|
|
- JSONArray datas = fjd_query_inner(meter, funcid, data_type, time_period, time_from, time_to);
|
|
|
|
- result.put("Content", datas);
|
|
|
|
- result.put("Result", "success");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error(e.getMessage(), e);
|
|
|
|
- String message = LogUtil.GetExceptionStackTrace(e);
|
|
|
|
- log.error(message);
|
|
|
|
- result.put("Result", "failure");
|
|
|
|
- result.put("ResultMsg", message);
|
|
|
|
- result.put("ResultCode", 250);
|
|
|
|
- }
|
|
|
|
- return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String path_array_history_fjd_query(String param) {
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
- JSONObject parseObject = JSON.parseObject(param);
|
|
|
|
- String time_from = parseObject.getString("time_from");
|
|
|
|
- String time_to = parseObject.getString("time_to");
|
|
|
|
- JSONArray Items = parseObject.getJSONArray("Items");
|
|
|
|
- List<Object> drawObjectList = new ArrayList<Object>();
|
|
|
|
- Map<String, String> ObjInfo2Point = new ConcurrentHashMap<String, String>();
|
|
|
|
- for (int i = 0; i < Items.size(); i++) {
|
|
|
|
- JSONObject item = (JSONObject) Items.get(i);
|
|
|
|
- JSONArray path = (JSONArray) item.get("path");
|
|
|
|
- Object valueObject = ComputeUtil.getValueObject(RepositoryContainer.instance, path);
|
|
|
|
- Object drawObject = DrawUtil.drawObject(RepositoryContainer.instance, valueObject, ObjInfo2Point);
|
|
|
|
- drawObjectList.add(drawObject);
|
|
|
|
- }
|
|
|
|
- Map<String, JSONArray> Point2datas = new ConcurrentHashMap<String, JSONArray>();
|
|
|
|
- Map<String, IntWrapper> Point2index = new ConcurrentHashMap<String, IntWrapper>();
|
|
|
|
- JSONArray points = new JSONArray();
|
|
|
|
- for (String objInfo : ObjInfo2Point.keySet()) {
|
|
|
|
- String point = ObjInfo2Point.get(objInfo);
|
|
|
|
- int index_ = point.lastIndexOf('-');
|
|
|
|
- String meter = point.substring(0, index_);
|
|
|
|
- int funcid = Integer.parseInt(point.substring(index_ + 1));
|
|
|
|
- JSONObject pointObject = new JSONObject();
|
|
|
|
- pointObject.put("meter", meter);
|
|
|
|
- pointObject.put("funcid", funcid);
|
|
|
|
- pointObject.put("time_period", "15min");
|
|
|
|
- pointObject.put("time_from", time_from);
|
|
|
|
- pointObject.put("time_to", time_to);
|
|
|
|
- points.add(pointObject);
|
|
|
|
- if (points.size() > 10) {
|
|
|
|
- fjd_query_result_process(points, Point2datas, Point2index);
|
|
|
|
- points = new JSONArray();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (points.size() > 0) {
|
|
|
|
- fjd_query_result_process(points, Point2datas, Point2index);
|
|
|
|
- points = new JSONArray();
|
|
|
|
- }
|
|
|
|
- JSONArray result = new JSONArray();
|
|
|
|
- try {
|
|
|
|
- Date timeFrom = sdf.parse(time_from);
|
|
|
|
- Date timeTo = sdf.parse(time_to);
|
|
|
|
- for (Date tmpDate = timeFrom; tmpDate.getTime() < timeTo.getTime(); tmpDate = new Date(tmpDate.getTime() + 1000L * 60 * 15)) {
|
|
|
|
- String tmp = sdf.format(tmpDate);
|
|
|
|
- JSONObject timeJSON = new JSONObject();
|
|
|
|
- timeJSON.put("time", tmp);
|
|
|
|
- JSONArray time_datas = new JSONArray();
|
|
|
|
- for (int i = 0; i < Items.size(); i++) {
|
|
|
|
- JSONObject item = (JSONObject) Items.get(i);
|
|
|
|
- Object drawObject = drawObjectList.get(i);
|
|
|
|
- Object valueObject = RecursiveUtil.fillTimeValueObject(drawObject, Point2datas, Point2index, tmp);
|
|
|
|
- String name = (String) item.get("name");
|
|
|
|
- JSONObject resultItem = new JSONObject();
|
|
|
|
- resultItem.put("name", name);
|
|
|
|
- resultItem.put("Content", valueObject);
|
|
|
|
- time_datas.add(resultItem);
|
|
|
|
- }
|
|
|
|
- timeJSON.put("pathArray", time_datas);
|
|
|
|
- result.add(timeJSON);
|
|
|
|
- }
|
|
|
|
- } catch (ParseException e) {
|
|
|
|
- // log.error(e.getMessage(),e);
|
|
|
|
- }
|
|
|
|
- return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private static void fjd_query_result_process(JSONArray points, Map<String, JSONArray> Point2datas, Map<String, IntWrapper> Point2index) {
|
|
|
|
- JSONArray pointResult = null;
|
|
|
|
- try {
|
|
|
|
- pointResult = fjd_query_inner(points);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- // log.error(e.getMessage(),e);
|
|
|
|
- try {
|
|
|
|
- pointResult = fjd_query_inner(points);
|
|
|
|
- } catch (Exception e1) {
|
|
|
|
- // log.error(e.getMessage(),e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (pointResult == null) {
|
|
|
|
- pointResult = new JSONArray();
|
|
|
|
- }
|
|
|
|
- for (int i = 0; i < pointResult.size(); i++) {
|
|
|
|
- JSONObject point = pointResult.getJSONObject(i);
|
|
|
|
- String meter = point.getString("meter");
|
|
|
|
- int funcid = point.getIntValue("funcid");
|
|
|
|
- JSONArray datas = point.getJSONArray("datas");
|
|
|
|
- if (datas == null) {
|
|
|
|
- datas = new JSONArray();
|
|
|
|
- }
|
|
|
|
- String pointString = meter + "-" + funcid;
|
|
|
|
- Point2datas.put(pointString, datas);
|
|
|
|
- Point2index.put(pointString, new IntWrapper());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private static JSONArray fjd_query_inner(JSONArray points) throws Exception {
|
|
|
|
- JSONObject postJSON = new JSONObject();
|
|
|
|
- postJSON.put("building", RepositoryContainer.RepositoryProject.projectId.substring(2));
|
|
|
|
- postJSON.put("points", points);
|
|
|
|
- String post_url = Constant.iot_collect_url + "/fjd_query_batch_post";
|
|
|
|
- String post_result = HttpClientUtil.post(post_url, postJSON.toJSONString());
|
|
|
|
- JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
|
- JSONArray result_points = (JSONArray) resultJSON.get("points");
|
|
|
|
- return result_points;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private static JSONArray fjd_query_inner(String meter, int funcid, String data_type, String time_period, String time_from, String time_to)
|
|
|
|
- throws Exception {
|
|
|
|
- JSONObject pointObject = new JSONObject();
|
|
|
|
- pointObject.put("meter", meter);
|
|
|
|
- pointObject.put("funcid", funcid);
|
|
|
|
- pointObject.put("data_type", data_type);
|
|
|
|
- pointObject.put("time_period", time_period);
|
|
|
|
- pointObject.put("time_from", time_from);
|
|
|
|
- pointObject.put("time_to", time_to);
|
|
|
|
- JSONArray points = new JSONArray();
|
|
|
|
- points.add(pointObject);
|
|
|
|
- JSONObject postJSON = new JSONObject();
|
|
|
|
- postJSON.put("building", RepositoryContainer.RepositoryProject.projectId.substring(2));
|
|
|
|
- postJSON.put("points", points);
|
|
|
|
- String post_url = Constant.iot_collect_url + "/fjd_query_batch_post";
|
|
|
|
- String post_result = HttpClientUtil.post(post_url, postJSON.toJSONString());
|
|
|
|
- JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
|
- JSONArray result_points = (JSONArray) resultJSON.get("points");
|
|
|
|
- JSONObject result_point = (JSONObject) result_points.get(0);
|
|
|
|
- JSONArray datas = (JSONArray) result_point.get("datas");
|
|
|
|
- return datas;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public static JSONObject getEquipStaticInfo(String param) {
|
|
public static JSONObject getEquipStaticInfo(String param) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
try {
|
|
try {
|