qa-prevention-gwj/src/main/java/com/zcloud/controller/gf/GFHotworkController.java

314 lines
12 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.controller.gf;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.gf.*;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ObjectExcelView;
import com.zcloud.util.Tools;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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 org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 说明:动火作业
* 作者luoxiaobao
* 时间2021-09-18
* 官网www.zcloudchina.com
*/
@Controller
@RequestMapping("/gfHotWork")
public class GFHotworkController extends BaseController {
@Resource
private GFHotworkService GFhotworkService;
@Autowired
private GFHotworkGasService GFhotworkGasService;
@Autowired
private GFHotworkAcceptUserService hotworkacceptuserService;
/**新增
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@RequiresPermissions("hotwork:add")
@ResponseBody
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("HOTWORK_ID", this.get32UUID()); //主键
GFhotworkService.save(pd);
map.put("result", errInfo);
return map;
}
/**删除
* @throws Exception
*/
@RequestMapping(value="/delete")
@RequiresPermissions("hotwork:del")
@ResponseBody
public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
GFhotworkService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**修改
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@RequiresPermissions("hotwork:edit")
@ResponseBody
public Object edit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
GFhotworkService.edit(pd);
map.put("result", errInfo);
return map;
}
/**列表
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@RequiresPermissions("hotwork: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 KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
pd.put("ISMAIN", Jurisdiction.getIS_MAIN());
pd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE());
pd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID());
String DEPTIDS = pd.getString("DEPTIDS");
if(Tools.notEmpty(DEPTIDS)) {
String DEPT_IDS[] = DEPTIDS.split(",");
pd.put("DEPT_IDS", DEPT_IDS);
}
page.setPd(pd);
List<PageData> varList = GFhotworkService.list(page); //列出Hotwork列表
map.put("varList", varList);
map.put("page", page);
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 = GFhotworkService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("measuresList", GFhotworkService.listAllMeasures(pd));
map.put("gasList", GFhotworkGasService.listAll(pd));
map.put("imgList",hotworkacceptuserService.findByIds(pd));
map.put("imgList1",hotworkacceptuserService.findById(pd));
map.put("result", errInfo);
return map;
}
/**批量删除
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAll")
@RequiresPermissions("hotwork:del")
@ResponseBody
public Object deleteAll() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String ArrayDATA_IDS[] = DATA_IDS.split(",");
GFhotworkService.deleteAll(ArrayDATA_IDS);
errInfo = "success";
}else{
errInfo = "error";
}
map.put("result", errInfo); //返回结果
return map;
}
/**导出到excel
* @param
* @throws Exception
*/
@RequestMapping(value="/excel")
@RequiresPermissions("toExcel")
public ModelAndView exportExcel() throws Exception{
ModelAndView mv = new ModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
Map<String,Object> dataMap = new HashMap<String,Object>();
List<String> titles = new ArrayList<String>();
titles.add("所属企业"); //1
titles.add("删除标志"); //2
titles.add("创建时间"); //3
titles.add("添加人"); //4
titles.add("修改时间"); //5
titles.add("修改人"); //6
titles.add("编号"); //7
titles.add("作业内容"); //8
titles.add("工作开始时间"); //9
titles.add("工作结束时间"); //10
titles.add("确认单位"); //11
titles.add("确认单位人"); //12
titles.add("确认单位签字"); //13
titles.add("确认单位签字时间"); //14
titles.add("审核部门"); //15
titles.add("审核人"); //16
titles.add("审核签字"); //17
titles.add("审核签字时间"); //18
titles.add("审批部门"); //19
titles.add("审批部门人"); //20
titles.add("审批部门签字"); //21
titles.add("审批部门签字时间"); //22
titles.add("状态"); //23
titles.add("确认意见"); //24
titles.add("审核意见"); //25
titles.add("审批意见"); //26
titles.add("其他防护措施"); //27
titles.add("验收部门"); //28
titles.add("验收人"); //29
titles.add("验收签字"); //30
titles.add("验收签字时间"); //31
titles.add("验收意见"); //32
titles.add("申请部门"); //33
titles.add("申请人"); //34
titles.add("动火地点"); //35
titles.add("作业级别"); //36
titles.add("作业人"); //37
titles.add("特殊作业"); //38
titles.add("风险辨识"); //39
titles.add("作业负责人"); //40
titles.add("分析部门"); //41
titles.add("分析人"); //42
titles.add("监护人部门"); //43
titles.add("监护人"); //44
titles.add("监护人签字"); //45
titles.add("监护人签字时间"); //46
titles.add("监护人意见"); //47
titles.add("动火点车间"); //48
titles.add("动火点车间负责人"); //49
titles.add("车间负责人签字"); //50
titles.add("车间负责人签字时间"); //51
titles.add("车间负责人意见"); //52
titles.add("班长部门"); //53
titles.add("班长"); //54
titles.add("班长签字"); //55
titles.add("班长签字时间"); //56
titles.add("班长意见"); //57
titles.add("交底人"); //58
titles.add("教育人"); //59
titles.add("接受教育人"); //60
titles.add("初审人"); //61
dataMap.put("titles", titles);
List<PageData> varOList = GFhotworkService.listAll(pd);
List<PageData> varList = new ArrayList<PageData>();
for(int i=0;i<varOList.size();i++){
PageData vpd = new PageData();
vpd.put("var1", varOList.get(i).getString("CORPINFO_ID")); //1
vpd.put("var2", varOList.get(i).get("ISDELETE").toString()); //2
vpd.put("var3", varOList.get(i).getString("CREATTIME")); //3
vpd.put("var4", varOList.get(i).getString("CREATOR")); //4
vpd.put("var5", varOList.get(i).getString("OPERATTIME")); //5
vpd.put("var6", varOList.get(i).getString("OPERATOR")); //6
vpd.put("var7", varOList.get(i).getString("CHECK_NO")); //7
vpd.put("var8", varOList.get(i).getString("WORK_CONTENT")); //8
vpd.put("var9", varOList.get(i).getString("WORK_START_DATE")); //9
vpd.put("var10", varOList.get(i).getString("WORK_END_DATE")); //10
vpd.put("var11", varOList.get(i).getString("CONFIRM_DEPARTMENT_ID")); //11
vpd.put("var12", varOList.get(i).getString("CONFIRM_USER_ID")); //12
vpd.put("var13", varOList.get(i).getString("CONFIRM_USER_SIGNER_PATH")); //13
vpd.put("var14", varOList.get(i).getString("CONFIRM_USER_SIGNER_TIME")); //14
vpd.put("var15", varOList.get(i).getString("AUDIT_DEPARTMENT_ID")); //15
vpd.put("var16", varOList.get(i).getString("AUDIT_USER_ID")); //16
vpd.put("var17", varOList.get(i).getString("AUDIT_USER_SIGNER_PATH")); //17
vpd.put("var18", varOList.get(i).getString("AUDIT_USER_SIGNER_TIME")); //18
vpd.put("var19", varOList.get(i).getString("APPROVE_DEPARTMENT_ID")); //19
vpd.put("var20", varOList.get(i).getString("APPROVE_USER_ID")); //20
vpd.put("var21", varOList.get(i).getString("APPROVE_USER_SIGNER_PATH")); //21
vpd.put("var22", varOList.get(i).getString("APPROVE_USER_SIGNER_TIME")); //22
vpd.put("var23", varOList.get(i).getString("APPLY_STATUS")); //23
vpd.put("var24", varOList.get(i).getString("CONFIRM_CONTENT")); //24
vpd.put("var25", varOList.get(i).getString("AUDIT_CONTENT")); //25
vpd.put("var26", varOList.get(i).getString("APPROVE_CONTENT")); //26
vpd.put("var27", varOList.get(i).getString("OTHER_PROTECTIVE_MEASURES")); //27
vpd.put("var28", varOList.get(i).getString("ACCEPT_DEPARTMENT_ID")); //28
vpd.put("var29", varOList.get(i).getString("ACCEPT_USER_ID")); //29
vpd.put("var30", varOList.get(i).getString("ACCEPT_USER_SIGNER_PATH")); //30
vpd.put("var31", varOList.get(i).getString("ACCEPT_USER_SIGNER_TIME")); //31
vpd.put("var32", varOList.get(i).getString("ACCEPT_CONTENT")); //32
vpd.put("var33", varOList.get(i).getString("APPLY_DEPARTMENT_ID")); //33
vpd.put("var34", varOList.get(i).getString("APPLY_USER_ID")); //34
vpd.put("var35", varOList.get(i).getString("WORK_PLACE")); //35
vpd.put("var36", varOList.get(i).getString("WORK_LEVEL")); //36
vpd.put("var37", varOList.get(i).getString("WORK_USER")); //37
vpd.put("var38", varOList.get(i).getString("SPECIAL_WORK")); //38
vpd.put("var39", varOList.get(i).getString("RISK_IDENTIFICATION")); //39
vpd.put("var40", varOList.get(i).getString("WORK_MANAGER")); //40
vpd.put("var41", varOList.get(i).getString("ANALYZE_DEPARTMENT_ID")); //41
vpd.put("var42", varOList.get(i).getString("ANALYZE_USER_ID")); //42
vpd.put("var43", varOList.get(i).getString("GUARDIAN_DEPARTMENT_ID")); //43
vpd.put("var44", varOList.get(i).getString("GUARDIAN_USER_ID")); //44
vpd.put("var45", varOList.get(i).getString("GUARDIAN_USER_SIGNER_PATH")); //45
vpd.put("var46", varOList.get(i).getString("GUARDIAN_USER_SIGNER_TIME")); //46
vpd.put("var47", varOList.get(i).getString("GUARDIAN_CONTENT")); //47
vpd.put("var48", varOList.get(i).getString("LEADER_DEPARTMENT_ID")); //48
vpd.put("var49", varOList.get(i).getString("LEADER_USER_ID")); //49
vpd.put("var50", varOList.get(i).getString("LEADER_USER_SIGNER_PATH")); //50
vpd.put("var51", varOList.get(i).getString("LEADER_USER_SIGNER_TIME")); //51
vpd.put("var52", varOList.get(i).getString("LEADER_CONTENT")); //52
vpd.put("var53", varOList.get(i).getString("MONITOR_DEPARTMENT_ID")); //53
vpd.put("var54", varOList.get(i).getString("MONITOR_USER_ID")); //54
vpd.put("var55", varOList.get(i).getString("MONITOR_USER_SIGNER_PATH")); //55
vpd.put("var56", varOList.get(i).getString("MONITOR_USER_SIGNER_TIME")); //56
vpd.put("var57", varOList.get(i).getString("MONITOR_CONTENT")); //57
vpd.put("var58", varOList.get(i).getString("CONFESS_USER")); //58
vpd.put("var59", varOList.get(i).getString("EDUCATE_USER")); //59
vpd.put("var60", varOList.get(i).getString("ACCEPT_EDUCATE_USER")); //60
vpd.put("var61", varOList.get(i).getString("TRIAL_USER")); //61
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
return mv;
}
}