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

212 lines
6.5 KiB
Java
Raw Normal View History

2024-01-15 18:28:47 +08:00
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.map.MapEightService;
2024-01-17 14:05:11 +08:00
import com.zcloud.service.system.UsersService;
import com.zcloud.util.Jurisdiction;
2024-01-15 18:28:47 +08:00
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 org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/map/Eight")
public class MapEightController extends BaseController {
@Autowired
private MapEightService mapEightService;
2024-01-17 14:05:11 +08:00
@Autowired
private UsersService usersService;
2024-01-15 18:28:47 +08:00
@Autowired
private RestTemplate restTemplate;
/**
* @return
* @throws Exception
*/
@RequestMapping(value = "/getEcharts")
@ResponseBody
public Object getEcharts() throws Exception {
2024-01-17 14:05:11 +08:00
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
return mapEightService.getEchartsOrder(pd);
2024-01-15 18:28:47 +08:00
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/findFormCount")
@ResponseBody
public Object findFormCount() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
2024-01-17 14:05:11 +08:00
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
PageData data = mapEightService.statisticsHighRiskWorkByStateOrder(pd);
map.put("pd", data);
2024-01-15 18:28:47 +08:00
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
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";
2024-01-17 14:05:11 +08:00
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
2024-01-15 18:28:47 +08:00
page.setPd(pd);
2024-01-17 14:05:11 +08:00
List<PageData> varList = mapEightService.listHighRiskWorkOrder(page);
2024-01-15 18:28:47 +08:00
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listAllHighRiskWorkLocation")
@ResponseBody
2024-01-17 14:05:11 +08:00
public Object listAllHighRiskWorkLocation() throws Exception {
2024-01-15 18:28:47 +08:00
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
2024-01-17 14:05:11 +08:00
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
List<PageData> varList;
if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6", pd.getString("CORPINFO_ID"))) { //一公司
2024-01-15 18:28:47 +08:00
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();
2024-01-17 14:05:11 +08:00
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
2024-01-15 18:28:47 +08:00
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();
2024-01-17 14:05:11 +08:00
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
2024-01-15 18:28:47 +08:00
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();
2024-01-17 14:05:11 +08:00
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
2024-01-15 18:28:47 +08:00
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();
2024-01-17 14:05:11 +08:00
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
2024-01-15 18:28:47 +08:00
List<PageData> varList = mapEightService.listAllMeasures(pd); //根据ID读取
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
2024-01-17 14:05:11 +08:00
*
*
* @param
* @throws Exception
2024-01-15 18:28:47 +08:00
*/
2024-01-17 14:05:11 +08:00
@RequestMapping(value = "/findEightsByUserCardNo")
2024-01-15 18:28:47 +08:00
@ResponseBody
2024-01-17 14:05:11 +08:00
public Object findEightsByUserId() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData byCardNo = usersService.findByCardNo(pd);
map.put("INFO", byCardNo);
map.put("result", errInfo);
return map;
2024-01-15 18:28:47 +08:00
}
}