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

186 lines
5.7 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.controller.map;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.czksbimap.CzksMapEightService;
import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang.StringUtils;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 说明:实时地图八项工作内容
* 官网www.zcloudchina.com
*/
@Controller
@RequestMapping("/czks/map/Eight")
public class CmtMapEightController extends BaseController {
@Autowired
private CzksMapEightService mapEightService;
/**
* @return
* @throws Exception
*/
@RequestMapping(value = "/getEcharts")
@ResponseBody
public Object getEcharts() throws Exception {
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
return mapEightService.getEchartsOrder(pd);
}
/**
* 可视化首页统计数据
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/findFormCount")
@ResponseBody
public Object findFormCount() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
PageData data = mapEightService.statisticsHighRiskWorkByStateOrder(pd);
map.put("pd", data);
map.put("result", errInfo);
return map;
}
/**
* 作业实时情况展示最新18条
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listHighRiskWork")
@ResponseBody
public Object listHighRiskWork(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
page.setPd(pd);
List<PageData> varList = mapEightService.listHighRiskWorkOrder(page);
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
* 获取所有高危作业的位置坐标(有坐标数据)
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listAllHighRiskWorkLocation")
@ResponseBody
public Object listAllHighRiskWorkLocation() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
List<PageData> varList;
if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6", pd.getString("CORPINFO_ID"))) { //一公司
varList = mapEightService.listAllHighRiskWorkLocation(pd);
} else {
varList = mapEightService.listAllHighRiskWorkLocationOrder(pd);
}
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
* 根据id以及类型获取数据 一公司
*
* @param id 数据id
* @param type 数据类型 动火 等等
* @return
*/
@RequestMapping(value = "/getById")
@ResponseBody
public Object getById(@RequestParam(value = "id") String id, @RequestParam("TYPE") String type) throws Exception {
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
return mapEightService.getById(pd);
}
/**
* 根据id以及类型获取数据 其他公司
*
* @param id 数据id
* @param type 数据类型 动火 等等
* @return
*/
@RequestMapping(value = "/getByIdOrder")
@ResponseBody
public Object getByIdOrder(@RequestParam(value = "id") String id, @RequestParam("TYPE") String type) throws Exception {
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
return mapEightService.getByIdOrder(pd);
}
/**
* 列表
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/list")
@ResponseBody
public Object list(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
List<PageData> varList = mapEightService.listAll(pd); //列出HotWorkApplicationDelayed列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* 获取动火防护措施
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listAllMeasures")
@ResponseBody
public Object listAllMeasures() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
List<PageData> varList = mapEightService.listAllMeasures(pd); //根据ID读取
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
}