menglu 3 лет назад
Родитель
Сommit
0876b5b596

+ 56 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/AlarmApi.java

@@ -0,0 +1,56 @@
+package com.persagy.ibms.data.sdk.service.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.persagy.ibms.data.sdk.util.ExportUtil;
+import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
+
+@RestController
+public class AlarmApi {
+
+	@PostMapping(path = { "/alarm_export_post", "/zkt-sdk/alarm_export_post" }, produces = "application/json;charset=UTF-8")
+	public void alarm_export_post(@RequestBody String param, HttpServletResponse response) throws Exception {
+		JSONObject paramObject = JSON.parseObject(param);
+		JSONObject result = RestUtil.post_filter_and_page(paramObject);
+		ExportUtil.alarm_export(result, response);
+	}
+
+	@PostMapping(path = { "/alarm_export_post_poi", "/zkt-sdk/alarm_export_post_poi" }, produces = "application/json;charset=UTF-8")
+	public ResponseEntity<FileSystemResource> alarm_export_post_poi(@RequestBody String param) throws Exception {
+		JSONObject paramObject = JSON.parseObject(param);
+		JSONObject result = RestUtil.post_filter_and_page(paramObject);
+		ResponseEntity<FileSystemResource> fsr = ExportUtil.alarm_export(result);
+		return fsr;
+	}
+
+	@PostMapping(path = { "/get_alarm_detail", "/zkt-sdk/get_alarm_detail" }, produces = "application/json;charset=UTF-8")
+	public String get_alarm_detail(@RequestBody String param, HttpServletRequest request) {
+		JSONObject paramObject = JSON.parseObject(param);
+		JSONObject result = RWDAlarmUtil.get_alarm_detail(paramObject);
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
+	}
+
+
+	@PostMapping(path = { "/handleAlarm", "/zkt-sdk/handleAlarm" }, produces = "application/json;charset=UTF-8")
+	public String handleAlarm(@RequestBody String param, HttpServletRequest request) {
+		String result = RWDAlarmUtil.handleAlarm(param);
+		return result;
+	}
+
+	@PostMapping(path = { "/alarmToWorkOrder", "/zkt-sdk/alarmToWorkOrder" }, produces = "application/json;charset=UTF-8")
+	public String alarmToWorkOrder(@RequestBody String param, HttpServletRequest request) {
+		String result = RWDAlarmUtil.alarmToWorkOrder(param);
+		return result;
+	}
+
+}

+ 141 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/BaseApi.java

