140 lines
4.0 KiB
Java
140 lines
4.0 KiB
Java
package com.zcloud.controller.app;
|
||
|
||
import java.util.ArrayList;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
import com.zcloud.aspect.DockAnnotation;
|
||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.stereotype.Controller;
|
||
import org.springframework.transaction.annotation.Transactional;
|
||
import org.springframework.web.bind.annotation.RequestMapping;
|
||
import org.springframework.web.bind.annotation.ResponseBody;
|
||
|
||
import com.alibaba.fastjson.JSON;
|
||
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.bus.IdentificationPartsService;
|
||
import com.zcloud.service.bus.RiskPointService;
|
||
import com.zcloud.service.bus.RiskUnitService;
|
||
import com.zcloud.util.Jurisdiction;
|
||
import com.zcloud.util.Tools;
|
||
|
||
import net.sf.json.JSONArray;
|
||
/**
|
||
* 说明:手机端风险点台账
|
||
* 作者:郭跃鹏
|
||
* 时间:2021年1月8日
|
||
* 官网:www.zcloudchina.com
|
||
*/
|
||
@Controller
|
||
@RequestMapping("/app/riskpoint")
|
||
public class AppRiskPointController extends BaseController{
|
||
@Autowired
|
||
private RiskPointService riskpointService;
|
||
@Autowired
|
||
private IdentificationPartsService identificationpartsService;
|
||
@Autowired
|
||
private RiskUnitService riskunitService;
|
||
/**列表
|
||
* @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();
|
||
String pdNameLiskes = pd.getString("pdNameLiskes"); //关键词检索条件
|
||
if(Tools.notEmpty(pdNameLiskes)) {
|
||
pd.put("NameLiskes",pdNameLiskes);
|
||
}
|
||
pd.put("CORPINFO_ID",pd.getString("CORPINFOID"));
|
||
page.setPd(pd);
|
||
List<PageData> varList = identificationpartsService.list(page); //列出RiskPoint列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
/** 详情获取数据
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/getPdForId")
|
||
@ResponseBody
|
||
public Object getPdForId() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
//根基ID获取数据
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
pd = riskpointService.findById(pd); //根据ID读取
|
||
map.put("pd", pd);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**修改
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/editLonAndLat")
|
||
@ResponseBody
|
||
@DockAnnotation
|
||
public Object edit() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
PageData id = identificationpartsService.findById(pd);
|
||
id.put("LONGITUDE", pd.get("LONGITUDE"));
|
||
id.put("LATITUDE", pd.get("LATITUDE"));
|
||
identificationpartsService.edit(pd);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**获取风险单元下拉框选项
|
||
* @param page
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listUnit")
|
||
@ResponseBody
|
||
public Object getPointSelect() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
|
||
List<PageData> unitList = riskunitService.listAll(pd);
|
||
map.put("unitList", unitList);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**根据部位获取所有风险点
|
||
* @param page
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/getForIdentification")
|
||
@ResponseBody
|
||
public Object getForIdentification() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
|
||
List<PageData> varList = riskpointService.listAll(pd);
|
||
map.put("varList", varList);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
}
|