From 089969712d9041535713eecded3550b1f2f9ef73 Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Wed, 21 Feb 2024 09:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=B8=8A=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/mapApi/MapController.java | 24 +++++++++++++++++- src/main/java/com/zcloud/util/PLSUtil.java | 25 ++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/mapApi/MapController.java b/src/main/java/com/zcloud/controller/mapApi/MapController.java index dc5ed1c..48ac4b6 100644 --- a/src/main/java/com/zcloud/controller/mapApi/MapController.java +++ b/src/main/java/com/zcloud/controller/mapApi/MapController.java @@ -73,7 +73,29 @@ public class MapController extends BaseController { public ReturnMap getAlarmTypeCount() throws Exception { return ReturnMap.ok().put("data", PLSUtil.getAlarmTypeCount(Jurisdiction.getCORPINFO_ID())); } - + /** + * @Description: 告警数据 来自人员定位系统 + * @Author: dearLin + * @Date: 2024/1/26/026 16:43 + * @Param: [] [] + * @Return: com.zcloud.util.ReturnMap + */ + @RequestMapping(value = "/getAlArmDataList") + @ResponseBody + public ReturnMap getAlArmDataList(Page page) throws Exception { + PageData pageData = this.getPageData(); + ReturnMap returnMap = new ReturnMap(); + JSONObject body = PLSUtil.getAlArmDataList( + Jurisdiction.getCORPINFO_ID(), page.getCurrentPage() + 1, page.getShowCount(), "", Integer.parseInt(pageData.getString("status")), Integer.parseInt(pageData.getString("eleType")) + ); + if (body != null) { + List list = body.getJSONArray("rows").toJavaList(JSONObject.class); + returnMap.put("varList", list); + page.setTotalResult(body.getIntValue("total")); + returnMap.put("page", page); + } + return returnMap; + } /** * @Description: 人员定位情况 来自人员定位系统 * @Author: dearLin diff --git a/src/main/java/com/zcloud/util/PLSUtil.java b/src/main/java/com/zcloud/util/PLSUtil.java index 3eff458..1e7d152 100644 --- a/src/main/java/com/zcloud/util/PLSUtil.java +++ b/src/main/java/com/zcloud/util/PLSUtil.java @@ -68,6 +68,28 @@ public class PLSUtil { JSONObject.class); return exchange.getBody(); } + + + /** + * @Description: 电子围栏列表 + * @Author: dearLin + * @Date: 2024/1/25/025 14:37 + * @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount] + * @Return: com.alibaba.fastjson.JSONObject + */ + public static JSONObject getAlArmDataList(String CORPINFO_ID, Integer currentPage, Integer showCount ,String keywords,Integer status,Integer eleType) throws Exception { + HttpHeaders headers = new HttpHeaders(); + + headers.set("Authorization", getToken(CORPINFO_ID)); + // "/region/alarm/list?pageNum=" + + // currentPage + "&pageSize=" + showCount +"&str=" + "&eleType="+eleType+ "&status="+status + HttpEntity httpEntity = new HttpEntity<>(headers); + ResponseEntity exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + + "/region/alarm/list?eleType="+eleType+"+&status="+status+"&pageNum="+currentPage+"&pageSize="+showCount+"&str=" + ,HttpMethod.GET, httpEntity, JSONObject.class); + return exchange.getBody(); + } + /** * @Description: 查询摄像头 * @Author: dearLin @@ -79,7 +101,8 @@ public class PLSUtil { HttpHeaders headers = new HttpHeaders(); headers.set("Authorization", getToken(CORPINFO_ID)); HttpEntity httpEntity = new HttpEntity<>(headers); - ResponseEntity exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera/list?pageNum=1&pageSize=100000&str=", HttpMethod.GET, httpEntity, JSONObject.class); + ResponseEntity exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + + "/device/camera/list?pageNum=1&pageSize=100000&str=", HttpMethod.GET, httpEntity, JSONObject.class); return exchange.getBody(); }