封装数据发送(九公司消息发送)

pet
shanao 2024-10-23 14:16:31 +08:00
parent 1a26abd93a
commit c2c3897979
9 changed files with 896 additions and 804 deletions

View File

@ -3,7 +3,6 @@ package com.zcloud.controller.app.inspection;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.entity.hotWorkApplication.Node;
import com.zcloud.entity.hotWorkApplication.NodeApp;
import com.zcloud.entity.hotWorkApplication.Overseer;
import com.zcloud.service.bus.HiddenService;
@ -14,7 +13,6 @@ import com.zcloud.service.inspection.SafetyEnvironmentalInspectorService;
import com.zcloud.service.inspection.SafetyEnvironmentalService;
import com.zcloud.service.system.DepartmentService;
import com.zcloud.util.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,9 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
/**
*
@ -40,484 +36,511 @@ import java.util.stream.Collectors;
@RequestMapping("/app/safetyenvironmental")
public class AppSafetyEnvironmentalController extends BaseController {
@Autowired
private SafetyEnvironmentalService safetyenvironmentalService;
@Autowired
private SafetyEnvironmentalInspectorService safetyEnvironmentalInspectorService;
@Autowired
private SafetyEnvironmentalExplainService explainService;
@Autowired
private HiddenService hiddenService;
@Autowired
private DepartmentService departmentService;
@Resource
private SafetyEnvironmentalInspectorService inspectorService;
@Resource
private SafetyEnvironmentalAssessService assessService;
@Autowired
private NoticeCorpUtil noticeCorpUtil;
@Autowired
private SafetyEnvironmentalService safetyenvironmentalService;
@Autowired
private SafetyEnvironmentalInspectorService safetyEnvironmentalInspectorService;
@Autowired
private SafetyEnvironmentalExplainService explainService;
@Autowired
private HiddenService hiddenService;
@Autowired
private DepartmentService departmentService;
@Resource
private SafetyEnvironmentalInspectorService inspectorService;
@Resource
private SafetyEnvironmentalAssessService assessService;
@Autowired
private NoticeCorpUtil noticeCorpUtil;
/**
* @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 KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = safetyenvironmentalService.list(page); //列出SafetyEnvironmental列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
*
*
* @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 KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = safetyenvironmentalService.list(page); //列出SafetyEnvironmental列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@ResponseBody
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("INSPECTION_ID", this.get32UUID()); //主键
pd.put("INSPECTION_ORIGINATOR_ID", pd.getString("CREATOR")); //检查发起人
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", pd.getString("CREATOR")); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", pd.getString("CREATOR")); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
String ffile = DateUtil.getDays();
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))){
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("CONFIRM_MESSAGE",pd.getString("INSPECTION_USER_OPINION"));
pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date()));
}
List<PageData> hiddenList = safetyenvironmentalService.save(pd);
pd.put("hiddenList", hiddenList);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/add")
@ResponseBody
public Object add(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("INSPECTION_ID", this.get32UUID()); //主键
pd.put("INSPECTION_ORIGINATOR_ID", pd.getString("CREATOR")); //检查发起人
pd.put("ISDELETE", "0"); //是否删除(0:有效 1删除)
pd.put("CREATOR", pd.getString("CREATOR")); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", pd.getString("CREATOR")); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
String ffile = DateUtil.getDays();
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("CONFIRM_MESSAGE", pd.getString("INSPECTION_USER_OPINION"));
pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date()));
}
List<PageData> hiddenList = safetyenvironmentalService.save(pd);
pd.put("hiddenList", hiddenList);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/goShow")
@ResponseBody
public Object goShow() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = safetyenvironmentalService.findShowById(pd); //根据ID读取
safetyenvironmentalService.departmentUtil(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/goShow")
@ResponseBody
public Object goShow() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = safetyenvironmentalService.findShowById(pd); //根据ID读取
safetyenvironmentalService.departmentUtil(pd);
map.put("pd", pd);
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 = safetyenvironmentalService.findFormById(pd); //根据ID读取
safetyenvironmentalService.departmentUtil(pd);
map.put("pd", pd);
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 = safetyenvironmentalService.findFormById(pd); //根据ID读取
safetyenvironmentalService.departmentUtil(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@ResponseBody
public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("INSPECTION_STATUS", "0"); //状态(0.待检查人核实 1.检查人核实中、2.待被检查人确认、3.已归档 -1.检查人核实打回 -2被检查人申辩)
pd.put("OPERATOR", pd.getString("OPERATOR")); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
String ffile = DateUtil.getDays();
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))){
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("CONFIRM_MESSAGE",pd.getString("INSPECTION_USER_OPINION"));
pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date()));
}
List<PageData> hiddenList = safetyenvironmentalService.edit(pd);
pd.put("hiddenList", hiddenList);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/edit")
@ResponseBody
public Object edit(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("INSPECTION_STATUS", "0"); //状态(0.待检查人核实 1.检查人核实中、2.待被检查人确认、3.已归档 -1.检查人核实打回 -2被检查人申辩)
pd.put("OPERATOR", pd.getString("OPERATOR")); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
String ffile = DateUtil.getDays();
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))) {
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("CONFIRM_MESSAGE", pd.getString("INSPECTION_USER_OPINION"));
pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date()));
}
List<PageData> hiddenList = safetyenvironmentalService.edit(pd);
pd.put("hiddenList", hiddenList);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/explain")
//@RequiresPermissions("safetyenvironmental:edit")
@ResponseBody
public Object explain(@RequestParam(value="FFILE",required=false) MultipartFile[] files) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/explain")
//@RequiresPermissions("safetyenvironmental:edit")
@ResponseBody
public Object explain(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd.put("INSPECTION_ORIGINATOR_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
safetyenvironmentalService.explain(pd);
pd.put("inspector",pd.getString("OPERATOR"));
noticeCorpUtil.FailPleadind(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
pd.put("INSPECTION_ORIGINATOR_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
safetyenvironmentalService.explain(pd);
pd.put("inspector", pd.getString("OPERATOR"));
noticeCorpUtil.FailPleadind(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/delete")
@RequiresPermissions("safetyenvironmental: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();
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/delete")
@RequiresPermissions("safetyenvironmental: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();
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAll")
@RequiresPermissions("safetyenvironmental: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String[] ArrayDATA_IDS = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
safetyenvironmentalService.deleteAll(pd);
errInfo = "success";
}else{
errInfo = "fail";
}
map.put("result", errInfo); //返回结果
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/deleteAll")
@RequiresPermissions("safetyenvironmental: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
String DATA_IDS = pd.getString("DATA_IDS");
if (Tools.notEmpty(DATA_IDS)) {
String[] ArrayDATA_IDS = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
safetyenvironmentalService.deleteAll(pd);
errInfo = "success";
} else {
errInfo = "fail";
}
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("状态(0.暂存 1.检查人待确认、2.被检查人待确认、3.归档 -1.检查人异议打回 -2被检查人申辩)"); //11
titles.add("是否删除(0:有效 1删除)"); //12
titles.add("添加人"); //13
titles.add("添加时间"); //14
titles.add("修改人"); //15
titles.add("修改时间"); //16
titles.add("企业ID"); //17
dataMap.put("titles", titles);
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
List<PageData> varOList = safetyenvironmentalService.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("INSPECTION_ORIGINATOR_ID")); //1
vpd.put("var2", varOList.get(i).getString("INSPECTED_DEPARTMENT_ID")); //2
vpd.put("var3", varOList.get(i).getString("INSPECTED_SITEUSER_ID")); //3
vpd.put("var4", varOList.get(i).getString("INSPECTED_EXPLAIN")); //4
vpd.put("var5", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_IMG")); //5
vpd.put("var6", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_TIME")); //6
vpd.put("var7", varOList.get(i).getString("INSPECTION_TYPE")); //7
vpd.put("var8", varOList.get(i).getString("INSPECTION_PLACE")); //8
vpd.put("var9", varOList.get(i).getString("INSPECTION_TIME_START")); //9
vpd.put("var10", varOList.get(i).getString("INSPECTION_TIME_END")); //10
vpd.put("var11", varOList.get(i).getString("INSPECTION_STATUS")); //11
vpd.put("var12", varOList.get(i).getString("ISDELETE")); //12
vpd.put("var13", varOList.get(i).getString("CREATOR")); //13
vpd.put("var14", varOList.get(i).getString("CREATTIME")); //14
vpd.put("var15", varOList.get(i).getString("OPERATOR")); //15
vpd.put("var16", varOList.get(i).getString("OPERATTIME")); //16
vpd.put("var17", varOList.get(i).getString("CORPINFO_ID")); //17
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
return mv;
}
/**
* 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("状态(0.暂存 1.检查人待确认、2.被检查人待确认、3.归档 -1.检查人异议打回 -2被检查人申辩)"); //11
titles.add("是否删除(0:有效 1删除)"); //12
titles.add("添加人"); //13
titles.add("添加时间"); //14
titles.add("修改人"); //15
titles.add("修改时间"); //16
titles.add("企业ID"); //17
dataMap.put("titles", titles);
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
List<PageData> varOList = safetyenvironmentalService.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("INSPECTION_ORIGINATOR_ID")); //1
vpd.put("var2", varOList.get(i).getString("INSPECTED_DEPARTMENT_ID")); //2
vpd.put("var3", varOList.get(i).getString("INSPECTED_SITEUSER_ID")); //3
vpd.put("var4", varOList.get(i).getString("INSPECTED_EXPLAIN")); //4
vpd.put("var5", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_IMG")); //5
vpd.put("var6", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_TIME")); //6
vpd.put("var7", varOList.get(i).getString("INSPECTION_TYPE")); //7
vpd.put("var8", varOList.get(i).getString("INSPECTION_PLACE")); //8
vpd.put("var9", varOList.get(i).getString("INSPECTION_TIME_START")); //9
vpd.put("var10", varOList.get(i).getString("INSPECTION_TIME_END")); //10
vpd.put("var11", varOList.get(i).getString("INSPECTION_STATUS")); //11
vpd.put("var12", varOList.get(i).getString("ISDELETE")); //12
vpd.put("var13", varOList.get(i).getString("CREATOR")); //13
vpd.put("var14", varOList.get(i).getString("CREATTIME")); //14
vpd.put("var15", varOList.get(i).getString("OPERATOR")); //15
vpd.put("var16", varOList.get(i).getString("OPERATTIME")); //16
vpd.put("var17", varOList.get(i).getString("CORPINFO_ID")); //17
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv, dataMap);
return mv;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/countCheck")
@ResponseBody
public Object countCheck() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData confirmCount = safetyEnvironmentalInspectorService.confirmCount(pd); //检查人确认数
PageData checkedCount = safetyenvironmentalService.checkedCount(pd); //被检查人签字数
PageData repulseCount = safetyenvironmentalService.repulseCount(pd); //打回数
PageData repulseAndCheckCount = safetyenvironmentalService.repulseAndCheckCountCount(pd); //指派+验收数
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/countCheck")
@ResponseBody
public Object countCheck() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData confirmCount = safetyEnvironmentalInspectorService.confirmCount(pd); //检查人确认数
PageData checkedCount = safetyenvironmentalService.checkedCount(pd); //被检查人签字数
PageData repulseCount = safetyenvironmentalService.repulseCount(pd); //打回数
PageData repulseAndCheckCount = safetyenvironmentalService.repulseAndCheckCountCount(pd); //指派+验收数
map.put("result", errInfo);
map.put("confirmCount", confirmCount);
map.put("checkedCount",checkedCount);
map.put("repulseCount",repulseCount);
map.put("repulseAndCheckCount",repulseAndCheckCount);
return map;
}
map.put("result", errInfo);
map.put("confirmCount", confirmCount);
map.put("checkedCount", checkedCount);
map.put("repulseCount", repulseCount);
map.put("repulseAndCheckCount", repulseAndCheckCount);
return map;
}
@RequestMapping(value="/getExplain")
@ResponseBody
public Object getExplain() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> list = explainService.findExplainById(pd);
map.put("list",list);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/getExplain")
@ResponseBody
public Object getExplain() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
List<PageData> list = explainService.findExplainById(pd);
map.put("list", list);
map.put("result", errInfo);
return map;
}
/**app
* @param
* @throws Exception
*/
@RequestMapping(value="/countHome")
@ResponseBody
public Object countHome() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData count = safetyEnvironmentalInspectorService.countHome(pd); //一公司app首页安全环保检查统计
map.put("result", errInfo);
map.put("count", count);
return map;
}
/**
* app
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/countHome")
@ResponseBody
public Object countHome() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData count = safetyEnvironmentalInspectorService.countHome(pd); //一公司app首页安全环保检查统计
map.put("result", errInfo);
map.put("count", count);
return map;
}
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/pleadList")
@ResponseBody
public Object pleadList(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 = safetyenvironmentalService.pleadList(page); //列出SafetyEnvironmental列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/pleadList")
@ResponseBody
public Object pleadList(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 = safetyenvironmentalService.pleadList(page); //列出SafetyEnvironmental列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* :
* @param page
* @throws Exception
*/
@RequestMapping(value="/checkList")
@ResponseBody
public Object checkList(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("waffle",pd.getString("ARCHIVE_USER_ID"));
page.setPd(pd);
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
/* 针对验收部分特殊处理 */
String user_id = pd.getString("ARCHIVE_USER_ID");
for (PageData vector : varList) {
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
("6".equals(vector.getString("INSPECTION_STATUS"))
|| "5".equals(vector.getString("INSPECTION_STATUS"))
|| "7".equals(vector.getString("INSPECTION_STATUS")))
) {
PageData condition = new PageData();
condition.put("FOREIGN_ID",vector.getString("INSPECTION_ID"));
List<PageData> waffle = hiddenService.findByKey(condition); //d
if (waffle == null || waffle.isEmpty()){
continue;
}
Long number = waffle.stream()
.filter(n ->
user_id.equals(n.getString("CREATOR"))
&& (StringUtils.isNotBlank(n.getString("STATE"))&&(
"4".equals(n.getString("STATE"))|| "8".equals(n.getString("STATE"))))
/**
*
* :
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/checkList")
@ResponseBody
public Object checkList(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("waffle", pd.getString("ARCHIVE_USER_ID"));
pd.put("loginUserId", Jurisdiction.getUSER_ID());
page.setPd(pd);
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
/* 针对验收部分特殊处理 */
String user_id = pd.getString("ARCHIVE_USER_ID");
for (PageData vector : varList) {
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
("6".equals(vector.getString("INSPECTION_STATUS"))
|| "5".equals(vector.getString("INSPECTION_STATUS"))
|| "7".equals(vector.getString("INSPECTION_STATUS")))
) {
PageData condition = new PageData();
condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
List<PageData> waffle = hiddenService.findByKey(condition); //d
if (waffle == null || waffle.isEmpty()) {
continue;
}
Long number = waffle.stream()
.filter(n ->
user_id.equals(n.getString("CREATOR"))
&& (StringUtils.isNotBlank(n.getString("STATE")) && (
"4".equals(n.getString("STATE")) || "8".equals(n.getString("STATE"))))
&&(StringUtils.isBlank(n.getString("FINAL_CHECK"))|| "2".equals(n.getString("FINAL_CHECK")))
)
.count();
if (number >0){
vector.put("checkout",1);
}
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
&& (StringUtils.isBlank(n.getString("FINAL_CHECK")) || "2".equals(n.getString("FINAL_CHECK")))
)
.count();
if (number > 0) {
vector.put("checkout", 1);
}
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
@RequestMapping(value="/showFlowChart")
@ResponseBody
public Object showFlowChart() throws Exception{
HashMap<String, Object> response = new HashMap<>();
response.put("result","success");
PageData condition = this.getPageData();
condition.put("INSPECTION_ID",condition.getString("ID"));
PageData safety = safetyenvironmentalService.findById(condition);
if (safety == null || safety.size() <= 0) {
response.put("result", "error");
response.put("errorMessage", "数据异常");
}
// 1、整理基础数据
Overseer overseer = new Overseer();
List<NodeApp> nodes = overseer.getSafetyAppWorkFlow();
// 初始话安全环保发起人、被检查人数据
nodes.get(0).safety_order(safety);
nodes.stream().forEach(n -> n.safety_creator_util(safety));
for (NodeApp nodeApp : nodes) {
if (StringUtils.isNotBlank(nodeApp.getActive()))
overseer.setSafetyAppVector(nodeApp.getOrder());
}
// 2、整理特殊数据
// 2、1检查人将检查状态
if ("2,3,4".contains(safety.getString("order"))) {
List<PageData> inspectors = inspectorService.listAll(condition);
nodes.stream()
.filter(n -> "1".equals(n.getOrder()))
.forEach(n -> n.safety_inspector_util(inspectors));
}
@RequestMapping(value = "/showFlowChart")
@ResponseBody
public Object showFlowChart() throws Exception {
HashMap<String, Object> response = new HashMap<>();
response.put("result", "success");
PageData condition = this.getPageData();
condition.put("INSPECTION_ID", condition.getString("ID"));
PageData safety = safetyenvironmentalService.findById(condition);
if (safety == null || safety.size() <= 0) {
response.put("result", "error");
response.put("errorMessage", "数据异常");
}
// 1、整理基础数据
Overseer overseer = new Overseer();
List<NodeApp> nodes = overseer.getSafetyAppWorkFlow();
// 初始话安全环保发起人、被检查人数据
nodes.get(0).safety_order(safety);
nodes.stream().forEach(n -> n.safety_creator_util(safety));
for (NodeApp nodeApp : nodes) {
if (StringUtils.isNotBlank(nodeApp.getActive()))
overseer.setSafetyAppVector(nodeApp.getOrder());
}
// 2、整理特殊数据
// 2、1检查人将检查状态
if ("2,3,4".contains(safety.getString("order"))) {
List<PageData> inspectors = inspectorService.listAll(condition);
nodes.stream()
.filter(n -> "1".equals(n.getOrder()))
.forEach(n -> n.safety_inspector_util(inspectors));
}
//隐患指派流程
if ("3,4".contains(safety.getString("order"))) {
List<PageData> hiddenz = safetyenvironmentalService.findByyin(condition);
if (hiddenz != null && hiddenz.size() > 0) {
nodes.stream()
.filter(n -> "3".equals(n.getOrder()))
.forEach(n -> n.safety_hiddenz(hiddenz));
}
}
if ("4".equals(safety.getString("order"))) {
// 2、2 隐患发现人状态
condition.put("FOREIGN_ID", condition.getString("INSPECTION_ID"));
List<PageData> hiddens = hiddenService.findByKey(condition);
nodes.stream()
.filter(n -> "4".equals(n.getOrder()))
.forEach(n -> n.safety_hiddenCreator_util(hiddens));
}
// 2、3 考评人
//隐患指派流程
if ("3,4".contains(safety.getString("order"))) {
List<PageData> hiddenz = safetyenvironmentalService.findByyin(condition);
if (hiddenz != null && hiddenz.size() > 0) {
nodes.stream()
.filter(n -> "3".equals(n.getOrder()))
.forEach(n -> n.safety_hiddenz(hiddenz));
}
}
if ("4".equals(safety.getString("order"))) {
// 2、2 隐患发现人状态
condition.put("FOREIGN_ID", condition.getString("INSPECTION_ID"));
List<PageData> hiddens = hiddenService.findByKey(condition);
nodes.stream()
.filter(n -> "4".equals(n.getOrder()))
.forEach(n -> n.safety_hiddenCreator_util(hiddens));
}
// 2、3 考评人
// List<PageData> assess = assessService.findByMainId(condition);
// if (assess != null && assess.size() > 0) {
// nodes.stream()
// .filter(n -> "5".equals(n.getOrder()))
// .forEach(n -> n.safety_assessor_util(assess));
// }
response.put("varList", nodes);
response.put("active" ,overseer.getSafetyAppVector());
return response;
}
response.put("varList", nodes);
response.put("active", overseer.getSafetyAppVector());
return response;
}
}

View File

@ -737,31 +737,35 @@ public class SafetyEnvironmentalController extends BaseController {
pd.put("loginUserId", Jurisdiction.getUSER_ID());
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
/* 针对验收部分特殊处理 */
for (PageData vector : varList) {
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
("6".equals(vector.getString("INSPECTION_STATUS"))
|| "5".equals(vector.getString("INSPECTION_STATUS"))
// || "7".equals(vector.getString("INSPECTION_STATUS"))
)
) {
PageData condition = new PageData();
condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
List<PageData> waffle = hiddenService.findByKey(condition);
if (waffle == null || waffle.isEmpty()) {
continue;
}
Long number = waffle.stream()
.filter(n ->
Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) &&
(StringUtils.isNotBlank(n.getString("STATE")) && ("4".equals(n.getString("STATE")) || "8".equals(n.getString("STATE")))) &&
(StringUtils.isBlank(n.getString("FINAL_CHECK")) || "2".equals(n.getString("FINAL_CHECK")))
)
.count();
if (number > 0) {
vector.put("checkout", 1);
}
}
}
// for (PageData vector : varList) {
// if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
// ("6".equals(vector.getString("INSPECTION_STATUS"))
// || "5".equals(vector.getString("INSPECTION_STATUS"))
//// || "7".equals(vector.getString("INSPECTION_STATUS"))
// )
// ) {
// PageData condition = new PageData();
// condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
// List<PageData> waffle = hiddenService.findByKey(condition);
// if (waffle == null || waffle.isEmpty()) {
// continue;
// }
// Long number = waffle.stream()
// .filter(n -> Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) &&
// (StringUtils.isNotBlank(n.getString("STATE")) &&
// ("4".equals(n.getString("STATE")) ||
// "8".equals(n.getString("STATE")))) &&
// (StringUtils.isBlank(n.getString("FINAL_CHECK")) ||
// "2".equals(n.getString("FINAL_CHECK")))
// )
// .count();
// if (number > 0) {
// vector.put("checkout", 1);
// } else {
// vector.put("checkout", 0);
// }
// }
// }
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);

