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

271 lines
9.9 KiB
Java
Raw Normal View History

2024-02-06 11:02:25 +08:00
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.GFBlindBoardAcceptUserService;
import com.zcloud.service.gf.GFBlindBoardInfoService;
import com.zcloud.service.gf.GFBlindBoardService;
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-08-23
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/gfBlindBoard")
public class GFBlindBoardController extends BaseController {
@Resource
private GFBlindBoardService GFblindboardService;
@Autowired
private GFBlindBoardInfoService GFblindBoardInfoService;
@Autowired
private GFBlindBoardAcceptUserService blindboardacceptuserService;
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@RequiresPermissions("blindboard: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("BLINDBOARD_ID", this.get32UUID()); //主键
GFblindboardService.save(pd);
map.put("result", errInfo);
return map;
}
/**
* @throws Exception
*/
@RequestMapping(value="/delete")
@RequiresPermissions("blindboard: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();
GFblindboardService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@RequiresPermissions("blindboard: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();
GFblindboardService.edit(pd);
map.put("result", errInfo);
return map;
}
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@RequiresPermissions("blindboard: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);
}
2024-12-13 17:53:34 +08:00
String STARTTIME = pd.getString("STARTTIME"); // 关键词检索条件
if (Tools.notEmpty(STARTTIME))
pd.put("STARTTIME", STARTTIME.trim());
String ENDTIME = pd.getString("ENDTIME"); // 关键词检索条件
if (Tools.notEmpty(ENDTIME))
pd.put("ENDTIME", ENDTIME + " 23:59:59");
2024-02-06 11:02:25 +08:00
page.setPd(pd);
List<PageData> varList = GFblindboardService.list(page); //列出BlindBoard列表
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 = GFblindboardService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("measuresList", GFblindboardService.listAllMeasures(pd));
map.put("imgList",blindboardacceptuserService.findByIds(pd));
map.put("imgList1",blindboardacceptuserService.findById(pd));
map.put("boardList", GFblindBoardInfoService.listAll(pd));
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAll")
@RequiresPermissions("blindboard: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(",");
GFblindboardService.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
dataMap.put("titles", titles);
List<PageData> varOList = GFblindboardService.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("NAME")); //1
vpd.put("var2", varOList.get(i).getString("CORP_INFO")); //2
vpd.put("var3", varOList.get(i).getString("APPLY_DEPARTMENT_ID")); //3
vpd.put("var4", varOList.get(i).getString("APPLY_USER_ID")); //4
vpd.put("var5", varOList.get(i).get("ISDELETE").toString()); //5
vpd.put("var6", varOList.get(i).getString("CREATTIME")); //6
vpd.put("var7", varOList.get(i).getString("CREATOR")); //7
vpd.put("var8", varOList.get(i).getString("OPERATTIME")); //8
vpd.put("var9", varOList.get(i).getString("OPERATOR")); //9
vpd.put("var10", varOList.get(i).getString("CHECK_NO")); //10
vpd.put("var11", varOList.get(i).getString("APPLY_USER_SIGNER_PATH")); //11
vpd.put("var12", varOList.get(i).getString("APPLY_USER_SIGNER_TIME")); //12
vpd.put("var13", varOList.get(i).getString("MEDIUM")); //13
vpd.put("var14", varOList.get(i).getString("TEMPERATURE")); //14
vpd.put("var15", varOList.get(i).getString("CONSTRUCTION_DEPARTMENT_ID")); //15
vpd.put("var16", varOList.get(i).getString("CONSTRUCTION_USER_ID")); //16
vpd.put("var17", varOList.get(i).getString("CONSTRUCTION_USER_SIGNER_PATH")); //17
vpd.put("var18", varOList.get(i).getString("CONSTRUCTION_USER_SIGNER_TIME")); //18
vpd.put("var19", varOList.get(i).getString("PRODUCTION_DEPARTMENT_ID")); //19
vpd.put("var20", varOList.get(i).getString("PRODUCTION_USER_ID")); //20
vpd.put("var21", varOList.get(i).getString("PRODUCTION_USER_SIGNER_PATH")); //21
vpd.put("var22", varOList.get(i).getString("PRODUCTION_USER_SIGNER_TIME")); //22
vpd.put("var23", varOList.get(i).getString("SAFETY_DEPARTMENT_ID")); //23
vpd.put("var24", varOList.get(i).getString("SAFETY_USER_ID")); //24
vpd.put("var25", varOList.get(i).getString("SAFETY_USER_SIGNER_PATH")); //25
vpd.put("var26", varOList.get(i).getString("SAFETY_USER_SIGNER_TIME")); //26
vpd.put("var27", varOList.get(i).getString("LEADER_DEPARTMENT_ID")); //27
vpd.put("var28", varOList.get(i).getString("LEADER_USER_ID")); //28
vpd.put("var29", varOList.get(i).getString("LEADER_USER_SIGNER_PATH")); //29
vpd.put("var30", varOList.get(i).getString("LEADER_USER_SIGNER_TIME")); //30
vpd.put("var31", varOList.get(i).getString("ACCEPT_DEPARTMENT_ID")); //31
vpd.put("var32", varOList.get(i).getString("ACCEPT_USER_ID")); //32
vpd.put("var33", varOList.get(i).getString("ACCEPT_USER_SIGNER_PATH")); //33
vpd.put("var34", varOList.get(i).getString("ACCEPT_USER_SIGNER_TIME")); //34
vpd.put("var35", varOList.get(i).getString("APPLY_STATUS")); //35
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
return mv;
}
}