@@ -0,0 +1,141 @@
+package com.persagy.ibms.data.sdk.service.rest;
+
+import java.text.SimpleDateFormat;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.persagy.ibms.core.util.CheckUtil;
+import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketChannelInfo;
+import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketChannelPool;
+import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketUtil;
+import com.persagy.ibms.data.sdk.util.RepositoryContainer;
+import com.persagy.ibms.data.sdk.util.ToolUtil;
+import com.persagy.ibms.data.sdk.websocket.AlarmWebSocketClient;
+import com.persagy.ibms.data.sdk.websocket.IOTWebSocketClient;
+
+import lombok.extern.slf4j.Slf4j;
+
+@RestController
+@Slf4j
+public class BaseApi {
+	@RequestMapping(path = "/test_post_param", method = { RequestMethod.POST })
+	public String test_post_param(@RequestParam(required = false) String param) {
+		return "Hello World!" + "\n" + param;
+	}
+
+	@PostMapping(path = "/test_post_body")
+	public String test_post_body(@RequestBody String body) {
+		return "Hello World!" + "\n" + body;
+	}
+
+	@PostMapping(path = "/test_post_sleep")
+	public String test_post_sleep(@RequestBody String body, HttpServletRequest request) {
+		String ip = RestUtil.getIp(request);
+		log.info("ip:" + ip + " || test_post_sleep: " + body);
+		JSONObject param = JSON.parseObject(body);
+		String sleep = param.getString("sleep");
+		try {
+			long millisecond = Long.parseLong(sleep);
+			Thread.sleep(millisecond);
+		} catch (Exception e) {
+			log.error(e.getMessage(), e);
+		}
+		return body;
+	}
+
+	@GetMapping(path = "/test_get/{param}")
+	String test_get(@PathVariable("param") String param) {
+		return "Hello World!" + "\n" + param;
+	}
+
+	@GetMapping(path = "/iot_websocket_close")
+	public String iot_websocket_close() {
+		IOTWebSocketClient.client.close();
+		return "iot_websocket_close";
+	}
+
+	@GetMapping(path = "/alarm_websocket_close")
+	public String alarm_websocket_close() {
+		AlarmWebSocketClient.client.close();
+		return "alarm_websocket_close";
+	}
+
+	@GetMapping(path = "/get_SDKVersion")
+	public String get_SDKVersion() {
+		return "ibms-sdk";
+	}
+
+	@PostMapping(path = { "/get_projectInfo", "/zkt-sdk/get_projectInfo" }, produces = "application/json;charset=UTF-8")
+	public String get_projectInfo() {
+		JSONObject result = new JSONObject();
+		result.put("projectId", RepositoryContainer.RepositoryProject.projectId);
+		result.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
+	}
+
+	@GetMapping(path = "/get_sceneJSON")
+	public String get_sceneJSON() {
+		String result = JSONObject.toJSONString(RepositoryContainer.instance.sceneJSON, SerializerFeature.WriteMapNullValue);
+		return result;
+	}
+
+	@PostMapping(path = { "/check" }, produces = "application/json;charset=UTF-8")
+	public String check(@RequestBody String param) {
+		JSONObject sceneJSON_ori = JSON.parseObject(param);
+		JSONObject result = CheckUtil.check(sceneJSON_ori);
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
+	}
+
+	@PostMapping(path = { "/desc" }, produces = "application/json;charset=UTF-8")
+	public String desc(@RequestBody String param) {
+		String result = BaseUtil.desc(param);
+		return result;
+	}
+
+	@PostMapping(path = { "/show" }, produces = "application/json;charset=UTF-8")
+	public String show(@RequestBody String param) {
+		String result = BaseUtil.show(param);
+		return result;
+	}
+
+	@GetMapping(path = { "/showTree" }, produces = "application/json;charset=UTF-8")
+	String showTree() {
+		String result = BaseUtil.showTree();
+		return result;
+	}
+
+	@PostMapping(path = { "/tool" }, produces = "application/json;charset=UTF-8")
+	public String tool(@RequestBody String param) {
+		String result = ToolUtil.tool(param);
+		return result;
+	}
+
+	@GetMapping(path = "/websocket_client_list")
+	public String websocket_client_list() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		JSONArray result = new JSONArray();
+		for (String id : WebSocketChannelPool.id2ChannelInfo.keySet()) {
+			WebSocketChannelInfo WebSocketChannelInfo = WebSocketChannelPool.id2ChannelInfo.get(id);
+			JSONObject item = new JSONObject();
+			item.put("id", id);
+			item.put("remoteAddress", WebSocketChannelInfo.remoteAddress.toString());
+			item.put("connectTime", sdf.format(WebSocketChannelInfo.connectTime));
+			item.put("objArray", WebSocketUtil.idMap.get(id));
+			result.add(item);
+		}
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
+	}
+}

+ 115 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/BaseUtil.java

@@ -0,0 +1,115 @@
+package com.persagy.ibms.data.sdk.service.rest;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.persagy.ibms.core.data.SceneDataObject;
+import com.persagy.ibms.core.data.SceneDataValue;
+import com.persagy.ibms.core.util.ComputeUtil;
+import com.persagy.ibms.core.util.LogUtil;
+import com.persagy.ibms.core.util.RecursiveUtil;
+import com.persagy.ibms.data.sdk.util.RepositoryContainer;
+import com.persagy.ibms.data.sdk.util.RepositoryImpl;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class BaseUtil {
+
+	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 = 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;
+		}
+	}
+
+}

+ 0 - 199
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/RestApi.java

@@ -1,134 +1,24 @@
 package com.persagy.ibms.data.sdk.service.rest;
 
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.persagy.ibms.core.util.CheckUtil;
-import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketChannelInfo;
-import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketChannelPool;
-import com.persagy.ibms.data.sdk.service.websocket.server.WebSocketUtil;
-import com.persagy.ibms.data.sdk.util.ExportUtil;
-import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
 import com.persagy.ibms.data.sdk.util.RepositoryContainer;
-import com.persagy.ibms.data.sdk.util.ToolUtil;
-import com.persagy.ibms.data.sdk.websocket.AlarmWebSocketClient;
-import com.persagy.ibms.data.sdk.websocket.IOTWebSocketClient;
 
 import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
 
-@ApiOperation(value = "采集/控制接口")
 @RestController
