|
@@ -5,6 +5,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+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;
|
|
@@ -15,11 +17,10 @@ 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.FastJsonCompareUtil;
|
|
|
import com.persagy.ibms.core.util.FilterUtil;
|
|
|
+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;
|
|
@@ -149,15 +150,33 @@ public class RestApi {
|
|
|
|
|
|
@PostMapping(path = { "/post_filter_and_page", "/zkt-sdk/post_filter_and_page" }, produces = "application/json;charset=UTF-8")
|
|
|
public String post_filter_and_page(@RequestBody String param, HttpServletRequest request) {
|
|
|
+ String result = FilterUtil.post_filter_and_page(RepositoryContainer.instance, param);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(path = { "/history_alarm", "/zkt-sdk/history_alarm" }, produces = "application/json;charset=UTF-8")
|
|
|
+ public String history_alarm(@RequestBody String param, HttpServletRequest request) {
|
|
|
JSONObject paramObject = JSON.parseObject(param);
|
|
|
- JSONArray path = (JSONArray) paramObject.get("path");
|
|
|
- if (FastJsonCompareUtil.Instance().Compare(path, RWDAlarmUtil.history_alarm_path, true)) {
|
|
|
- String result = RWDAlarmUtil.post_filter_and_page(paramObject);
|
|
|
- return result;
|
|
|
- } else {
|
|
|
- String result = FilterUtil.post_filter_and_page(RepositoryContainer.instance, param);
|
|
|
- return result;
|
|
|
- }
|
|
|
+ JSONObject result = RWDAlarmUtil.post_filter_and_page(paramObject);
|
|
|
+ return result.toJSONString();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(path = "/history_alarm_export_get/{param}")
|
|
|
+ public ResponseEntity<FileSystemResource> history_alarm_export_get(@PathVariable("param") String param) {
|
|
|
+ JSONObject params = JSON.parseObject(param);
|
|
|
+ JSONObject paramObject = new JSONObject();
|
|
|
+ paramObject.put("params", params);
|
|
|
+ ResponseEntity<FileSystemResource> fsr = ExportUtil.history_alarm_export(paramObject);
|
|
|
+ return fsr;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(path = "/history_alarm_export_post", method = { RequestMethod.POST })
|
|
|
+ public ResponseEntity<FileSystemResource> history_alarm_export_post(@RequestParam(required = false) String param) {
|
|
|
+ JSONObject params = JSON.parseObject(param);
|
|
|
+ JSONObject paramObject = new JSONObject();
|
|
|
+ paramObject.put("params", params);
|
|
|
+ ResponseEntity<FileSystemResource> fsr = ExportUtil.history_alarm_export(paramObject);
|
|
|
+ return fsr;
|
|
|
}
|
|
|
|
|
|
@PostMapping(path = { "/control", "/zkt-sdk/control" }, produces = "application/json;charset=UTF-8")
|