291 lines
9.2 KiB
Java
291 lines
9.2 KiB
Java
package com.zcloud.controller.keyProjects.app;
|
||
|
||
import com.alibaba.fastjson.JSON;
|
||
import com.zcloud.aspect.DockAnnotation;
|
||
import com.zcloud.controller.base.BaseController;
|
||
import com.zcloud.entity.Page;
|
||
import com.zcloud.entity.PageData;
|
||
import com.zcloud.service.keyProjects.OutSourcedService;
|
||
import com.zcloud.service.keyProjects.PersonnelManagementService;
|
||
import com.zcloud.service.keyProjects.UnitsService;
|
||
import com.zcloud.service.keyProjects.VideoManagerService;
|
||
import com.zcloud.service.system.DictionariesService;
|
||
import com.zcloud.util.Jurisdiction;
|
||
import com.zcloud.util.Tools;
|
||
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.ResponseBody;
|
||
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
/**
|
||
* 说明:相关方管理
|
||
* 作者:luoxiaobao
|
||
* 时间:2022-06-07
|
||
* 官网:www.zcloudchina.com
|
||
*/
|
||
@Controller
|
||
@RequestMapping("/app/keyProjects")
|
||
public class AppKeyProjectsController extends BaseController {
|
||
|
||
@Autowired
|
||
private UnitsService unitsService;
|
||
@Autowired
|
||
private OutSourcedService outsourcedService;
|
||
@Autowired
|
||
private DictionariesService dictionariesService;
|
||
@Autowired
|
||
private PersonnelManagementService personnelmanagementService;
|
||
|
||
@Autowired
|
||
private VideoManagerService videomanagerService;
|
||
|
||
/**列表
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listAllUnits")
|
||
@ResponseBody
|
||
public Object listAllUnits() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
List<PageData> varList = unitsService.listAll(pd); //列出PersonnelManagement列表
|
||
map.put("varList", varList);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**列表
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listOutsourced")
|
||
@ResponseBody
|
||
public Object listOutsourced(Page page) throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||
String UserId = pd.getString("UserId");
|
||
if(!StringUtils.equals("1",UserId)){
|
||
String CORPINFO_ID = pd.getString("CORPINFO_ID");
|
||
// -- 河港机械 河港港工 河港检测
|
||
if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676")
|
||
&&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&&
|
||
!StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5")
|
||
&&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){
|
||
pd.put("DeptId",outsourcedService.getDeptId(UserId));
|
||
pd.put("UserId",UserId);
|
||
|
||
}
|
||
}
|
||
page.setPd(pd);
|
||
List<PageData> varList = outsourcedService.list(page); //列出OutSourced列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**列表
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listAllOutsourced")
|
||
@ResponseBody
|
||
public Object listAllOutsourced() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
List<PageData> varList = outsourcedService.listAll(pd); //列出PersonnelManagement列表
|
||
map.put("varList", varList);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
|
||
/**列表
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listAllPersonnel")
|
||
@ResponseBody
|
||
public Object listAllPersonnel() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
List<PageData> varList = personnelmanagementService.listAll(pd); //列出PersonnelManagement列表
|
||
map.put("varList", varList);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**去修改页面获取数据
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/goEdit")
|
||
@ResponseBody
|
||
public Object goEdit() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
pd = personnelmanagementService.findByOutsourced(pd); //根据ID读取
|
||
map.put("pd", pd);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**处罚管理列表 查询自己可以处罚的重点工程 角标计算逻辑 查询重点工程中所有处罚未选择是否处罚的隐患累加
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/getPUNISHlist")
|
||
@ResponseBody
|
||
public Object getPUNISHlist(Page page) throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||
page.setPd(pd);
|
||
List<PageData> varList = outsourcedService.getPUNISHlist(page); //列出OutSourced列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
|
||
/** 隐患列表 查询进行中的重点工程以及排序
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/listHiddenOutsourced")
|
||
@ResponseBody
|
||
public Object listHiddenOutsourced(Page page) throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||
String UserId = pd.getString("UserId");
|
||
if(!StringUtils.equals("1",UserId)){
|
||
String CORPINFO_ID = pd.getString("CORPINFO_ID");
|
||
// -- 河港机械 河港港工 河港检测
|
||
if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676")
|
||
&&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&&
|
||
!StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5")
|
||
&&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){
|
||
pd.put("DeptId",outsourcedService.getDeptId(UserId));
|
||
pd.put("UserId",UserId);
|
||
|
||
}
|
||
}
|
||
page.setPd(pd);
|
||
List<PageData> varList = outsourcedService.listHiddenOutsourced(page); //列出OutSourced列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**列表
|
||
* @param page
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/videomanagerList")
|
||
@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();
|
||
page.setPd(pd);
|
||
List<PageData> varList = videomanagerService.listApp(page); //列出VideoManager列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
|
||
/**去修改页面获取数据
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/getOutsourced")
|
||
@ResponseBody
|
||
public Object getOutsourced() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
pd = outsourcedService.findById(pd); //根据ID读取
|
||
map.put("pd", pd);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
/** 修改工程状态
|
||
* @param
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/updateState")
|
||
@ResponseBody
|
||
@DockAnnotation
|
||
public Object updateState() throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
outsourcedService.updateState(pd); //获取同时绑定的重点工程信息如果大于1表示还有其他重点工程
|
||
map.put("result", errInfo);
|
||
map.put("dockData", JSON.toJSONString(pd));
|
||
return map;
|
||
}
|
||
|
||
/**列表
|
||
* @throws Exception
|
||
*/
|
||
@RequestMapping(value="/outSouceslistPage")
|
||
@ResponseBody
|
||
public Object outSouceslistPage(Page page) throws Exception{
|
||
Map<String,Object> map = new HashMap<String,Object>();
|
||
String errInfo = "success";
|
||
PageData pd = new PageData();
|
||
pd = this.getPageData();
|
||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||
String UserId = pd.getString("UserId");
|
||
if(!StringUtils.equals("1",UserId)){
|
||
String CORPINFO_ID = pd.getString("CORPINFO_ID");
|
||
// -- 河港机械 河港港工 河港检测
|
||
if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676")
|
||
&&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&&
|
||
!StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5")
|
||
&&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){
|
||
pd.put("DeptId",outsourcedService.getDeptId(UserId));
|
||
pd.put("UserId",UserId);
|
||
|
||
}
|
||
}
|
||
page.setPd(pd);
|
||
List<PageData> varList = outsourcedService.outSouceslistPage(page); //列出OutSourced列表
|
||
map.put("varList", varList);
|
||
map.put("page", page);
|
||
map.put("result", errInfo);
|
||
return map;
|
||
}
|
||
|
||
|
||
|
||
}
|