View File

@ -30,262 +30,269 @@ import java.util.stream.Collectors;
@RequestMapping("/safetyenvironmentalinspector")
public class SafetyEnvironmentalInspectorController extends BaseController {
@Autowired
private SafetyEnvironmentalInspectorService safetyenvironmentalinspectorService;
@Autowired
private SafetyEnvironmentalInspectorService safetyenvironmentalinspectorService;
@Autowired
private DepartmentService departmentService;
@Autowired
private DepartmentService departmentService;
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@RequiresPermissions("safetyenvironmentalinspector: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("INSPECTION_USER_ID", Jurisdiction.getUSER_ID()); //检查人ID
Session session = Jurisdiction.getSession();
User loginUser = (User)session.getAttribute(Const.SESSION_USER);
if(null != loginUser){
pd.put("supDeparIds",loginUser.getSuperviseDepartId());
pd.put("roleLevel",loginUser.getRoleLevel());
pd.put("loginUserId",loginUser.getUSER_ID());
}
/**
*
*
* @param page
* @throws Exception
*/
@RequestMapping(value = "/list")
@RequiresPermissions("safetyenvironmentalinspector: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("INSPECTION_USER_ID", Jurisdiction.getUSER_ID()); //检查人ID
Session session = Jurisdiction.getSession();
User loginUser = (User) session.getAttribute(Const.SESSION_USER);
if (null != loginUser) {
pd.put("supDeparIds", loginUser.getSuperviseDepartId());
pd.put("roleLevel", loginUser.getRoleLevel());
pd.put("loginUserId", loginUser.getUSER_ID());
}
pd.put("loginUserId", Jurisdiction.getUSER_ID());
page.setPd(pd);
List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表
for (PageData vector : varList) {
PageData condition = new PageData();
condition.put("DEPARTMENT_ID", vector.getString("INSPECTED_DEPARTMENT_ID"));
List<PageData> parent_list = departmentService.getGenealogy(condition);
if (parent_list == null || parent_list.size() < 1) {
String corp_infos = "";
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
} else {
String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
page.setPd(pd);
List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表
for (PageData vector: varList) {
PageData condition = new PageData();
condition.put("DEPARTMENT_ID",vector.getString("INSPECTED_DEPARTMENT_ID"));
List<PageData> parent_list = departmentService.getGenealogy(condition);
if (parent_list == null || parent_list.size() < 1) {
String corp_infos = "";
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
} else {
String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
vector.put("INSPECTED_DEPARTMENT_NAMES",corp_infos);
}
}
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/verify")
@RequiresPermissions("safetyenvironmentalinspector:add")
@ResponseBody
public Object verify() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData uBean = safetyenvironmentalinspectorService.findById(pd);
uBean.put("INSPECTION_USER_OPINION", pd.getString("INSPECTION_USER_OPINION"));
uBean.put("INSPECTION_USER_SIGN_TIME", DateUtil.date2Str(new Date()));
uBean.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
uBean.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
uBean.put("INSPECTION_STATUS", pd.getString("INSPECTION_STATUS")); //检查进度状态
uBean.put("ACTION_USER", Jurisdiction.getName()); //检查进度状态
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/verify")
@RequiresPermissions("safetyenvironmentalinspector:add")
@ResponseBody
public Object verify() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData uBean= safetyenvironmentalinspectorService.findById(pd);
uBean.put("INSPECTION_USER_OPINION", pd.getString("INSPECTION_USER_OPINION"));
uBean.put("INSPECTION_USER_SIGN_TIME", DateUtil.date2Str(new Date()));
uBean.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
uBean.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
uBean.put("INSPECTION_STATUS", pd.getString("INSPECTION_STATUS")); //检查进度状态
uBean.put("ACTION_USER", Jurisdiction.getName()); //检查进度状态
if (StringUtils.isNotBlank(pd.getString("INSPECTION_USER_SIGN_IMG"))) {
MultipartFile file = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTION_USER_SIGN_IMG"));
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
if (StringUtils.isNotBlank(pd.getString("INSPECTION_USER_SIGN_IMG"))) {
MultipartFile file = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTION_USER_SIGN_IMG"));
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "文件格式不正确!");
return map;
}
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
uBean.put("INSPECTION_USER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
safetyenvironmentalinspectorService.verify(uBean);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
uBean.put("INSPECTION_USER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
safetyenvironmentalinspectorService.verify(uBean);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/add")
@RequiresPermissions("safetyenvironmentalinspector: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("INSPECTION_INSPECTOR_ID", this.get32UUID()); //主键
pd.put("ISDELETE", ""); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
safetyenvironmentalinspectorService.save(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/delete")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalinspectorService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/edit")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalinspectorService.edit(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/goEdit")
@RequiresPermissions("safetyenvironmentalinspector:edit")
@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 = safetyenvironmentalinspectorService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/deleteAll")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
String DATA_IDS = pd.getString("DATA_IDS");
if (Tools.notEmpty(DATA_IDS)) {
String[] ArrayDATA_IDS = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
safetyenvironmentalinspectorService.deleteAll(pd);
errInfo = "success";
} else {
errInfo = "fail";
}
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/add")
@RequiresPermissions("safetyenvironmentalinspector: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("INSPECTION_INSPECTOR_ID", this.get32UUID()); //主键
pd.put("ISDELETE", ""); //是否删除(0:有效 1删除)
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
safetyenvironmentalinspectorService.save(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/delete")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalinspectorService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
safetyenvironmentalinspectorService.edit(pd);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/goEdit")
@RequiresPermissions("safetyenvironmentalinspector:edit")
@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 = safetyenvironmentalinspectorService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/deleteAll")
@RequiresPermissions("safetyenvironmentalinspector: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();
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
String DATA_IDS = pd.getString("DATA_IDS");
if(Tools.notEmpty(DATA_IDS)){
String[] ArrayDATA_IDS = DATA_IDS.split(",");
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
safetyenvironmentalinspectorService.deleteAll(pd);
errInfo = "success";
}else{
errInfo = "fail";
}
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("安全环保检查ID"); //1
titles.add("检查人"); //2
titles.add("检查人意见(有异议时必填)"); //3
titles.add("检查人签字"); //4
titles.add("检查人签字时间"); //5
titles.add("是否删除(0:有效 1删除)"); //6
titles.add("添加人"); //7
titles.add("添加时间"); //8
titles.add("修改人"); //9
titles.add("修改时间"); //10
titles.add("企业ID"); //11
dataMap.put("titles", titles);
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
List<PageData> varOList = safetyenvironmentalinspectorService.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("INSPECTION_ID")); //1
vpd.put("var2", varOList.get(i).getString("INSPECTION_USER_ID")); //2
vpd.put("var3", varOList.get(i).getString("INSPECTION_USER_OPINION")); //3
vpd.put("var4", varOList.get(i).getString("INSPECTION_USER_SIGN_IMG")); //4
vpd.put("var5", varOList.get(i).getString("INSPECTION_USER_SIGN_TIME")); //5
vpd.put("var6", varOList.get(i).getString("ISDELETE")); //6
vpd.put("var7", varOList.get(i).getString("CREATOR")); //7
vpd.put("var8", varOList.get(i).getString("CREATTIME")); //8
vpd.put("var9", varOList.get(i).getString("OPERATOR")); //9
vpd.put("var10", varOList.get(i).getString("OPERATTIME")); //10
vpd.put("var11", varOList.get(i).getString("CORPINFO_ID")); //11
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
return mv;
}
/**
* 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("安全环保检查ID"); //1
titles.add("检查人"); //2
titles.add("检查人意见(有异议时必填)"); //3
titles.add("检查人签字"); //4
titles.add("检查人签字时间"); //5
titles.add("是否删除(0:有效 1删除)"); //6
titles.add("添加人"); //7
titles.add("添加时间"); //8
titles.add("修改人"); //9
titles.add("修改时间"); //10
titles.add("企业ID"); //11
dataMap.put("titles", titles);
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
List<PageData> varOList = safetyenvironmentalinspectorService.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("INSPECTION_ID")); //1
vpd.put("var2", varOList.get(i).getString("INSPECTION_USER_ID")); //2
vpd.put("var3", varOList.get(i).getString("INSPECTION_USER_OPINION")); //3
vpd.put("var4", varOList.get(i).getString("INSPECTION_USER_SIGN_IMG")); //4
vpd.put("var5", varOList.get(i).getString("INSPECTION_USER_SIGN_TIME")); //5
vpd.put("var6", varOList.get(i).getString("ISDELETE")); //6
vpd.put("var7", varOList.get(i).getString("CREATOR")); //7
vpd.put("var8", varOList.get(i).getString("CREATTIME")); //8
vpd.put("var9", varOList.get(i).getString("OPERATOR")); //9
vpd.put("var10", varOList.get(i).getString("OPERATTIME")); //10
vpd.put("var11", varOList.get(i).getString("CORPINFO_ID")); //11
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv, dataMap);
return mv;
}
}

View File

@ -4,6 +4,7 @@ import com.zcloud.entity.messages.PushRecords;
import com.zcloud.service.messages.PushMessages;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
*
@ -16,6 +17,7 @@ public class AllMessagesImpl implements PushMessages {
private final SmsMessagesImpl smsMessages;
@Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords, String userId) throws Exception {
insideMessages.push(pushRecords, userId);
smsMessages.push(pushRecords, userId);

View File

@ -6,6 +6,7 @@ import com.zcloud.service.bus.NoticeCorpService;
import com.zcloud.service.messages.PushMessages;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
*
@ -17,6 +18,7 @@ public class InsideMessagesImpl implements PushMessages {
private final NoticeCorpService noticeCorpService;
@Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords, String userId) throws Exception {
PageData mes = new PageData();
mes.put("BIANMA", "PUSH_RECORDS");

View File

@ -10,7 +10,6 @@ import com.zcloud.util.UuidUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
@ -21,10 +20,8 @@ public class MessagesServiceImpl implements MessagesService {
private final MessagesMapper mapper;
private final Map<String, PushMessages> messages;
@Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords) throws Exception {
// 先记录数据
pushRecords.setId(UuidUtil.get32UUID());

View File

@ -117,9 +117,33 @@ public class AliSmsToolUtil {
//发短信
Map<String,Object> map = new HashMap<String,Object>();
map.put("infoDetail", "阿斯顿发");
map.put("phone", "18630363710");
map.put("phone", "18630387571");
map.put("infoType", "阿三地方");
map.put("templateCode", "SMS_227260789");
List<PageData> paramsList = new ArrayList<PageData>();
PageData params1 = new PageData();
// 第1个参数
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", 2);// 存入上面参数名称所传递的值
paramsList.add(params1);
PageData params2 = new PageData();
// 第2个参数
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "盲板作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
PageData params3 = new PageData();
// 第3个参数
params3.put("name", "params2");// 存入短信模板中的参数名称
params3.put("value", "生产部门意见");// 存入上面参数名称所传递的值
paramsList.add(params3);
PageData params4 = new PageData();
// 第4个参数
params4.put("name", "params3");// 存入短信模板中的参数名称
params4.put("value", "审核");// 存入上面参数名称所传递的值
paramsList.add(params4);
SendSmsResponse response = sendSms(map,paramsList);
System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());

View File

@ -194,7 +194,11 @@
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') asc, se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC
ORDER BY
FIELD(if(f.INSPECTION_USER_SIGN_TIME is not null,'2','1'), '1','2'),
FIELD(if(se.INSPECTED_SITEUSER_ID = #{pd.loginUserId},#{pd.loginUserId},'1'), #{pd.loginUserId}, '1'),
FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') ,
se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC
</select>
<!-- 列表(全部) -->

View File

@ -649,82 +649,111 @@
<!-- 列表 -->
<select id="checklistPage" parameterType="page" resultType="pd">
select
iou.NAME INSPECTION_ORIGINATOR_NAME,
ild.NAME INSPECTION_LEADDEPARTMENT_NAME,
iod.NAME INSPECTION_DEPARTMENT_NAME,
isd.NAME INSPECTED_DEPARTMENT_NAME,
isu.NAME INSPECTED_SITEUSER_NAME,
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID,'/',',')),'') AS INSPECTION_USER_ID,
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME,'/',',')),'') AS INSPECTION_USER_NAME,
CASE WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
<include refid="Field"></include>
from
<include refid="tableName"></include> f
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID
LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0'
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE
where f.ISDELETE = '0'
<if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''"><!-- 检查发起人 -->
and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID}
</if>
<if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''">
and (
f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID}
OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID}
OR EXISTS(select 1 from bus_inspection_safetyenvironmental_inspector sii where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID}
and sii.INSPECTION_ID = f.INSPECTION_ID)
)
</if>
select iou.NAME INSPECTION_ORIGINATOR_NAME,
ild.NAME INSPECTION_LEADDEPARTMENT_NAME,
iod.NAME INSPECTION_DEPARTMENT_NAME,
isd.NAME INSPECTED_DEPARTMENT_NAME,
isu.NAME INSPECTED_SITEUSER_NAME,
if(h.`count` > 0, 1, null) as checkout,
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID, '/', ',')), '') AS INSPECTION_USER_ID,
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME, '/', ',')), '') AS INSPECTION_USER_NAME,
CASE
WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME
ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
<include refid="Field">
</include>
from
<include refid="tableName">
</include>
f
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID
LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID
LEFT JOIN bus_inspection_safetyenvironmental_inspector si
ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0'
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE
LEFT JOIN (select h.FOREIGN_ID, count(h.HIDDEN_ID) as `count`
from BUS_HIDDEN h
where h.ISDELETE = 0
and h.CREATOR = #{pd.loginUserId}
and h.STATE in ('4', '8')
and (h.FINAL_CHECK is null or h.FINAL_CHECK = '2')
group by h.FOREIGN_ID) h on h.FOREIGN_ID = f.INSPECTION_ID AND f.INSPECTION_STATUS in ('5', '6')
where f.ISDELETE = '0'
<if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''">
<!-- 检查发起人 -->
and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID}
</if>
<if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''">
and (
f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID}
OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID}
OR EXISTS(select 1
from bus_inspection_safetyenvironmental_inspector sii
where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID}
and sii.INSPECTION_ID = f.INSPECTION_ID)
)
</if>
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''"><!-- 被检查单位 -->
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}),'%')
</if>
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''"><!-- 检查部门 -->
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}),'%')
</if>
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''"><!-- 检查发起人 -->
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}),'%')
</if>
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''"><!-- 检查类型 -->
and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
</if>
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''"><!-- 检查题目 -->
and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
</if>
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''"><!-- 检查时间 -->
and f.INSPECTION_TIME_START &gt;= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
</if>
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''"><!-- 检查时间 -->
and f.INSPECTION_TIME_END &lt;= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
</if>
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''"><!-- 检查状态 -->
<choose>
<when test="pd.INSPECTION_STATUS == '3-7'">
and f.INSPECTION_STATUS in ('3','4','5','6','7','8')
</when>
<otherwise>
and f.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
</otherwise>
</choose>
</if>
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''">
<!-- 被检查单位 -->
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}), '%')
</if>
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''">
<!-- 检查部门 -->
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}), '%')
</if>
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''">
<!-- 检查发起人 -->
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}), '%')
</if>
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''">
<!-- 检查类型 -->
and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
</if>
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''">
<!-- 检查题目 -->
and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
</if>
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''">
<!-- 检查时间 -->
and f.INSPECTION_TIME_START &gt;= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
</if>
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''">
<!-- 检查时间 -->
and f.INSPECTION_TIME_END &lt;= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
</if>
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''">
<!-- 检查状态 -->
<choose>
<when test="pd.INSPECTION_STATUS == '3-7'">
and f.INSPECTION_STATUS in ('3', '4', '5', '6', '7', '8')
</when>
<otherwise>
and f.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
</otherwise>
</choose>
</if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 被检查单位 -->
and (
isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY FIELD(if(f.INSPECTED_SITEUSER_ID = #{pd.loginUserId},f.INSPECTED_SITEUSER_ID,'1'), f.INSPECTED_SITEUSER_ID, '1'),
field(f.INSPECTION_STATUS , '3','4','6','7','5','0','1','2','8','-1','-2'),
f.INSPECTION_TIME_END DESC
</select>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
<!-- 被检查单位 -->
and (
isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY CASE
WHEN f.INSPECTION_STATUS IN ('3', '4') AND f.INSPECTED_SITEUSER_ID = #{pd.loginUserId} THEN 1
WHEN f.INSPECTION_STATUS IN ('5', '6', '7') AND checkout = 1 THEN 2
ELSE 3
END,
field(f.INSPECTION_STATUS, '3', '6', '4', '7', '5', '0', '1', '2', '8', '-1', '-2'),
f.INSPECTION_TIME_END DESC
</select>
<select id="statisticsBranchGroupDept" parameterType="pd" resultType="pd">
SELECT