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

122 lines
3.8 KiB
Java
Raw Normal View History

2024-01-29 08:43:41 +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;
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);
}
}