package com.zcloud.controller.map; import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.czksbimap.CzksBiMapService; import com.zcloud.service.bus.CorpInfoService; import com.zcloud.service.fireresources.CmtFireResourcesService; import com.zcloud.service.gatemachine.GateMachineService; import com.zcloud.service.keyProjects.PlatformvideomanagementService; import com.zcloud.service.keyProjects.VideoManagerService; import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.UsersService; import com.zcloud.util.HttpRequestUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.ReturnMap; import com.zcloud.util.Tools; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; import java.util.*; /** * 说明:实时地图 * 官网:www.zcloudchina.com */ @Controller @RequestMapping("/cmt/map") public class CmtMapController extends BaseController { @Resource private CzksBiMapService biMapService; @Autowired private VideoManagerService videomanagerService; @Autowired private CorpInfoService corpInfoService; @Autowired private PlatformvideomanagementService platformvideomanagementService; @Autowired private UsersService usersService; // @Autowired // private MeteorologicalinfoService meteorologicalinfoService; @Autowired private RestTemplate restTemplate; @Autowired private CmtFireResourcesService fireResourcesService; @Autowired private DepartmentService departmentService; @Autowired private GateMachineService gateMachineService; @RequestMapping("/getPointInfoADeviceByPid") @ResponseBody public Object getPointInfoADeviceByPid() { PageData pd = this.getPageData(); PageData map = fireResourcesService.getPointInfoADeviceByPid(pd); map.put("result", "success"); return map; } @RequestMapping("/getPointQualifiedPhotos") @ResponseBody public Object getPointQualifiedPhotos() { Map map = new HashMap(); PageData pd = this.getPageData(); map.put("result", "success"); map.put("varList", fireResourcesService.getPointQualifiedPhotos(pd)); return map; } /** * @Description: 消防管控 * @Author: dearLin * @Date: 2023/9/20/020 15:30 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping("/getFireControl") @ResponseBody public Object getFireControl() throws Exception { Map map = new HashMap(); PageData pageData = this.getPageData(); LinkedList value = biMapService.getFireControl(pageData); for (PageData data : value) { data.put("MAP_POINT_NAME", data.getString("NAME")); } map.put("result", "success"); map.put("varList", value); return map; } /** * @Description: 消防资源 * @Author: dearLin * @Date: 2023/9/26/026 17:36 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping("/getFireResourceById") @ResponseBody public Object getFireResourceById() throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pddata = this.getPageData(); //获取当前人的公司id PageData pd = fireResourcesService.getDataById(pddata); map.put("pd", pd); map.put("result", errInfo); return map; } /** * @Description: 消防救援队 * @Author: dearLin * @Date: 2023/9/20/020 15:30 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping("/getFireRescueTeam") @ResponseBody public Object getFireRescueTeam() throws Exception { Map map = new HashMap(); PageData pageData = this.getPageData(); LinkedList data = biMapService.getFireRescueTeam(pageData); map.put("result", "success"); map.put("varList", data); return map; } /** * 气象信息对接接口 * * @return * @throws Exception */ // @RequestMapping(value = "/tongMeteorologicalinfoList") // @ResponseBody // public ReturnMap tongMeteorologicalinfoList(@RequestBody List list) throws Exception { // ReturnMap r = new ReturnMap(); // r = meteorologicalinfoService.tongbuMeteorologicalinfo(list); // return r; // } /** * @Description: 闸机设备在线情况 只有人车闸机 * @Author: dearLin * @Date: 2023/9/23/023 9:04 * @Param: * @Return: */ @RequestMapping("/getOnlineGateEquipment") @ResponseBody public ReturnMap getOnlineGateEquipment() { ReturnMap returnMap = new ReturnMap(); PageData pageData = this.getPageData(); PageData value = gateMachineService.getOnlineGateMachine(pageData); returnMap.put("pd", value); return returnMap; } /** * @Description: 闸机位置 * @Author: dearLin * @Date: 2023/9/23/023 9:04 * @Param: * @Return: */ // @RequestMapping("/getGatePosition") // @ResponseBody // public ReturnMap getGatePosition() { // ReturnMap returnMap = new ReturnMap(); // PageData pageData = this.getPageData(); // // // List value = gateMachineService.getGatePosition(pageData); // // 添加标点上的统一的title // for (PageData data : value) { // if (Tools.notEmpty(data.getString("GATE_AREA_NAME"))) { // data.put("MAP_POINT_NAME", data.getString("GATE_AREA_NAME")); // } else { // data.put("MAP_POINT_NAME", data.getString("NAME")); // } // } // returnMap.put("varList", value); // return returnMap; // } /** * @Description: 口门进出记录列表 * @Author: dearLin * @Date: 2023/9/23/023 9:04 * @Param: * @Return: */ @RequestMapping("/getDoorWayRecords") @ResponseBody public ReturnMap getDoorWayRecords(Page page) { ReturnMap returnMap = new ReturnMap(); PageData pageData = this.getPageData(); page.setPd(pageData); if ("0".equals(pageData.getString("INDEX"))) { // 人 List value = biMapService.getDoorWayPeopleRecords(page); returnMap.put("varList", value); return returnMap; } else { // 车 List value = biMapService.getDoorWayCarRecords(page); returnMap.put("varList", value); return returnMap; } } /** * @Description: 闸机进出车、人的数量 * @Author: dearLin * @Date: 2023/9/23/023 9:04 * @Param: * @Return: */ @RequestMapping("/getGatesInAndOutNumById") @ResponseBody public ReturnMap getGatesInAndOutNumById(Page page) { ReturnMap returnMap = new ReturnMap(); page.setCurrentPage(1); page.setShowCount(999); page.setPd(this.getPageData()); returnMap.put("data", biMapService.getGatesInAndOutNumById(page).get("data")); return returnMap; } /** * 人员进出记录列表 * * @return */ @RequestMapping("/getGatesInAndOutListById") @ResponseBody public ReturnMap getGatesInAndOutListById(Page page) { ReturnMap returnMap = new ReturnMap(); PageData pd = this.getPageData(); page.setPd(pd); List recordAllList = gateMachineService.getPersonRecordListAllByEId(page); returnMap.put("recordAllList", recordAllList); return returnMap; } @RequestMapping(value = "/fireResource/list") @ResponseBody public Object page(Page page) { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); //获取当前人的公司id page.setPd(pd); List varList = fireResourcesService.datalistPage(page); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; } @RequestMapping(value = "/fireDevice/listByMap") @ResponseBody public Object devicelistByMap(Page page) { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); String corpinfoId = Jurisdiction.getCORPINFO_ID(); pd.put("CORPINFO_ID", corpinfoId); //获取当前人的公司id page.setPd(pd); List varList = fireResourcesService.devicelistPage(page); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; } @RequestMapping(value = "/fireDevice/listAllDeviceForMap") @ResponseBody public Object listAllDeviceForMap(Page page) { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); String corpinfoId = Jurisdiction.getCORPINFO_ID(); pd.put("CORPINFO_ID", corpinfoId); //获取当前人的公司id page.setPd(pd); List varList = fireResourcesService.deviceAlllistPage(page); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; } /** * 获取人员、车辆进出记录 * * @param * @return */ @RequestMapping(value = "/getPerpleCarGateMachineCount") @ResponseBody public Object getPerpleCarGateMachineCount() { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); map.put("result", errInfo); return map; } @RequestMapping(value = "/getMachineTodayInOutCount") @ResponseBody public Object getMachineTodayInOutCount() { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); List value = gateMachineService.getTodayInOutCount(pd); map.put("varList", value); map.put("result", errInfo); return map; } @RequestMapping("/getGatePosition") @ResponseBody public ReturnMap getCzksGatePosition() { ReturnMap returnMap = new ReturnMap(); PageData pageData = this.getPageData(); // pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); List value = gateMachineService.getGatePosition(pageData); // 添加标点上的统一的title for (PageData data : value) { if (Tools.notEmpty(data.getString("GATE_AREA_NAME"))) { data.put("MAP_POINT_NAME", data.getString("GATE_AREA_NAME")); } else { data.put("MAP_POINT_NAME", data.getString("NAME")); } } returnMap.put("varList", value); return returnMap; } /** * @Description: 人员定位信息 * @Author: dearLin * @Date: 2024/1/6/006 17:33 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping(value = "person/allPerson/listPage") @ResponseBody public Object getCmtOnlinePersion() throws Exception { ReturnMap online = new ReturnMap(); PageData pageData = this.getPageData(); JSONObject request = new JSONObject(); request.put("pageNum", 1); request.put("pageSize", 10); request.put("online", "true"); pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 系统人员数 int userCount = usersService.getUserCount(pageData); // 系统部门数 int departCount = departmentService.getDepartmentCount(pageData); online.put("userCount",userCount); online.put("departCount",departCount); return online; } /** * @Description: 获取摄像头定位 * @Author: dearLin * @Date: 2024/1/6/006 11:15 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping(value = "/getCameraPositioning") @ResponseBody public Object getCameraPositioning() { ReturnMap returnMap = new ReturnMap(); PageData pageData = new PageData(); pageData.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); List dataList = platformvideomanagementService.listAllForMap(pageData); returnMap.put("varList",dataList); return returnMap; } /** * @Description: 设备在线情况 * @Author: dearLin * @Date: 2024/1/6/006 11:15 * @Param: [] [] * @Return: java.lang.Object */ @RequestMapping(value = "/getListMapSluiceCount") @ResponseBody public Object getListMapSluiceCount() { ReturnMap returnMap = new ReturnMap(); PageData pageData = new PageData(); pageData.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); List dataList = platformvideomanagementService.getListMapSluiceCount(pageData); returnMap.put("varList",dataList); return returnMap; } /** * 沧州矿石人员定位结束 定位基础信息 */ /** * 获取人员、车辆进出记录 * * @param * @return */ @RequestMapping(value = "/getCurrentLocationOnline") @ResponseBody public Object getCurrentLocationOnline() { Map map = new HashMap(); String errInfo = "success"; map.put("result", errInfo); return map; } // 获取人员定位信息 根据定位卡(身份证)编码 @RequestMapping(value = "/getPersonByCardNo") @ResponseBody public Object getPersonByCardNo() throws Exception { Map map = new HashMap(); PageData pd = this.getPageData(); PageData value = usersService.getPersonByCardNo(pd); map.put("result", "success"); map.put("pd", value); return map; } /** * 获取摄像头播放路径(曹妃甸使用) * * @throws Exception */ @RequestMapping(value = "/getHlsPath") @ResponseBody public Object getHlsPath() throws Exception { Map map = new HashMap(); return map; } /** * 查询人员在线及统计数据(曹妃甸使用) * * @throws Exception */ @RequestMapping(value = "/getCurrentPersonnelData") @ResponseBody public Object getCurrentPersonnelData() throws Exception { Map map = new HashMap(); PageData pd = this.getPageData(); return map; } @RequestMapping("/getUserMapInfo") @ResponseBody public ReturnMap getUserMapInfo() throws Exception { PageData pd = this.getPageData(); pd = usersService.findByCardNo(pd); //列出HotWorkApplicationDelayed列表 ReturnMap r = ReturnMap.ok(); r.put("pd", pd); return r; } /** * 返回一个空的分页 * * @param * @throws Exception */ @RequestMapping(value = "/zeroList") @ResponseBody public Object listHighRiskWork(Page page) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); page.setPd(pd); map.put("varList",new ArrayList<>()); map.put("result", errInfo); return map; } }