From 25197241873d9c1e57a89d7a0151dbb6e1fbba98 Mon Sep 17 00:00:00 2001 From: zhangyanli Date: Mon, 5 Feb 2024 14:28:40 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check/ListManagerController.java | 1 + .../CommonController.java | 5 +- .../CustomController.java | 210 ++++++++++-------- .../datasource/check/ListManagerMapper.xml | 110 ++++++++- .../CommonMapper.xml | 5 +- .../CustomDisableTimeMapper.xml | 6 +- 6 files changed, 243 insertions(+), 94 deletions(-) diff --git a/src/main/java/com/zcloud/controller/check/ListManagerController.java b/src/main/java/com/zcloud/controller/check/ListManagerController.java index 6c73122..22f34c8 100644 --- a/src/main/java/com/zcloud/controller/check/ListManagerController.java +++ b/src/main/java/com/zcloud/controller/check/ListManagerController.java @@ -1950,6 +1950,7 @@ public class ListManagerController extends BaseController { npd.put("PERIOD",pd.getString("PERIOD")); npd.put("STATUS",pd.getString("STATUS")); npd.put("LISTINGLEVEL",pd.getString("LISTINGLEVEL")); + npd.put("LIST_TYPE",pd.getString("LIST_TYPE")); page.setPd(npd); List varList = listmanagerService.riskStandardCheckList(page); //列出ListManager列表 for (PageData list : varList) { diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java index 7618458..e0ddef8 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java @@ -48,7 +48,10 @@ public class CommonController extends BaseController { if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 PageData corpinfo = corpinfoService.findById(pd); //根据ID读取 - pd.put("CORP_TYPE_NAME", corpinfo.getString("CORP_TYPE_NAME")); + pd.put("CORP_TYPE", corpinfo.getString("CORP_TYPE")); + pd.put("CORP_TYPE2", corpinfo.getString("CORP_TYPE2")); + pd.put("CORP_TYPE3", corpinfo.getString("CORP_TYPE3")); + pd.put("CORP_TYPE4", corpinfo.getString("CORP_TYPE4")); page.setPd(pd); List varList = commonService.list(page); //列出RiskCheckItem列表 map.put("varList", varList); diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java index 8c6c0de..ad577ad 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java @@ -1759,91 +1759,127 @@ public class CustomController extends BaseController { map.put("result", errInfo); return map; } -// -// /**清单检查记录(日检)统计 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/statisticsListCheckDay") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(日检)统计") -// public Object statisticsListCheckDay() throws Exception{ -// Map map = new HashMap(); -// String errInfo = "success"; -// PageData pd = new PageData(); -// pd = this.getPageData(); -// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件 -// if (Tools.notEmpty(KEYWORDS)) -// pd.put("KEYWORDS", KEYWORDS.trim()); -// -// System.out.println(pd.getString("KEYWORDS")); -// List varList = listcheckitemService.listAll(pd); -// PageData data = listmanagerService.findById(pd); //根据ID读取 -// data.put("YEAR", pd.getString("YEAR")); -// List recordList = checkrecordService.listAllYearForDay(data);//获取查询月在检查周期内的检查记录 -// -// map.put("pd", data); -// map.put("varList", varList); -// map.put("recordList", recordList); -// map.put("result", errInfo); -// return map; -// } -// -// /**清单检查记录(周检)统计 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/statisticsListCheckWeek") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(周检)统计") -// public Object statisticsListCheckWeek() throws Exception{ -// Map map = new HashMap(); -// String errInfo = "success"; -// PageData pd = new PageData(); -// pd = this.getPageData(); -// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件 -// if (Tools.notEmpty(KEYWORDS)) -// pd.put("KEYWORDS", KEYWORDS.trim()); -// -// System.out.println(pd.getString("KEYWORDS")); -// List varList = listcheckitemService.listAll(pd); -// PageData data = listmanagerService.findById(pd); //根据ID读取 -// data.put("YEAR", pd.getString("YEAR")); -// List recordList = checkrecordService.listAllYearForWeek(data);//获取检查周期内的检查记录 -// -// map.put("pd", data); -// map.put("varList", varList); -// map.put("recordList", recordList); -// map.put("result", errInfo); -// return map; -// } -// -// /**清单检查记录(旬检)统计 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/statisticsListCheckTenday") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "清单检查记录(旬检)统计") -// public Object statisticsListCheckTenday() throws Exception{ -// Map map = new HashMap(); -// String errInfo = "success"; -// PageData pd = new PageData(); -// pd = this.getPageData(); -// String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件 -// if (Tools.notEmpty(KEYWORDS)) -// pd.put("KEYWORDS", KEYWORDS.trim()); -// -// System.out.println(pd.getString("KEYWORDS")); -// List varList = listcheckitemService.listAll(pd); -// PageData data = listmanagerService.findById(pd); //根据ID读取 -// data.put("YEAR", pd.getString("YEAR")); -// List recordList = checkrecordService.statisticsListCheckTenday(data);//获取检查周期内的检查记录 -// -// map.put("pd", data); -// map.put("varList", varList); -// map.put("recordList", recordList); -// map.put("result", errInfo); -// return map; -// } + + /**启用 + * @param out + * @throws Exception + */ + @RequestMapping(value="/enable") + // @RequiresPermissions("listmanager:del") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "启用") + public Object enable() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + customService.enable(pd); + pd = customService.findById(pd); + // 启用清单时,修改禁用清单时间段的结束时间 + PageData disPd = new PageData(); + disPd.put("CUSTOM_ID", pd.get("CUSTOM_ID")); + disPd.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + disPd = customDisableTimeService.findByList(pd); + disPd.put("ENDTIME", DateUtil.date2Str(new Date())); + disPd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + disPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + customDisableTimeService.editEndTime(disPd); + // 修改清单统计 + if(pd.get("TYPE") != null && Tools.notEmpty(pd.get("TYPE").toString())) { + if("listType0005".equals(pd.get("TYPE").toString())) { + pd.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键 + pd.put("STARTTIME", pd.get("START_DATE").toString()+" 00:00:00"); + pd.put("ENDTIME", pd.get("END_DATE").toString()+" 23:59:59"); + pd.put("PERIOD", null); + PageData statistics = customStatisticsService.findByCondition(pd); + if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+2); + customStatisticsService.edit(statistics); + } + pd.put("ISSTATISTICS", '1'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd); + } else { + if(pd.get("PERIOD") != null && Tools.notEmpty(pd.get("PERIOD").toString())) { + String period = pd.get("PERIOD").toString(); + switch (period) { + case "checkPeriod0001"://每日 + pd.put("STARTTIME", DateUtil.getDay()+" 00:00:00"); + pd.put("ENDTIME", DateUtil.getDay()+" 23:59:59"); + break; + + case "checkPeriod0002"://每周 + pd.put("STARTTIME", DateUtil.getWeekStart()); + pd.put("ENDTIME", DateUtil.getWeekEnd()); + break; + + case "checkPeriod0003"://每旬 + String year = DateUtil.getYear().toString(); + String month = DateUtil.getMonth().toString(); + Integer day = Integer.parseInt(DateUtil.getOnlyDay().toString()); + String startTime = year + "-" + month + "-"; + String endTime = year + "-" + month + "-"; + if(day <= 10) { + startTime = startTime+"01 00:00:00"; + endTime = endTime+"10 23:59:59"; + } else if(day > 10 && day <= 20) { + startTime = startTime+"11 00:00:00"; + endTime = endTime+"20 23:59:59"; + } else { + startTime = startTime+"21 00:00:00"; + endTime = DateUtil.getMonthEndDay()+" 23:59:59"; + } + pd.put("STARTTIME", startTime); + pd.put("ENDTIME", endTime); + break; + + case "checkPeriod0004"://每月 + pd.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00"); + pd.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59"); + break; + + case "checkPeriod0005"://每季 + pd.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00"); + pd.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59"); + break; + + case "checkPeriod0006"://每年 + pd.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00"); + pd.put("ENDTIME", DateUtil.getCurrYearLast()+" 23:59:59"); + break; + + case "checkPeriod0007"://半年 + String byear = DateUtil.getYear().toString(); + Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString()); + if(bmonth <= 6) { + pd.put("STARTTIME", byear+"-01-01 00:00:00"); + pd.put("ENDTIME", byear+"-06-30 23:59:59"); + } else if(bmonth > 6) { + pd.put("STARTTIME", byear+"-07-01 00:00:00"); + pd.put("ENDTIME", byear+"-12-31 23:59:59"); + } + break; + + default: + break; + } + } + PageData statistics = customStatisticsService.findByCondition(pd); + if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())+1); + customStatisticsService.edit(statistics); + } + + pd.put("ISSTATISTICS", '1'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd); + } + } + // 将本频率内已检查的记录,改为不计入 + map.put("result", errInfo); //返回结果 + return map; + } + } diff --git a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml index 119f1e6..76426a6 100644 --- a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml +++ b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml @@ -1514,6 +1514,9 @@ + + and "1" = #{pd.LIST_TYPE} + order by f.USER_ID= #{pd.orderUserId} desc ,f.DEPARTMENT_ID asc,f.OPERATTIME desc ) union (select @@ -1550,6 +1553,106 @@ and f.CORPINFO_ID = #{pd.CORPINFO_ID} + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + and + ((f.DEPARTMENT_ID in ( + select + SUB_DEPARTMENT_ID + from + oa_supervision_department osd + where + osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID} + and osd.ISDELETE = '0' + and osd.CORPINFO_ID = #{pd.CORPINFO_ID} + )) or ( + f.DEPARTMENT_ID in + + '${item}' + + )) + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + and + (f.DEPARTMENT_ID in ( + select + SUB_DEPARTMENT_ID + from + oa_supervision_department osd + where + osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID} + and osd.ISDELETE = '0' + and osd.CORPINFO_ID = #{pd.CORPINFO_ID}) + or f.USER_ID = #{pd.USER_ID}) + + + + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + and f.USER_ID = #{pd.USER_ID} + and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID} + + + + + + and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%') @@ -1562,10 +1665,10 @@ - AND getCheckedNum(f.LISTMANAGER_ID) > 0 + AND getStandardCheckedNum(f.CUSTOM_ID) > 0 - AND getCheckedNum(f.LISTMANAGER_ID) = 0 + AND getStandardCheckedNum(f.CUSTOM_ID) = 0 @@ -1581,6 +1684,9 @@ + + and "2" = #{pd.LIST_TYPE} + order by f.USER_ID= #{pd.orderUserId} desc ,f.DEPARTMENT_ID asc,f.OPERATTIME desc ) diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml index 5cc32e5..431e77c 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml @@ -97,7 +97,10 @@ and bhci.ISDELETE = 0 and f.COMMON_STATUS = 1 and bhci.COMMON_ITEM_STATUS = 1 - + and ( f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE}),'%') + or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE2}),'%') + or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE3}),'%') + or f.INDUSTRY_TYPE_TREE LIKE CONCAT(CONCAT('%', #{pd.CORP_TYPE4}),'%') ) and ( diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml index 7f8f143..1464666 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml @@ -4,7 +4,7 @@ - BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME + BUS_HIDDENDANGERCHECKSTANDARD_DISABLETIME @@ -15,7 +15,7 @@ f.CUSTOMDISABLETIME_ID, - f.CUSTOM_ID + f.CUSTOM_ID, f.CORPINFO_ID, f.STARTTIME, f.ENDTIME, @@ -80,7 +80,7 @@ update set - LISTMANAGER_ID = #{LISTMANAGER_ID}, + CUSTOM_ID = #{CUSTOM_ID}, CORPINFO_ID = #{CORPINFO_ID}, STARTTIME = #{STARTTIME}, ENDTIME = #{ENDTIME},