| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | package com.zcloud.controller.mapApi; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  | import com.alibaba.fastjson.JSONObject; | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | import com.zcloud.controller.base.BaseController; | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  | import com.zcloud.entity.Page; | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | import com.zcloud.entity.PageData; | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  | import com.zcloud.service.eightwork.ConfinedspaceService; | 
					
						
							| 
									
										
										
										
											2024-01-30 10:38:22 +08:00
										 |  |  |  | import com.zcloud.service.eightwork.EightWorkService; | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  | import com.zcloud.service.eightwork.HighworkService; | 
					
						
							|  |  |  |  | import com.zcloud.service.eightwork.HotworkService; | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | import com.zcloud.service.system.UsersService; | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  | import com.zcloud.service.video.VideoManagerService; | 
					
						
							|  |  |  |  | import com.zcloud.util.DateUtil; | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | import com.zcloud.util.Jurisdiction; | 
					
						
							|  |  |  |  | import com.zcloud.util.PLSUtil; | 
					
						
							|  |  |  |  | import com.zcloud.util.ReturnMap; | 
					
						
							|  |  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
					
						
							|  |  |  |  | import org.springframework.stereotype.Controller; | 
					
						
							|  |  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  | import org.springframework.web.bind.annotation.ResponseBody; | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  | import java.text.DateFormat; | 
					
						
							|  |  |  |  | import java.text.SimpleDateFormat; | 
					
						
							|  |  |  |  | import java.util.*; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | /** | 
					
						
							|  |  |  |  |  * 说明:TODO | 
					
						
							|  |  |  |  |  * 作者:wangxuan | 
					
						
							|  |  |  |  |  * 官网:www.zcloudchina.com | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | @Controller | 
					
						
							|  |  |  |  | @RequestMapping("/map") | 
					
						
							|  |  |  |  | public class MapController extends BaseController { | 
					
						
							|  |  |  |  |     @Autowired | 
					
						
							|  |  |  |  |     private UsersService usersService; | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     @Autowired | 
					
						
							| 
									
										
										
										
											2024-01-30 10:38:22 +08:00
										 |  |  |  |     private EightWorkService eightWorkService; | 
					
						
							|  |  |  |  |     @Autowired | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     private VideoManagerService videomanagerService; | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  |     @Autowired | 
					
						
							|  |  |  |  |     private HotworkService hotworkService; | 
					
						
							|  |  |  |  |     @Autowired | 
					
						
							|  |  |  |  |     private ConfinedspaceService confinedspaceService; | 
					
						
							|  |  |  |  |     @Autowired | 
					
						
							|  |  |  |  |     private HighworkService highworkService; | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  | // ----------人员定位相关-------------//
 | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 人员类型统计 告警类型统计 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/26/026 16:42 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: java.lang.String | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getPersonnelTypeCount") | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  |     @ResponseBody | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  |     public ReturnMap getPersonnelTypeCount() throws Exception { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         int userCount = usersService.getUserCount(pageData); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("userCount", userCount); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 告警类型统计 来自人员定位系统 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/26/026 16:43 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getAlarmTypeCount") | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  |     @ResponseBody | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  |     public ReturnMap getAlarmTypeCount() throws Exception { | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("data", PLSUtil.getAlarmTypeCount(Jurisdiction.getCORPINFO_ID())); | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-21 09:04:50 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @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<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class); | 
					
						
							|  |  |  |  |             returnMap.put("varList", list); | 
					
						
							|  |  |  |  |             page.setTotalResult(body.getIntValue("total")); | 
					
						
							|  |  |  |  |             returnMap.put("page", page); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         return returnMap; | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 人员定位情况 来自人员定位系统 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/26/026 16:43 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getPersonnelPositioningCount") | 
					
						
							| 
									
										
										
										
											2024-01-29 10:18:20 +08:00
										 |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getPersonnelPositioningCount(Page page) throws Exception { | 
					
						
							|  |  |  |  |         JSONObject personnelPositioningCount = PLSUtil.getPersonnelPositioningCount(Jurisdiction.getCORPINFO_ID(), page.getCurrentPage(), page.getShowCount()); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("data", personnelPositioningCount); | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-01-30 10:38:22 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 当前在线人员实时位置信息 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getRealTimeList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getRealTimeList() throws Exception { | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  |         return ReturnMap.ok().put("data", PLSUtil.getRealTimeList(Jurisdiction.getCORPINFO_ID())); | 
					
						
							| 
									
										
										
										
											2024-01-30 10:38:22 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 电子围栏信息 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getFenceList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getFenceList() throws Exception { | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  |         return ReturnMap.ok().put("data", PLSUtil.getAreaRegionList(Jurisdiction.getCORPINFO_ID(), 1, 999999)); | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-30 10:38:22 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取八项作业数 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getEightWorks") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getEightWorks() throws Exception { | 
					
						
							|  |  |  |  |         return eightWorkService.getEightWorks(); | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取八项作业数 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getEightWorksByType") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getEightWorksByType() throws Exception { | 
					
						
							|  |  |  |  |         PageData pageData = this.getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("varList", eightWorkService.getEightWorksByType(pageData)); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 09:14:57 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取动火作业 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getHotworkList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getHotworkList() throws Exception { | 
					
						
							|  |  |  |  |         return hotworkService.getMapList(); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取受限空间作业 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getConfinedspaceWorkList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getConfinedspaceWorkList() throws Exception { | 
					
						
							|  |  |  |  |         return confinedspaceService.getMapList(); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取高处作业 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getHighWorkList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getHighWorkList() throws Exception { | 
					
						
							|  |  |  |  |         return highworkService.getMapList(); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     // ----------摄像头相关-------------//
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     // 摄像头告警数 disposed
 | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraTopToShow") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCameraTopToShow() { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         PageData cameraCount = videomanagerService.getCameraTopToShow(pageData); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("pd", cameraCount); | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 摄像头告警数 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/29/029 15:35 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraAlarmCount") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCameraAlarmCount() { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         List<PageData> cameraCount = videomanagerService.getCameraAlarmCount(pageData); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("CameraAlarmCount", cameraCount); | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 摄像头报警类型 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/29/029 10:52 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraAlarmTypeCount") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCameraAlarmTypeCount() { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         List<PageData> cameraCount = videomanagerService.getCameraAlarmTypeCount(pageData); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("varList", cameraCount); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 摄像头告警时间趋势 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/29/029 10:51 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraAlarmTimeCount") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCameraAlarmTimeCount() throws Exception { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         List<Map<String, String>> generateTimeArraySevenMonth = DateUtil.generateTimeArraySevenMonth(6); | 
					
						
							|  |  |  |  |         pageData.put("generateTimeArray", generateTimeArraySevenMonth); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("varList", videomanagerService.getCameraAlarmTimeCount(pageData)); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 摄像头告警来源 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/1/29/029 10:51 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraAlarmSourceCount") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCameraAlarmSourceCount() throws Exception { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							|  |  |  |  |         pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  |         int cameraCount = usersService.getUserCount(pageData); | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("cameraCount", cameraCount); | 
					
						
							| 
									
										
										
										
											2024-02-26 10:34:55 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取轨迹 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCharacterTrajectories") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getCharacterTrajectories() throws Exception { | 
					
						
							|  |  |  |  |         PageData pageData = getPageData(); | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  |         return ReturnMap.ok().put("data", PLSUtil.characterTrajectories(Jurisdiction.getCORPINFO_ID(), Integer.parseInt(pageData.getString("id")), | 
					
						
							|  |  |  |  |                 pageData.getString("startTime"), pageData.getString("endTime"), Integer.parseInt(pageData.getString("type")))); | 
					
						
							| 
									
										
										
										
											2024-02-26 10:34:55 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 获取拥有历史轨迹的全部角色 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: com.zcloud.util.ReturnMap | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getPersonnelTrajectories") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public ReturnMap getPersonnelTrajectories() throws Exception { | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("data", PLSUtil.getPersonnelTrajectories(Jurisdiction.getCORPINFO_ID())); | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  |     // -----------------------//
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     public static List<Map<String, String>> generateTimeArray() { | 
					
						
							|  |  |  |  |         List<Map<String, String>> timeArray = new ArrayList<>(); | 
					
						
							|  |  |  |  |         Calendar calendar = Calendar.getInstance(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         for (int i = 6; i >= 0; i--) { | 
					
						
							|  |  |  |  |             Map<String, String> monthInfo = new HashMap<>(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int year = calendar.get(Calendar.YEAR); | 
					
						
							|  |  |  |  |             int month = calendar.get(Calendar.MONTH) + 1; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  |             String monthString = String.format(year + "-%02d", month); | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |             String firstDayOfMonth = String.format("%04d-%02d-01 00:00:00", year, month); | 
					
						
							|  |  |  |  |             calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); | 
					
						
							|  |  |  |  |             calendar.set(Calendar.HOUR_OF_DAY, 23); | 
					
						
							|  |  |  |  |             calendar.set(Calendar.MINUTE, 59); | 
					
						
							|  |  |  |  |             calendar.set(Calendar.SECOND, 59); | 
					
						
							|  |  |  |  |             String lastDayOfMonth = dateFormat.format(calendar.getTime()); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             monthInfo.put("month", monthString); | 
					
						
							|  |  |  |  |             monthInfo.put("dateBegin", firstDayOfMonth); | 
					
						
							|  |  |  |  |             monthInfo.put("dateEnd", lastDayOfMonth); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             timeArray.add(monthInfo); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             calendar.add(Calendar.MONTH, -1); // Go to the previous month
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         // Reverse the timeArray to have the order from past to present
 | 
					
						
							|  |  |  |  |         Collections.reverse(timeArray); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         return timeArray; | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-03 09:43:34 +08:00
										 |  |  |  |     /** | 
					
						
							|  |  |  |  |      * @Description: 地图获取摄像头 | 
					
						
							|  |  |  |  |      * @Author: dearLin | 
					
						
							|  |  |  |  |      * @Date: 2024/2/1/001 15:43 | 
					
						
							|  |  |  |  |      * @Param: [] [] | 
					
						
							|  |  |  |  |      * @Return: java.lang.Object | 
					
						
							|  |  |  |  |      */ | 
					
						
							|  |  |  |  |     @RequestMapping(value = "/getCameraList") | 
					
						
							|  |  |  |  |     @ResponseBody | 
					
						
							|  |  |  |  |     public Object getCameraList() throws Exception { | 
					
						
							|  |  |  |  |         return ReturnMap.ok().put("varList", videomanagerService.getCameraList(getPageData())); | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-03-01 09:05:45 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-29 17:35:59 +08:00
										 |  |  |  |     public static void main(String[] args) { | 
					
						
							|  |  |  |  |         List<Map<String, String>> timeArray = generateTimeArray(); | 
					
						
							|  |  |  |  |         for (Map<String, String> monthInfo : timeArray) { | 
					
						
							|  |  |  |  |             System.out.println(monthInfo); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-01-27 11:29:26 +08:00
										 |  |  |  | } |