qa-prevention-gwj/src/main/java/com/zcloud/controller/map/CmtMapController.java

512 lines
16 KiB
Java
Raw Normal View History

2024-02-06 11:02:25 +08:00
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.*;
2024-02-06 11:02:25 +08:00
/**
*
* 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<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
PageData pageData = this.getPageData();
LinkedList<PageData> 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<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
PageData pageData = this.getPageData();
LinkedList<PageData> 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<PageData> 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<PageData> 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<PageData> value = biMapService.getDoorWayPeopleRecords(page);
returnMap.put("varList", value);
return returnMap;
} else {
// 车
List<PageData> 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
2024-03-08 15:07:11 +08:00
public ReturnMap getGatesInAndOutNumById(Page page) {
2024-02-06 11:02:25 +08:00
ReturnMap returnMap = new ReturnMap();
2024-03-08 15:07:11 +08:00
page.setCurrentPage(1);
page.setShowCount(999);
page.setPd(this.getPageData());
returnMap.put("data", biMapService.getGatesInAndOutNumById(page).get("data"));
2024-02-06 11:02:25 +08:00
return returnMap;
}
/**
*
*
* @return
*/
@RequestMapping("/getGatesInAndOutListById")
@ResponseBody
public ReturnMap getGatesInAndOutListById(Page page) {
ReturnMap returnMap = new ReturnMap();
PageData pd = this.getPageData();
page.setPd(pd);
List<PageData> recordAllList = gateMachineService.getPersonRecordListAllByEId(page);
returnMap.put("recordAllList", recordAllList);
return returnMap;
}
@RequestMapping(value = "/fireResource/list")
@ResponseBody
public Object page(Page page) {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
//获取当前人的公司id
page.setPd(pd);
List<PageData> 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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String corpinfoId = Jurisdiction.getCORPINFO_ID();
pd.put("CORPINFO_ID", corpinfoId);
//获取当前人的公司id
page.setPd(pd);
List<PageData> 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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String corpinfoId = Jurisdiction.getCORPINFO_ID();
pd.put("CORPINFO_ID", corpinfoId);
//获取当前人的公司id
page.setPd(pd);
List<PageData> varList = fireResourcesService.deviceAlllistPage(page);
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
2024-02-06 11:02:25 +08:00
/**
*
*
* @param
* @return
*/
@RequestMapping(value = "/getPerpleCarGateMachineCount")
@ResponseBody
public Object getPerpleCarGateMachineCount() {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/getMachineTodayInOutCount")
@ResponseBody
public Object getMachineTodayInOutCount() {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> 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<PageData> 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<PageData> 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<PageData> dataList = platformvideomanagementService.getListMapSluiceCount(pageData);
returnMap.put("varList",dataList);
return returnMap;
}
/**
*
*/
/**
*
*
* @param
* @return
*/
@RequestMapping(value = "/getCurrentLocationOnline")
@ResponseBody
public Object getCurrentLocationOnline() {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
map.put("result", errInfo);
return map;
}
// 获取人员定位信息 根据定位卡(身份证)编码
@RequestMapping(value = "/getPersonByCardNo")
@ResponseBody
public Object getPersonByCardNo() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
return map;
}
/**
* 线(使
*
* @throws Exception
*/
@RequestMapping(value = "/getCurrentPersonnelData")
@ResponseBody
public Object getCurrentPersonnelData() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
page.setPd(pd);
map.put("varList",new ArrayList<>());
map.put("result", errInfo);
return map;
}
2024-02-06 11:02:25 +08:00
}