122 lines
3.8 KiB
Java
122 lines
3.8 KiB
Java
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;
|
||
import com.zcloud.service.map.MapKetProjectService;
|
||
import org.apache.commons.lang.StringUtils;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.beans.factory.annotation.Value;
|
||
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/keyProject")
|
||
public class MapKeyProjectController extends BaseController {
|
||
|
||
@Autowired
|
||
private MapKetProjectService mapKetProjectService;
|
||
|
||
@Autowired
|
||
private MapEightService mapEightService;
|
||
|
||
@Value("${cfd.prevention.api.url}")
|
||
private String cfdUrl;
|
||
@Autowired
|
||
private RestTemplate restTemplate;
|
||
|
||
/**
|
||
* 可视化首页统计数据
|
||
* 重点工程开工数量:STATE_COUNT
|
||
* 视频总数:VIDEO_COUNT
|
||
* 安全环保检查总数:CHECK_COUNT
|
||
* 隐患总数:HIDDEN_COUNT
|
||
* 处罚总数:PUNISH_COUNT
|
||
* 处罚金额:AMOUT_SUM
|
||
*
|
||
* @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 = new PageData();
|
||
pd = this.getPageData();
|
||
return mapKetProjectService.findFormCount(pd);
|
||
}
|
||
|
||
/**
|
||
* 隐患处理记录(最新18条)
|
||
*
|
||
* @param
|
||
* @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();
|
||
//根据条件增加参数或减少参数 都没有 直接返回空
|
||
if (StringUtils.isBlank(pd.getString("CORPINFO_ID"))) {
|
||
List<String> ArrayDATA_IDS = mapEightService.getCorpinfoIds(pd);
|
||
if (ArrayDATA_IDS.size() == 0) {
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
pd.put("ids", ArrayDATA_IDS);
|
||
pd.remove("CORPINFO_ID");
|
||
}
|
||
page.setPd(pd);
|
||
return mapKetProjectService.list(page);
|
||
}
|
||
|
||
/**
|
||
* 获取所有数据的位置坐标(有坐标数据) 根据type区分是视频还是工程
|
||
*
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value = "/listAllLocation")
|
||
@ResponseBody
|
||
public Object listAllLocation(@RequestParam(value = "CORPINFO_ID") String CORPINFO_ID, @RequestParam("TYPE") String type, @RequestParam("GANGKOU") String GANGKOU, @RequestParam("AREA") String AREA) throws Exception {
|
||
Map<String, Object> map = new HashMap<String, Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
return mapKetProjectService.listAllLocation(pd);
|
||
}
|
||
|
||
|
||
/**
|
||
* 根据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();
|
||
return mapKetProjectService.getById(pd);
|
||
|
||
}
|
||
|
||
}
|