-@Slf4j
 public class RestApi {
-	@RequestMapping(path = "/test_post_param", method = { RequestMethod.POST })
-	public String test_post_param(@RequestParam(required = false) String param) {
-		return "Hello World!" + "\n" + param;
-	}
-
-	@PostMapping(path = "/test_post_body")
-	public String test_post_body(@RequestBody String body) {
-		return "Hello World!" + "\n" + body;
-	}
-
-	@PostMapping(path = "/test_post_sleep")
-	public String test_post_sleep(@RequestBody String body, HttpServletRequest request) {
-		String ip = RestUtil.getIp(request);
-		log.info("ip:" + ip + " || test_post_sleep: " + body);
-		JSONObject param = JSON.parseObject(body);
-		String sleep = param.getString("sleep");
-		try {
-			long millisecond = Long.parseLong(sleep);
-			Thread.sleep(millisecond);
-		} catch (Exception e) {
-			log.error(e.getMessage(), e);
-		}
-		return body;
-	}
-
-	@GetMapping(path = "/test_get/{param}")
-	String test_get(@PathVariable("param") String param) {
-		return "Hello World!" + "\n" + param;
-	}
-
-	@GetMapping(path = "/iot_websocket_close")
-	public String iot_websocket_close() {
-		IOTWebSocketClient.client.close();
-		return "iot_websocket_close";
-	}
-
-	@GetMapping(path = "/alarm_websocket_close")
-	public String alarm_websocket_close() {
-		AlarmWebSocketClient.client.close();
-		return "alarm_websocket_close";
-	}
-
-	@GetMapping(path = "/websocket_client_list")
-	public String websocket_client_list() {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		JSONArray result = new JSONArray();
-		for (String id : WebSocketChannelPool.id2ChannelInfo.keySet()) {
-			WebSocketChannelInfo WebSocketChannelInfo = WebSocketChannelPool.id2ChannelInfo.get(id);
-			JSONObject item = new JSONObject();
-			item.put("id", id);
-			item.put("remoteAddress", WebSocketChannelInfo.remoteAddress.toString());
-			item.put("connectTime", sdf.format(WebSocketChannelInfo.connectTime));
-			item.put("objArray", WebSocketUtil.idMap.get(id));
-			result.add(item);
-		}
-		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
-	}
-
-	@PostMapping(path = { "/check" }, produces = "application/json;charset=UTF-8")
-	public String check(@RequestBody String param) {
-		JSONObject sceneJSON_ori = JSON.parseObject(param);
-		JSONObject result = CheckUtil.check(sceneJSON_ori);
-		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
-	}
-
-	@PostMapping(path = { "/desc" }, produces = "application/json;charset=UTF-8")
-	public String desc(@RequestBody String param) {
-		String result = RestUtil.desc(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/show" }, produces = "application/json;charset=UTF-8")
-	public String show(@RequestBody String param) {
-		String result = RestUtil.show(param);
-		return result;
-	}
-
-	@GetMapping(path = { "/showTree" }, produces = "application/json;charset=UTF-8")
-	String showTree() {
-		String result = RestUtil.showTree();
-		return result;
-	}
-
-	@PostMapping(path = { "/tool" }, produces = "application/json;charset=UTF-8")
-	public String tool(@RequestBody String param) {
-		String result = ToolUtil.tool(param);
-		return result;
-	}
 
 	@PostMapping(path = { "/query", "/zkt-sdk/query" }, produces = "application/json;charset=UTF-8")
 	public String query(@RequestBody String param, HttpServletRequest request) {
@@ -142,25 +32,6 @@ public class RestApi {
 		return result;
 	}
 
-	@PostMapping(path = { "/get_projectInfo", "/zkt-sdk/get_projectInfo" }, produces = "application/json;charset=UTF-8")
-	public String get_projectInfo() {
-		JSONObject result = new JSONObject();
-		result.put("projectId", RepositoryContainer.RepositoryProject.projectId);
-		result.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
-		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
-	}
-
-	@GetMapping(path = "/get_SDKVersion")
-	public String get_SDKVersion() {
-		return "ibms-sdk";
-	}
-
-	@GetMapping(path = "/get_sceneJSON")
-	public String get_sceneJSON() {
-		String result = JSONObject.toJSONString(RepositoryContainer.instance.sceneJSON, SerializerFeature.WriteMapNullValue);
-		return result;
-	}
-
 	@PostMapping(path = { "/post", "/zkt-sdk/post" }, produces = "application/json;charset=UTF-8")
 	public String post(@RequestBody String param, HttpServletRequest request) {
 		String ip = RestUtil.getIp(request);
@@ -205,28 +76,6 @@ public class RestApi {
 		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
-	@PostMapping(path = { "/get_alarm_detail", "/zkt-sdk/get_alarm_detail" }, produces = "application/json;charset=UTF-8")
-	public String get_alarm_detail(@RequestBody String param, HttpServletRequest request) {
-		JSONObject paramObject = JSON.parseObject(param);
-		JSONObject result = RWDAlarmUtil.get_alarm_detail(paramObject);
-		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
-	}
-
-	@PostMapping(path = { "/alarm_export_post", "/zkt-sdk/alarm_export_post" }, produces = "application/json;charset=UTF-8")
-	public void alarm_export_post(@RequestBody String param, HttpServletResponse response) throws Exception {
-		JSONObject paramObject = JSON.parseObject(param);
-		JSONObject result = RestUtil.post_filter_and_page(paramObject);
-		ExportUtil.alarm_export(result, response);
-	}
-
-	@PostMapping(path = { "/alarm_export_post_poi", "/zkt-sdk/alarm_export_post_poi" }, produces = "application/json;charset=UTF-8")
-	public ResponseEntity<FileSystemResource> alarm_export_post_poi(@RequestBody String param) throws Exception {
-		JSONObject paramObject = JSON.parseObject(param);
-		JSONObject result = RestUtil.post_filter_and_page(paramObject);
-		ResponseEntity<FileSystemResource> fsr = ExportUtil.alarm_export(result);
-		return fsr;
-	}
-
 	@PostMapping(path = { "/control", "/zkt-sdk/control" }, produces = "application/json;charset=UTF-8")
 	public String control(@RequestBody String param, HttpServletRequest request) {
 		String result = RestUtil.control(param);
@@ -239,54 +88,6 @@ public class RestApi {
 		return result;
 	}
 
-	@PostMapping(path = { "/handleAlarm", "/zkt-sdk/handleAlarm" }, produces = "application/json;charset=UTF-8")
-	public String handleAlarm(@RequestBody String param, HttpServletRequest request) {
-		String result = RWDAlarmUtil.handleAlarm(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/alarmToWorkOrder", "/zkt-sdk/alarmToWorkOrder" }, produces = "application/json;charset=UTF-8")
-	public String alarmToWorkOrder(@RequestBody String param, HttpServletRequest request) {
-		String result = RWDAlarmUtil.alarmToWorkOrder(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/fjd_query", "/zkt-sdk/fjd_query" }, produces = "application/json;charset=UTF-8")
-	public String fjd_query(@RequestBody String param, HttpServletRequest request) {
-		String result = RestUtil.fjd_query(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/history_fjd_query", "/zkt-sdk/history_fjd_query" }, produces = "application/json;charset=UTF-8")
-	public String fjd_query_history(@RequestBody String param, HttpServletRequest request) {
-		String result = RestUtil.fjd_query_history(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/history_fjd_query_batch", "/zkt-sdk/history_fjd_query_batch" }, produces = "application/json;charset=UTF-8")
-	public String fjd_query_history_batch(@RequestBody String param, HttpServletRequest request) {
-		String result = RestUtil.fjd_query_history_batch(param);
-		return result;
-	}
-
-	@PostMapping(path = { "/fjd_query_history_batch_export_poi",
-			"/zkt-sdk/fjd_query_history_batch_export_poi" }, produces = "application/json;charset=UTF-8")
-	public ResponseEntity<FileSystemResource> fjd_query_history_batch_export_poi(@RequestBody String param) throws Exception {
-		ResponseEntity<FileSystemResource> fsr = RestUtil.fjd_query_history_batch_export(param);
-		return fsr;
-	}
-
-	@PostMapping(path = { "/fjd_query_history_batch_export", "/zkt-sdk/fjd_query_history_batch_export" }, produces = "application/json;charset=UTF-8")
-	public void fjd_query_history_batch_export(@RequestBody String param, HttpServletResponse response) throws Exception {
-		RestUtil.fjd_query_history_batch_export_hutool(param, response);
-	}
-
-	@PostMapping(path = { "/path_array_history_fjd_query", "/zkt-sdk/path_array_history_fjd_query" }, produces = "application/json;charset=UTF-8")
-	public String path_array_history_fjd_query(@RequestBody String param, HttpServletRequest request) {
-		String result = RestUtil.path_array_history_fjd_query(param);
-		return result;
-	}
-
 	@PostMapping(path = { "/light_time_table", "/zkt-sdk/light_time_table" }, produces = "application/json;charset=UTF-8")
 	public String light_time_table(@RequestBody String param, HttpServletRequest request) {
 		String result = LightingUtil.light_time_table(param);

+ 0 - 347
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/RestUtil.java

@@ -1,25 +1,17 @@
 package com.persagy.ibms.data.sdk.service.rest;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
 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.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 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.SceneDataSet;
 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.FastJsonCompareUtil;
 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.QueryAssist;
 import com.persagy.ibms.core.util.QueryUtil;
 import com.persagy.ibms.core.util.RecursiveUtil;
 import com.persagy.ibms.data.sdk.util.Constant;
 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.ExportUtil;
 import com.persagy.ibms.data.sdk.util.HttpClientUtil;
 import com.persagy.ibms.data.sdk.util.RWDAlarmUtil;
 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) {
 		JSONArray batchResult = new JSONArray();
 		for (int i = 0; i < pathArray.size(); i++) {
@@ -375,247 +269,6 @@ public class RestUtil {
 		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) {
 		JSONObject result = new JSONObject();
 		try {

+ 51 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/fjd_Api.java

@@ -0,0 +1,51 @@
+package com.persagy.ibms.data.sdk.service.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class fjd_Api {
+
+	@PostMapping(path = { "/fjd_query", "/zkt-sdk/fjd_query" }, produces = "application/json;charset=UTF-8")
+	public String fjd_query(@RequestBody String param, HttpServletRequest request) {
+		String result = fjd_Util.fjd_query(param);
+		return result;
+	}
+
+	@PostMapping(path = { "/history_fjd_query", "/zkt-sdk/history_fjd_query" }, produces = "application/json;charset=UTF-8")
+	public String fjd_query_history(@RequestBody String param, HttpServletRequest request) {
+		String result = fjd_Util.fjd_query_history(param);
+		return result;
+	}
+
+	@PostMapping(path = { "/history_fjd_query_batch", "/zkt-sdk/history_fjd_query_batch" }, produces = "application/json;charset=UTF-8")
+	public String fjd_query_history_batch(@RequestBody String param, HttpServletRequest request) {
+		String result = fjd_Util.fjd_query_history_batch(param);
+		return result;
+	}
+
+	@PostMapping(path = { "/fjd_query_history_batch_export_poi",
+			"/zkt-sdk/fjd_query_history_batch_export_poi" }, produces = "application/json;charset=UTF-8")
+	public ResponseEntity<FileSystemResource> fjd_query_history_batch_export_poi(@RequestBody String param) throws Exception {
+		ResponseEntity<FileSystemResource> fsr = fjd_Util.fjd_query_history_batch_export(param);
+		return fsr;
+	}
+
+	@PostMapping(path = { "/fjd_query_history_batch_export", "/zkt-sdk/fjd_query_history_batch_export" }, produces = "application/json;charset=UTF-8")
+	public void fjd_query_history_batch_export(@RequestBody String param, HttpServletResponse response) throws Exception {
+		fjd_Util.fjd_query_history_batch_export_hutool(param, response);
+	}
+
+	@PostMapping(path = { "/path_array_history_fjd_query", "/zkt-sdk/path_array_history_fjd_query" }, produces = "application/json;charset=UTF-8")
+	public String path_array_history_fjd_query(@RequestBody String param, HttpServletRequest request) {
+		String result = fjd_Util.path_array_history_fjd_query(param);
+		return result;
+	}
+
+}

+ 277 - 0
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/fjd_Util.java

@@ -0,0 +1,277 @@
+package com.persagy.ibms.data.sdk.service.rest;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+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.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.persagy.ibms.core.util.ComputeUtil;
+import com.persagy.ibms.core.util.IntWrapper;
+import com.persagy.ibms.core.util.LogUtil;
+import com.persagy.ibms.core.util.RecursiveUtil;
+import com.persagy.ibms.data.sdk.util.Constant;
+import com.persagy.ibms.data.sdk.util.DrawUtil;
+import com.persagy.ibms.data.sdk.util.ExportUtil;
+import com.persagy.ibms.data.sdk.util.HttpClientUtil;
+import com.persagy.ibms.data.sdk.util.RepositoryContainer;
+import com.persagy.ibms.data.sdk.util.RepositoryImpl;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+public class fjd_Util {
+
+	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);
+	}
+
+	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 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());
+		}
+	}
+
+}