From 0602963d2f9922e008b43f51ccc99865326c4e14 Mon Sep 17 00:00:00 2001 From: zhangyanli Date: Wed, 31 Jan 2024 11:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=8E=92=E6=9F=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommonController.java | 3 +- .../CustomController.java | 486 +++-- .../StandardDictionaryController.java | 1 - .../CustomCheckRecordMapper.java | 177 ++ .../CustomDisableTimeMapper.java | 75 + .../CustomMapper.java | 1 + .../CustomStatisticsMapper.java | 108 ++ .../CustomCheckRecordService.java | 178 ++ .../CustomDisableTimeService.java | 68 + .../CustomService.java | 36 + .../CustomStatisticsService.java | 110 ++ .../impl/CustomCheckRecordServiceImpl.java | 794 ++++++++ .../impl/CustomDisableTimeServiceImpl.java | 106 ++ .../impl/CustomServiceImpl.java | 49 + .../impl/CustomStatisticsServiceImpl.java | 157 ++ .../CommonMapper.xml | 3 +- .../CustomCheckRecordMapper.xml | 1610 +++++++++++++++++ .../CustomDisableTimeMapper.xml | 180 ++ .../CustomMapper.xml | 332 +++- 19 files changed, 4218 insertions(+), 256 deletions(-) create mode 100644 src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckRecordService.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomDisableTimeService.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomStatisticsService.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckRecordServiceImpl.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomDisableTimeServiceImpl.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java create mode 100644 src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml create mode 100644 src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java index ae1d755..ab942e1 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CommonController.java @@ -45,7 +45,8 @@ public class CommonController extends BaseController { String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 - pd = corpinfoService.findById(pd); //根据ID读取 + PageData corpinfo = corpinfoService.findById(pd); //根据ID读取 + pd.put("CORP_TYPE_NAME", corpinfo.getString("CORP_TYPE_NAME")); 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 f0b94d7..97a8305 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java @@ -5,23 +5,23 @@ import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.logs.LogAnno; import com.zcloud.service.check.*; -import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService; -import com.zcloud.service.hiddenDangerCheckStandard.CustomService; +import com.zcloud.service.hiddenDangerCheckStandard.*; import com.zcloud.service.offduty.OffDutyService; import com.zcloud.service.risk.IdentificationPartsService; -import com.zcloud.service.risk.RiskPointService; -import com.zcloud.service.statistics.ListStatisticsService; import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.UsersService; +import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; import com.zcloud.util.Warden; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,17 +41,15 @@ public class CustomController extends BaseController { @Autowired private CustomItemService customItemService; @Autowired - private ListCheckItemService listcheckitemService; + private CustomDisableTimeService customDisableTimeService; @Autowired private DepartmentService departmentService; @Autowired - private CheckRecordService checkrecordService; + private CustomCheckRecordService customCheckRecordService; @Autowired private RecordItemService recordItemService; @Autowired - private RiskPointService riskpointService; - @Autowired - private ListStatisticsService listStatisticsService; + private CustomStatisticsService customStatisticsService; @Autowired private IdentificationPartsService identificationPartsService; @Autowired @@ -97,17 +95,145 @@ public class CustomController extends BaseController { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); - PageData npd = new PageData(); pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - if(Tools.notEmpty(KEYWORDS))npd.put("KEYWORDS", KEYWORDS.trim()); - List varList = customService.listAll(pd); + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = customService.list(page); map.put("varList", varList); map.put("result", errInfo); return map; } + + /**禁用 + * @param out + * @throws Exception + */ + @RequestMapping(value="/delete") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "禁用") + public Object delete() 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.delete(pd); + pd = customService.findById(pd); + // 记录清单禁用开始时间 + + PageData disPd = new PageData(); + disPd = this.getPageData(); + disPd.put("CUSTOMDISABLETIME_ID", this.get32UUID()); //主键 + disPd.put("CUSTOM_ID", pd.get("CUSTOM_ID")); + disPd.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + disPd.put("STARTTIME", DateUtil.date2Str(new Date())); //开始时间 + disPd.put("ISDELETE", "0"); //是否删除 0 未删除 1已删除 + disPd.put("OPERATOR", Jurisdiction.getUsername()); //操作人 + disPd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作时间 + disPd.put("CREATOR", Jurisdiction.getUsername()); //创建人 + disPd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间 + customDisableTimeService.save(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("LISTSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2); + customStatisticsService.edit(statistics); + } + pd.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + 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("LISTSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1); + customStatisticsService.edit(statistics); + } + + pd.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd); + } + } + // 将本频率内已检查的记录,改为不计入 + map.put("result", errInfo); //返回结果 + return map; + } + + // /**列表 // * @param page // * @throws Exception @@ -317,173 +443,173 @@ public class CustomController extends BaseController { // map.put("result", errInfo); // return map; // } -// -// /**批量删除 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/deleteAll") -// @RequiresPermissions("listmanager:del") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除") -// public Object deleteAll() throws Exception{ -// Map map = new HashMap(); -// 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(","); -// for(int i = 0; i < ArrayDATA_IDS.length; i++) { -// PageData pd1 = new PageData(); -// pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人 -// pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 -// pd1.put("LISTMANAGER_ID", ArrayDATA_IDS[i]); -// listmanagerService.remove(pd1); -// pd1 = listmanagerService.findById(pd1); -// if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) { -// if("listType0005".equals(pd1.get("TYPE").toString())) { -// pd1.put("LISTSTATISTICS_ID", this.get32UUID()); //主键 -// pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00"); -// pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59"); -// pd1.put("PERIOD", null); -// PageData statistics = listStatisticsService.findByCondition(pd1); -// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) { -// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2); -// listStatisticsService.edit(statistics); -// } -// pd1.put("ISSTATISTICS", '0'); -// // 本期已检查的不计入统计 -// checkrecordService.editStatistics(pd1); -// } else { -// if(pd1.get("PERIOD") != null && Tools.notEmpty(pd1.get("PERIOD").toString())) { -// String period = pd1.get("PERIOD").toString(); -// switch (period) { -// case "checkPeriod0001"://每日 -// pd1.put("STARTTIME", DateUtil.getDay()+" 00:00:00"); -// pd1.put("ENDTIME", DateUtil.getDay()+" 23:59:59"); -// break; -// -// case "checkPeriod0002"://每周 -// pd1.put("STARTTIME", DateUtil.getWeekStart()); -// pd1.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"; -// } -// pd1.put("STARTTIME", startTime); -// pd1.put("ENDTIME", endTime); -// break; -// -// case "checkPeriod0004"://每月 -// pd1.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00"); -// pd1.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59"); -// break; -// -// case "checkPeriod0005"://每季 -// pd1.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00"); -// pd1.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59"); -// break; -// -// case "checkPeriod0006"://每年 -// pd1.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00"); -// pd1.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) { -// pd1.put("STARTTIME", byear+"-01-01 00:00:00"); -// pd1.put("ENDTIME", byear+"-06-30 23:59:59"); -// } else if(bmonth > 6) { -// pd1.put("STARTTIME", byear+"-07-01 00:00:00"); -// pd1.put("ENDTIME", byear+"-12-31 23:59:59"); -// } -// break; -// -// default: -// break; -// } -// } -// PageData statistics = listStatisticsService.findByCondition(pd1); -// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) { -// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1); -// listStatisticsService.edit(statistics); -// } -// -// pd1.put("ISSTATISTICS", '0'); -// // 本期已检查的不计入统计 -// checkrecordService.editStatistics(pd1); -// } -// } -// } -// errInfo = "success"; -// }else{ -// errInfo = "error"; -// } -// map.put("result", errInfo); //返回结果 -// return map; -// } -// -// /**批量删除 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/deleteAlltemp") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除") -// public Object deleteAlltemp() throws Exception{ -// Map map = new HashMap(); -// 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(","); -// for(int i = 0; i < ArrayDATA_IDS.length; i++) { -// PageData pd1 = new PageData(); -// pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人 -// pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 -// pd1.put("LISTMANAGER_ID", ArrayDATA_IDS[i]); -// listmanagerService.deleted(pd1); -// pd1 = listmanagerService.findById(pd1); -// if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) { -// pd1.put("LISTSTATISTICS_ID", this.get32UUID()); //主键 -// pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00"); -// pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59"); -// pd1.put("PERIOD", null); -// PageData statistics = listStatisticsService.findByCondition(pd1); -// if(statistics != null && statistics.get("LISTSTATISTICS_ID") != null) { -// statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1); -// listStatisticsService.edit(statistics); -// } -// pd1.put("ISSTATISTICS", '0'); -// // 本期已检查的不计入统计 -// checkrecordService.editStatistics(pd1); -// } -// } -// errInfo = "success"; -// }else{ -// errInfo = "error"; -// } -// map.put("result", errInfo); //返回结果 -// return map; -// } + + /**批量删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/deleteAll") + @RequiresPermissions("listmanager:del") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除") + public Object deleteAll() throws Exception{ + Map map = new HashMap(); + 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(","); + for(int i = 0; i < ArrayDATA_IDS.length; i++) { + PageData pd1 = new PageData(); + pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd1.put("CUSTOM_ID", ArrayDATA_IDS[i]); + customService.remove(pd1); + pd1 = customService.findById(pd1); + if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) { + if("listType0005".equals(pd1.get("TYPE").toString())) { + pd1.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键 + pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00"); + pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59"); + pd1.put("PERIOD", null); + PageData statistics = customStatisticsService.findByCondition(pd1); + if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-2); + customStatisticsService.edit(statistics); + } + pd1.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd1); + } else { + if(pd1.get("PERIOD") != null && Tools.notEmpty(pd1.get("PERIOD").toString())) { + String period = pd1.get("PERIOD").toString(); + switch (period) { + case "checkPeriod0001"://每日 + pd1.put("STARTTIME", DateUtil.getDay()+" 00:00:00"); + pd1.put("ENDTIME", DateUtil.getDay()+" 23:59:59"); + break; + + case "checkPeriod0002"://每周 + pd1.put("STARTTIME", DateUtil.getWeekStart()); + pd1.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"; + } + pd1.put("STARTTIME", startTime); + pd1.put("ENDTIME", endTime); + break; + + case "checkPeriod0004"://每月 + pd1.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00"); + pd1.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59"); + break; + + case "checkPeriod0005"://每季 + pd1.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00"); + pd1.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59"); + break; + + case "checkPeriod0006"://每年 + pd1.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00"); + pd1.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) { + pd1.put("STARTTIME", byear+"-01-01 00:00:00"); + pd1.put("ENDTIME", byear+"-06-30 23:59:59"); + } else if(bmonth > 6) { + pd1.put("STARTTIME", byear+"-07-01 00:00:00"); + pd1.put("ENDTIME", byear+"-12-31 23:59:59"); + } + break; + + default: + break; + } + } + PageData statistics = customStatisticsService.findByCondition(pd1); + if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1); + customStatisticsService.edit(statistics); + } + + pd1.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd1); + } + } + } + errInfo = "success"; + }else{ + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } + + /**批量删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/deleteAlltemp") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "批量删除") + public Object deleteAlltemp() throws Exception{ + Map map = new HashMap(); + 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(","); + for(int i = 0; i < ArrayDATA_IDS.length; i++) { + PageData pd1 = new PageData(); + pd1.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd1.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd1.put("CUSTOM_ID", ArrayDATA_IDS[i]); + customService.deleted(pd1); + pd1 = customService.findById(pd1); + if(pd1.get("TYPE") != null && Tools.notEmpty(pd1.get("TYPE").toString())) { + pd1.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键 + pd1.put("STARTTIME", pd1.get("START_DATE").toString()+" 00:00:00"); + pd1.put("ENDTIME", pd1.get("END_DATE").toString()+" 23:59:59"); + pd1.put("PERIOD", null); + PageData statistics = customStatisticsService.findByCondition(pd1); + if(statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) { + statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString())-1); + customStatisticsService.edit(statistics); + } + pd1.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd1); + } + } + errInfo = "success"; + }else{ + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } // // /**导出到excel // * @param @@ -735,7 +861,7 @@ public class CustomController extends BaseController { // planMap.put(pageData.getString("type_bianma") + "," + pageData.getString("level_bianma") + "," + pageData.getString("period_bianma"),pageData); // } // //企业所有应查数 -// List staList = listStatisticsService.listAllForPlan(pd); +// List staList = customStatisticsService.listAllForPlan(pd); // for (PageData pageData : staList) { // String rowName = pageData.getString("TYPE") + "," + pageData.getString("level_bianma") + "," + pageData.getString("PERIOD"); // PageData row = planMap.get(rowName); diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/StandardDictionaryController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/StandardDictionaryController.java index cf8fadb..c41e1fa 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/StandardDictionaryController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/StandardDictionaryController.java @@ -34,7 +34,6 @@ public class StandardDictionaryController extends BaseController { * @throws Exception */ @RequestMapping(value = "/list") - @RequiresPermissions("hiddendictionary:list") @ResponseBody public Object list() throws Exception { Map map = new HashMap(); diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.java new file mode 100644 index 0000000..1474581 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.java @@ -0,0 +1,177 @@ +package com.zcloud.mapper.datasource.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单检查记录 + * 作者:luoxiaobao + * 时间:2021-01-04 + * 官网:www.zcloudchina.com + */ +public interface CustomCheckRecordMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**清单逾期检查记录数 + * @param pd + * @throws Exception + */ + int countOverTime(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + + /**查询节假日分页 + * @param page + * @throws Exception + */ + List listlistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + List findRiskPointByLId(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + List listAllUnfinished(PageData pd); + + /* 统计功能 */ + List listCountDay(PageData pd);/* 统计日 */ + List listCountWeek(PageData pd);/* 统计周 */ + List listCountTenDays(PageData pd);/* 统计旬 */ + List listCountMonth(PageData pd);/* 统计功月 */ + List listCountQuarter(PageData pd);/* 统计季 */ + List listCountHalfYear(PageData pd);/* 统计半年 */ + List listCountYear(PageData pd);/* 统计年 */ + Integer listCountJjr(PageData pd);/* 统计节假日 */ + + + /**修改统计状态 + * @param pd + * @throws Exception + */ + void editStatistics(PageData pd); + + /** + * 查询辨识部位检查记录 + * @param pd + * @return + */ + List listLogByIde(PageData pd); + + /** + * 指定辨识部位检查记录 + * @param pd + * @return + */ + List recordByIde(PageData pd); + + /**补录 + * @param pd + * @throws Exception + */ + void recording(PageData pd); + + + /** + * APP清单检查记录 + * @param pd + * @return + */ + List appdatalist(PageData pd); + + /** + * 统计各用户各类型检查数据 + * @param pd + * @return + */ + List countByPeriodUser(PageData pd); + + /** + * 查询公司检查过清单的员工总数 + * @param pd + * @return + */ + int getWorkedUserCount(PageData pd); + + /** + * 查询公司检查过清单的部门总数 + * @param pd + * @return + */ + public int getWorkedDepCount(PageData pd); + + List listTypeBi(PageData pd); + + List listForDocking(PageData pd); + void updateDocking(PageData pageData); + + /** + * 查询检查记录(按ids) + * @param pd + * @return + */ + List listForIdsAndMonth(PageData pd); + + List anaysis(PageData util); + + PageData findByNumber(PageData condition); + + /** + * 清单检查记录(日检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForDay(PageData pd); + + /** + * 清单检查记录(周检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForWeek(PageData pd); + + /** + * 清单检查记录(旬检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForTenday(PageData pd); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.java new file mode 100644 index 0000000..9e28a47 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.java @@ -0,0 +1,75 @@ +package com.zcloud.mapper.datasource.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单-检查项关联 + * 作者:luoxiaobao + * 时间:2020-12-31 + * 官网:www.zcloudchina.com + */ +public interface CustomDisableTimeMapper { + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void editEndTime(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**查找完整数据 + * @param pd + * @throws Exception + */ + List listByFull(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**通过清单获取数据 + * @param pd + * @throws Exception + */ + PageData findByList(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomMapper.java index 64cf8a0..9ef2d0c 100644 --- a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomMapper.java @@ -54,6 +54,7 @@ public interface CustomMapper { * @throws Exception */ List datalistPage(Page page); + List stopdatalistPage(Page page); /**列表(全部) diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.java new file mode 100644 index 0000000..62f3c07 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.java @@ -0,0 +1,108 @@ +package com.zcloud.mapper.datasource.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单统计记录 + * 作者:luoxiaobao + * 时间:2021-01-27 + * 官网:www.zcloudchina.com + */ +public interface CustomStatisticsMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void deletewl(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List getCountList(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**定时器查询 + * @param pd + * @throws Exception + */ + PageData findByCondition(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + PageData getTimeAstrict(PageData pd); + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + List countStaByUser(PageData pd); + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + List countSta(PageData pd); + + /**检查情况列表 + * @param pd + * @throws Exception + */ + List checkSituation(PageData pd); + + /**人员应处理清单个数(节假日清单数算1) + * @param pd + * @throws Exception + */ + List countListStaByUser(PageData pd); + /**人员应处理清单数(各周期) + * @param pd + * @throws Exception + */ + List countByPeriodUser(PageData pd); + + List listAllForPlan(PageData pd); +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckRecordService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckRecordService.java new file mode 100644 index 0000000..c5646f5 --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckRecordService.java @@ -0,0 +1,178 @@ +package com.zcloud.service.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单检查记录 + * 作者:luoxiaobao + * 时间:2021-01-04 + * 官网:www.zcloudchina.com + */ +public interface CustomCheckRecordService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**清单逾期检查记录数 + * @param pd + * @throws Exception + */ + public int countOverTime(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + + + + /**节假日分页 + * @param page + * @throws Exception + */ + public List listAllList(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**列表(全部未完成的) + * @param pd + * @throws Exception + */ + public List listAllUnfinished(PageData pd)throws Exception; + /**通过清单ID获取风险点数据 + * @param pd + * @throws Exception + */ + public List findRiskPointByLId(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + + /* 统计功能 */ + public List listCountDay(PageData pd)throws Exception;/* 统计日 */ + public List listCountWeek(PageData pd)throws Exception;/* 统计周 */ + public List listCountTenDays(PageData pd)throws Exception;/* 统计旬 */ + public List listCountMonth(PageData pd)throws Exception;/* 统计功月 */ + public List listCountQuarter(PageData pd)throws Exception;/* 统计季 */ + public List listCountHalfYear(PageData pd)throws Exception;/* 统计半年 */ + public List listCountYear(PageData pd)throws Exception;/* 统计年 */ + public Integer listCountJjr(PageData pd)throws Exception;/* 统计节假日 */ + + /**修改统计状态 + * @param pd + * @throws Exception + */ + public void editStatistics(PageData pd)throws Exception; + + /** + * 查询辨识部位检查记录 + * @param pd + * @return + */ + public List listLogByIde(PageData pd)throws Exception; + + /** + * 指定辨识部位检查记录 + * @param pd + * @return + */ + public List recordByIde(PageData pd)throws Exception; + + /**补录 + * @param pd + * @throws Exception + */ + public void recording(PageData pd)throws Exception; + + /** + * APP清单检查记录 + * @param pd + * @return + */ + public List appdatalist(PageData pd)throws Exception; + /** + * 统计各用户各类型检查数据 + * @param pd + * @return + */ + public List countByPeriodUser(PageData pd)throws Exception; + + /** + * 查询公司检查过清单的员工总数 + * @param pd + * @return + */ + public int getWorkedUserCount(PageData pd) throws Exception; + + /** + * 查询公司检查过清单的部门总数 + * @param pd + * @return + */ + public int getWorkedDepCount(PageData pd)throws Exception; + + public List listTypeBi(PageData pd)throws Exception; + + /** + * 查询检查记录(按ids) + * @param pd + * @return + */ + public List listForIdsAndMonth(PageData pd)throws Exception; + + /** + * 清单检查记录(日检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForDay(PageData pd)throws Exception; + + /** + * 清单检查记录(周检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForWeek(PageData pd)throws Exception; + + /** + * 清单检查记录(旬检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List statisticsListCheckTenday(PageData pd)throws Exception; +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomDisableTimeService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomDisableTimeService.java new file mode 100644 index 0000000..7b4234e --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomDisableTimeService.java @@ -0,0 +1,68 @@ +package com.zcloud.service.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +public interface CustomDisableTimeService { + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void editEndTime(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**查找完整数据 + * @param pd + * @throws Exception + */ + public List listByFull(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**通过清单获取数据 + * @param pd + * @throws Exception + */ + public PageData findByList(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; +} diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java index 9f299fa..c4860b2 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java @@ -1,5 +1,6 @@ package com.zcloud.service.hiddenDangerCheckStandard; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import java.util.List; @@ -24,5 +25,40 @@ public interface CustomService { */ public List listAll(PageData pd)throws Exception; + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**禁用 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void remove(PageData pd)throws Exception; + + /**彻底删除 + * @param pd + * @throws Exception + */ + public void deleted(PageData pd)throws Exception; + + /**启用 + * @param pd + * @throws Exception + */ + public void enable(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomStatisticsService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomStatisticsService.java new file mode 100644 index 0000000..7862c0f --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomStatisticsService.java @@ -0,0 +1,110 @@ +package com.zcloud.service.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单统计记录 + * 作者:luoxiaobao + * 时间:2021-01-27 + * 官网:www.zcloudchina.com + */ +public interface CustomStatisticsService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void deletewl(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List getCountList(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + /**定时器查询 + * @param pd + * @throws Exception + */ + public PageData findByCondition(PageData pd)throws Exception; + + + public PageData getTimeAstrict(PageData pd)throws Exception; + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + public List countStaByUser(PageData pd)throws Exception; + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + public List countSta(PageData pd)throws Exception; + + /**检查情况列表 + * @param pd + * @throws Exception + */ + public List checkSituation(PageData pd)throws Exception; + /**人员应处理清单个数(节假日清单数算1) + * @param pd + * @throws Exception + */ + public List countListStaByUser(PageData pd)throws Exception; + + /**人员应处理清单数(各周期) + * @param pd + * @throws Exception + */ + public List countByPeriodUser(PageData pd)throws Exception; + + public List listAllForPlan(PageData pd)throws Exception; +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckRecordServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckRecordServiceImpl.java new file mode 100644 index 0000000..587a385 --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckRecordServiceImpl.java @@ -0,0 +1,794 @@ +package com.zcloud.service.hiddenDangerCheckStandard.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomCheckRecordMapper; +import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService; +import com.zcloud.util.DateSysUtil; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 说明:清单检查记录 + * 作者:luoxiaobao + * 时间:2021-01-04 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class CustomCheckRecordServiceImpl implements CustomCheckRecordService { + + @Autowired + private CustomCheckRecordMapper customCheckRecordMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + customCheckRecordMapper.save(pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + customCheckRecordMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + customCheckRecordMapper.edit(pd); + } + + /**清单逾期检查记录数 + * @param pd + * @throws Exception + */ + public int countOverTime(PageData pd)throws Exception{ + return customCheckRecordMapper.countOverTime(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return customCheckRecordMapper.datalistPage(page); + } + + + /**节假日分页 + * @param page + * @throws Exception + */ + public List listAllList(Page page)throws Exception{ + return customCheckRecordMapper.listlistPage(page); + } + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return customCheckRecordMapper.listAll(pd); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAllUnfinished(PageData pd)throws Exception{ + return customCheckRecordMapper.listAllUnfinished(pd); + } + /**通过清单ID获取风险点数据 + * @param pd + * @throws Exception + */ + public List findRiskPointByLId(PageData pd)throws Exception{ + return customCheckRecordMapper.findRiskPointByLId(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return customCheckRecordMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + customCheckRecordMapper.deleteAll(ArrayDATA_IDS); + } + + + /* 统计功能 */ + @Override + public List listCountDay(PageData pd) throws Exception { + return customCheckRecordMapper.listCountDay(pd); + } + + @Override + public List listCountWeek(PageData pd) throws Exception { + return customCheckRecordMapper.listCountWeek(pd); + } + + @Override + public List listCountTenDays(PageData pd) throws Exception { + return customCheckRecordMapper.listCountTenDays(pd); + } + + @Override + public List listCountMonth(PageData pd) throws Exception { + return customCheckRecordMapper.listCountMonth(pd); + } + + @Override + public List listCountQuarter(PageData pd) throws Exception { + return customCheckRecordMapper.listCountQuarter(pd); + } + + @Override + public List listCountHalfYear(PageData pd) throws Exception { + return customCheckRecordMapper.listCountHalfYear(pd); + } + + @Override + public List listCountYear(PageData pd) throws Exception { + return customCheckRecordMapper.listCountYear(pd); + } + + @Override + public Integer listCountJjr(PageData pd) throws Exception { + return customCheckRecordMapper.listCountJjr(pd); + } + + /**修改统计状态 + * @param pd + * @throws Exception + */ + public void editStatistics(PageData pd)throws Exception{ + customCheckRecordMapper.editStatistics(pd); + } + + /** + * 查询辨识部位检查记录 + * @param pd + * @return + */ + public List listLogByIde(PageData pd)throws Exception{ + return customCheckRecordMapper.listLogByIde(pd); + } + + /** + * 指定辨识部位检查记录 + * @param pd + * @return + */ + public List recordByIde(PageData pd)throws Exception{ + return customCheckRecordMapper.recordByIde(pd); + } + + /**补录 + * @param pd + * @throws Exception + */ + public void recording(PageData pd)throws Exception{ + customCheckRecordMapper.recording(pd); + } + + /**APP清单检查记录 + * @param page + * @throws Exception + */ + public List appdatalist(PageData pd)throws Exception{ + return customCheckRecordMapper.appdatalist(pd); + } + + /**统计各用户各类型检查数据 + * @param page + * @throws Exception + */ + public List countByPeriodUser(PageData pd)throws Exception{ + return customCheckRecordMapper.countByPeriodUser(pd); + } + + /** + * 查询公司检查过清单的员工总数 + * @param pd + * @return + */ + public int getWorkedUserCount(PageData pd) throws Exception{ + return customCheckRecordMapper.getWorkedUserCount(pd); + } + + /** + * 查询公司检查过清单的部门总数 + * @param pd + * @return + */ + public int getWorkedDepCount(PageData pd)throws Exception{ + return customCheckRecordMapper.getWorkedDepCount(pd); + } + + public List listTypeBi(PageData pd)throws Exception{ + return customCheckRecordMapper.listTypeBi(pd); + } + + /** + * 查询检查记录(按ids) + * @param pd + * @return + */ + public List listForIdsAndMonth(PageData pd)throws Exception{ + return customCheckRecordMapper.listForIdsAndMonth(pd); + } + + /** + * 清单检查记录(日检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForDay(PageData pd)throws Exception { + List list = new ArrayList<>(); + List recordList = customCheckRecordMapper.listAllYearForDay(pd); + List trList = new ArrayList<>(); + for (int i = 0; i < 12; i++) { + PageData month = new PageData(); + month.put("MONTH",(i+1)+""); + List dayList = new ArrayList<>(); + List tdList = new ArrayList<>(); + int days = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")), i); + for (int j = 1; j <= days; j++) { + PageData day = new PageData(); + day.put("DAY", j+""); + day.put("CHECKDATA","△"); // 默认离岗 + String curDay = pd.getString("YEAR") + "-" + ((i+1) <= 9 ? "0"+(i+1) : (i+1)) + "-" + (j <= 9 ? ("0"+j) : j); + //清单生成日期在遍历日期之后(未建立清单) + if (DateSysUtil.fomatDate(pd.getString("CREATTIME").substring(0,10)).after(DateSysUtil.fomatDate(curDay))) { + day.put("CHECKDATA","-"); + } + else { + for (PageData r : recordList) { + if (curDay.equals(r.getString("PERIODSTART").substring(0,10))) { + if ("1".equals(r.getString("TYPE"))) { + day.put("CHECKDATA", "√"); // 已检查(隐患数) + break; + } else if ("2".equals(r.getString("TYPE"))) { + day.put("CHECKDATA","×"); // 未排查 + break; + } + } + } + } + dayList.add(day); + if (j % 7 == 0) { + PageData dayPd = new PageData(); + dayPd.put("DAYLIST", dayList); + tdList.add(dayPd); + dayList = new ArrayList<>(); + } + } + if (dayList.size() > 0) { + PageData dayPd = new PageData(); + dayPd.put("DAYLIST", dayList); + tdList.add(dayPd); + } + String curMonth = pd.getString("YEAR") + "-" + ((i+1) <= 9 ? "0"+(i+1) : (i+1)); + List hdList = new ArrayList<>(); + recordList.forEach(record -> { + if(DateSysUtil.isSameMonth(record.getString("CREATTIME"),curMonth)) {//如果清单创建时间是查询月 + String hddesc = record.getString("HIDDEN_DESC"); + if (StringUtils.isNotBlank(hddesc)) { + String[] hddescArr = hddesc.split("[$]"); + for (int k = 0; k < hddescArr.length; k++) { + hdList.add(hddescArr[k]); + } + } + } + }); + month.put("HDLIST", hdList); + month.put("TDLIST", tdList); + trList.add(month); + if (i!=0 && (i+1) % 2 == 0) { + PageData tr = new PageData(); + tr.put("TRLIST", trList); + list.add(tr); + trList = new ArrayList<>(); + } + } + if (trList.size() > 0) { + PageData tr = new PageData(); + tr.put("TRLIST", trList); + list.add(tr); + } + return list; + } + + /** + * 清单检查记录(周检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List listAllYearForWeek(PageData pd)throws Exception { + List list = new ArrayList<>(); + List recordList = customCheckRecordMapper.listAllYearForWeek(pd); + recordList.forEach( record -> { + String week = DateSysUtil.getMonthNoAndWeekNo(record.getString("PERIODSTART")); // 按照排查任务的周期开始时间计算该任务是哪月第几周,例如:12,2 + record.put("RECORD_WEEK", week); + }); + String listWeek = DateSysUtil.getMonthNoAndWeekNo(pd.getString("CREATTIME")); + int index = 0, colIndex0 = 0, colIndex2 = 0, colIndex3 = 0, colIndex4 = 0, colIndex5 = 0; + for (int z = 0; z < 24; z++) { + List trList = new ArrayList<>(); + PageData col0 = new PageData(); + col0.put("VALUETYPE","string"); + col0.put("COLSPAN",2); + col0.put("ROWSPAN",1); + switch (index){ + case 0: + col0.put("VALUE","月份"); + trList.add(col0); + for (int i = 1; i <= 3; i++) { + PageData month = new PageData(); + month.put("VALUETYPE","string"); + month.put("VALUE", (colIndex0 * 3 + i) + "月"); + month.put("COLSPAN", 5); + month.put("ROWSPAN", 1); + trList.add(month); + } + colIndex0++; + break; + case 1: + col0.put("VALUE","检查日期"); + trList.add(col0); + for (int i = 1; i <= 3; i++) { + for (int j = 1; j <= 5; j++) { + PageData week = new PageData(); + week.put("VALUETYPE","string"); + week.put("VALUE", "第" + j + "周"); + week.put("COLSPAN", 1); + week.put("ROWSPAN", 1); + trList.add(week); + } + } + break; + case 2: + col0.put("VALUE","检查情况"); + col0.put("COLSPAN",1); + col0.put("ROWSPAN",4); + trList.add(col0); + PageData col1 = new PageData(); + col1.put("VALUETYPE","string"); + col1.put("VALUE","是否检查"); + col1.put("COLSPAN",1); + col1.put("ROWSPAN",1); + trList.add(col1); + for (int i = 1; i <= 3; i++) { + for (int j = 1; j <= 5; j++) { + int month = colIndex2 * 3 + i; + String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j; + PageData col = new PageData(); + col.put("VALUETYPE","string"); + col.put("COLSPAN", 1); + col.put("ROWSPAN", 1); + col.put("VALUE","△"); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) { + col.put("VALUE","-"); + } + else { + for (PageData r : recordList) { + if (curWeek.equals(r.getString("RECORD_WEEK"))) { + if ("1".equals(r.getString("TYPE"))) { + col.put("VALUE", "√"); // 已检查(隐患数) + break; + } else if ("2".equals(r.getString("TYPE"))) { + col.put("VALUE","×"); // 未排查 + break; + } + } + } + } + trList.add(col); + } + } + colIndex2++; + break; + case 3: + col0.put("VALUE","发现隐患数"); + col0.put("COLSPAN",1); + col0.put("ROWSPAN",1); + trList.add(col0); + PageData col = new PageData(); + col.put("VALUETYPE","array"); + col.put("COLSPAN", 15); + col.put("ROWSPAN", 1); + for (int i = 1; i <= 3; i++) { + for (int j = 1; j <= 5; j++) { + int month = colIndex3 * 3 + i; + String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j; + PageData col01 = new PageData(); + col01.put("VALUETYPE","string"); + col01.put("COLSPAN", 1); + col01.put("ROWSPAN", 1); + col01.put("VALUE","0"); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) { + col01.put("VALUE","0"); + } + else { + int hiddenCount = 0; + for (PageData r : recordList) { + if (curWeek.equals(r.getString("RECORD_WEEK"))) { + if ("1".equals(r.getString("TYPE"))) { + hiddenCount += Integer.parseInt(r.getString("HIDDEN_COUNT")); +// col01.put("VALUE", r.getString("HIDDEN_COUNT")); // 已检查(隐患数) + } else if ("2".equals(r.getString("TYPE"))) { + hiddenCount = 0; +// col01.put("VALUE","0"); // 未排查 + break; + } + } + } + col01.put("VALUE",hiddenCount); // 未排查 + } + trList.add(col01); + } + } +// trList.add(col); + colIndex3++; + break; + case 4: + col0.put("VALUE","检查时间"); + col0.put("COLSPAN",1); + trList.add(col0); + col = new PageData(); + col.put("VALUETYPE","array"); + col.put("COLSPAN", 15); + col.put("ROWSPAN", 1); + for (int i = 1; i <= 3; i++) { + for (int j = 1; j <= 5; j++) { + int month = colIndex4 * 3 + i; + String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j; + PageData col01 = new PageData(); + col01.put("VALUETYPE","string"); + col01.put("COLSPAN", 1); + col01.put("ROWSPAN", 1); + col01.put("VALUE",""); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (Integer.parseInt(listWeek.replace(",",""))>Integer.parseInt(curWeek.replace(",",""))) { + col01.put("VALUE",""); + } + else { + for (PageData r : recordList) { + if (curWeek.equals(r.getString("RECORD_WEEK"))) { + if ("1".equals(r.getString("TYPE"))) { + col01.put("VALUE", r.getString("CREATTIME")); // 已检查(隐患数) + break; + } else if ("2".equals(r.getString("TYPE"))) { + col01.put("VALUE",""); // 未排查 + break; + } + } + } + } + trList.add(col01); + } + } +// trList.add(col); + colIndex4++; + break; + case 5: + col0.put("VALUE","发现问题"); + col0.put("COLSPAN",1); + trList.add(col0); + PageData col02 = new PageData(); + for (int i = 1; i <= 3; i++) { + List descList = new ArrayList<>(); + col02 = new PageData(); + col02.put("VALUETYPE","array"); + col02.put("COLSPAN", 5); + col02.put("ROWSPAN", 1); +// for (int j = 1; j <= 5; j++) { + int month = colIndex5 * 3 + i; +// String curWeek = pd.getString("YEAR") + "," + (month <= 9 ? "0"+month : month) + "," + j; + String curMonth = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month); + for (PageData r : recordList) { +// if (curWeek.equals(r.getString("RECORD_WEEK")) && StringUtils.isNotBlank(r.getString("HIDDENDESCR"))) { + if (DateSysUtil.isSameMonth(r.getString("PERIODSTART"),curMonth) && StringUtils.isNotBlank(r.getString("HIDDENDESCR"))) { + String[] hddescArr = r.getString("HIDDENDESCR").split("[$]"); + for (int k = 0; k < hddescArr.length; k++) { + descList.add(hddescArr[k]); + } + } + } +// } + col02.put("VALUE",descList); + trList.add(col02); + } + colIndex5++; + break; + } + PageData tr = new PageData(); + tr.put("TRLIST", trList); + list.add(tr); + + index++; + if (index==6) { index = 0;} + } + return list; + } + + /** + * 清单检查记录(旬检)统计(按清单ID统计指定年内检查情况) + * @param pd + * @return + */ + public List statisticsListCheckTenday(PageData pd)throws Exception { + List list = new ArrayList<>(); + List recordList = customCheckRecordMapper.listAllYearForTenday(pd); + String[] tendayList = {"上旬", "中旬", "下旬"}; + String listCreateDate = pd.getString("CREATTIME").substring(0, 10); + int index = 0, colIndex0 = 0, colIndex2 = 0, colIndex3 = 0, colIndex4 = 0, colIndex5 = 0; + for (int z = 0; z < 24; z++) { + List trList = new ArrayList<>(); + PageData col0 = new PageData(); + col0.put("VALUETYPE","string"); + col0.put("COLSPAN",2); + col0.put("ROWSPAN",1); + switch (index){ + case 0: + col0.put("VALUE","月份"); + trList.add(col0); + for (int i = 1; i <= 3; i++) { + PageData month = new PageData(); + month.put("VALUETYPE","string"); + month.put("VALUE", (colIndex0 * 3 + i) + "月"); + month.put("COLSPAN", 3); + month.put("ROWSPAN", 1); + trList.add(month); + } + colIndex0++; + break; + case 1: + col0.put("VALUE","检查日期"); + trList.add(col0); + for (int i = 1; i <= 3; i++) { + for (int j = 0; j < tendayList.length; j++) { + PageData week = new PageData(); + week.put("VALUETYPE","string"); + week.put("VALUE", tendayList[j]); + week.put("COLSPAN", 1); + week.put("ROWSPAN", 1); + trList.add(week); + } + } + break; + case 2: + col0.put("VALUE","检查情况"); + col0.put("COLSPAN",1); + col0.put("ROWSPAN",4); + trList.add(col0); + PageData col1 = new PageData(); + col1.put("VALUETYPE","string"); + col1.put("VALUE","是否检查"); + col1.put("COLSPAN",1); + col1.put("ROWSPAN",1); + trList.add(col1); + for (int i = 1; i <= 3; i++) { + for (int j = 0; j < tendayList.length; j++) { + int month = colIndex2 * 3 + i; + String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month); + String dateBegin = "", dateEnd = ""; + if (j == 0) { + dateBegin = curTendy + "-01"; + dateEnd = curTendy + "-10"; + } else if (j == 1) { + dateBegin = curTendy + "-11"; + dateEnd = curTendy + "-20"; + } else { + dateBegin = curTendy + "-21"; + int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1); + dateEnd = curTendy + "-" + lastDays; + } + + PageData col = new PageData(); + col.put("VALUETYPE","string"); + col.put("COLSPAN", 1); + col.put("ROWSPAN", 1); + col.put("VALUE","△"); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) { + col.put("VALUE","-"); + }else { + for (PageData r : recordList) { + if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() + && DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) { + if ("1".equals(r.getString("TYPE"))) { + col.put("VALUE","√"); // 已检查(隐患数) + break; + } else if ("2".equals(r.getString("TYPE"))) { + col.put("VALUE","×"); // 未排查 + break; + } + } + } + } + trList.add(col); + } + } + colIndex2++; + break; + case 3: + col0.put("VALUE","发现隐患数"); + col0.put("COLSPAN",1); + trList.add(col0); + PageData col = new PageData(); + col.put("VALUETYPE","array"); + col.put("COLSPAN", 9); + col.put("ROWSPAN", 1); + for (int i = 1; i <= 3; i++) { + for (int j = 0; j < tendayList.length; j++) { + int month = colIndex3 * 3 + i; + String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month); + String dateBegin = "", dateEnd = ""; + if (j == 0) { + dateBegin = curTendy + "-01"; + dateEnd = curTendy + "-10"; + } else if (j == 1) { + dateBegin = curTendy + "-11"; + dateEnd = curTendy + "-20"; + } else { + dateBegin = curTendy + "-21"; + int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1); + dateEnd = curTendy + "-" + lastDays; + } + + PageData col2 = new PageData(); + col2.put("VALUETYPE","string"); + col2.put("COLSPAN", 1); + col2.put("ROWSPAN", 1); + col2.put("VALUE","0"); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) { + col2.put("VALUE","0"); + }else { + int hiddenCount = 0; + for (PageData r : recordList) { + if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() + && DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) { + if ("1".equals(r.getString("TYPE"))) { + hiddenCount += Integer.parseInt(r.getString("HIDDEN_COUNT")); +// col2.put("VALUE",r.getString("HIDDEN_COUNT")); // 已检查(隐患数) + } else if ("2".equals(r.getString("TYPE"))) { + hiddenCount = 0; + break; + } + } + } + col2.put("VALUE",hiddenCount); // 未排查 + } + trList.add(col2); + } + } + colIndex3++; + break; + case 4: + col0.put("VALUE","检查时间"); + col0.put("COLSPAN",1); + trList.add(col0); + col = new PageData(); + col.put("VALUETYPE","array"); + col.put("COLSPAN", 9); + col.put("ROWSPAN", 1); + for (int i = 1; i <= 3; i++) { + for (int j = 0; j < tendayList.length; j++) { + int month = colIndex4 * 3 + i; + String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month); + String dateBegin = "", dateEnd = ""; + if (j == 0) { + dateBegin = curTendy + "-01"; + dateEnd = curTendy + "-10"; + } else if (j == 1) { + dateBegin = curTendy + "-11"; + dateEnd = curTendy + "-20"; + } else { + dateBegin = curTendy + "-21"; + int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1); + dateEnd = curTendy + "-" + lastDays; + } + + PageData col2 = new PageData(); + col2.put("VALUETYPE","string"); + col2.put("COLSPAN", 1); + col2.put("ROWSPAN", 1); + col2.put("VALUE",""); // 默认离岗 + //清单生成日期在遍历日期之后(未建立清单) + if (DateSysUtil.fomatDate(listCreateDate).getTime()>DateSysUtil.fomatDate(dateEnd).getTime()) { + col2.put("VALUE",""); + }else { + for (PageData r : recordList) { + if (DateSysUtil.fomatDate(dateBegin).getTime() <= DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() + && DateSysUtil.fomatDate(r.getString("PERIODSTART").substring(0, 10)).getTime() <= DateSysUtil.fomatDate(dateEnd).getTime()) { + if ("1".equals(r.getString("TYPE"))) { + col2.put("VALUE",r.getString("CREATTIME")); // 已检查(隐患数) + break; + } else if ("2".equals(r.getString("TYPE"))) { + col2.put("VALUE",""); // 未排查 + break; + } + } + } + } + trList.add(col2); + } + } + colIndex4++; + break; + case 5: + col0.put("VALUE","发现问题"); + col0.put("COLSPAN",1); + trList.add(col0); + PageData col02 = new PageData(); + for (int i = 1; i <= 3; i++) { + col02 = new PageData(); + col02.put("VALUETYPE","array"); + col02.put("COLSPAN", 3); + col02.put("ROWSPAN", 1); + for (int j = 0; j < tendayList.length; j++) { + List descList = new ArrayList<>(); + + int month = colIndex5 * 3 + i; + String curTendy = pd.getString("YEAR") + "-" + (month <= 9 ? "0"+month : month); + String dateBegin = "", dateEnd = ""; + if (j == 0) { + dateBegin = curTendy + "-01"; + dateEnd = curTendy + "-10"; + } else if (j == 1) { + dateBegin = curTendy + "-11"; + dateEnd = curTendy + "-20"; + } else { + dateBegin = curTendy + "-21"; + int lastDays = DateSysUtil.getMonthDays(Integer.parseInt(pd.getString("YEAR")),month-1); + dateEnd = curTendy + "-" + lastDays; + } + for (PageData r : recordList) { + if (DateSysUtil.isSameMonth(r.getString("PERIODSTART"),dateBegin.substring(0,7)) + && StringUtils.isNotBlank(r.getString("HIDDENDESCR")) ) { + String[] hddescArr = r.getString("HIDDENDESCR").split("[$]"); + for (int k = 0; k < hddescArr.length; k++) { + descList.add(hddescArr[k]); + } + } + } + col02.put("VALUE",descList); + } + trList.add(col02); + } + colIndex5++; + break; + } + PageData tr = new PageData(); + tr.put("TRLIST", trList); + list.add(tr); + + index++; + if (index==6) { index = 0;} + } + return list; + } +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomDisableTimeServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomDisableTimeServiceImpl.java new file mode 100644 index 0000000..831e50d --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomDisableTimeServiceImpl.java @@ -0,0 +1,106 @@ +package com.zcloud.service.hiddenDangerCheckStandard.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomDisableTimeMapper; +import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.ListCheckStandardItemMapper; +import com.zcloud.service.hiddenDangerCheckStandard.CustomDisableTimeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:清单管理 + * 作者:luoxiaobao + * 时间:2020-12-30 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class CustomDisableTimeServiceImpl implements CustomDisableTimeService { + @Autowired + private CustomDisableTimeMapper customDisableTimeMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + customDisableTimeMapper.save(pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + customDisableTimeMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + customDisableTimeMapper.edit(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void editEndTime(PageData pd)throws Exception{ + customDisableTimeMapper.editEndTime(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return customDisableTimeMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return customDisableTimeMapper.listAll(pd); + } + + /**查找完整数据 + * @param pd + * @throws Exception + */ + public List listByFull(PageData pd)throws Exception{ + return customDisableTimeMapper.listByFull(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return customDisableTimeMapper.findById(pd); + } + + /**通过清单获取数据 + * @param pd + * @throws Exception + */ + public PageData findByList(PageData pd)throws Exception{ + return customDisableTimeMapper.findByList(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + customDisableTimeMapper.deleteAll(ArrayDATA_IDS); + } + +} diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java index 6d7c4fe..f76c04b 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java @@ -1,5 +1,6 @@ package com.zcloud.service.hiddenDangerCheckStandard.impl; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomMapper; import com.zcloud.service.hiddenDangerCheckStandard.CustomService; @@ -38,6 +39,54 @@ public class CustomServiceImpl implements CustomService { public List listAll(PageData pd)throws Exception{ return customMapper.listAll(pd); } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return customMapper.datalistPage(page); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + customMapper.delete(pd); + } + + /**禁用 + * @param pd + * @throws Exception + */ + public void remove(PageData pd)throws Exception{ + customMapper.remove(pd); + } + + /**彻底删除 + * @param pd + * @throws Exception + */ + public void deleted(PageData pd)throws Exception{ + customMapper.deleted(pd); + } + + /**启用 + * @param pd + * @throws Exception + */ + public void enable(PageData pd)throws Exception{ + customMapper.enable(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return customMapper.findById(pd); + } } diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java new file mode 100644 index 0000000..c6d3dbe --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java @@ -0,0 +1,157 @@ +package com.zcloud.service.hiddenDangerCheckStandard.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomStatisticsMapper; +import com.zcloud.service.hiddenDangerCheckStandard.CustomStatisticsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:清单统计记录 + * 作者:luoxiaobao + * 时间:2021-01-27 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class CustomStatisticsServiceImpl implements CustomStatisticsService { + + @Autowired + private CustomStatisticsMapper customStatisticsMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + customStatisticsMapper.save(pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + customStatisticsMapper.delete(pd); + } + /**删除 + * @param pd + * @throws Exception + */ + public void deletewl(PageData pd)throws Exception{ + customStatisticsMapper.deletewl(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + customStatisticsMapper.edit(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return customStatisticsMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return customStatisticsMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return customStatisticsMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + customStatisticsMapper.deleteAll(ArrayDATA_IDS); + } + + /**定时器查询 + * @param pd + * @throws Exception + */ + @Override + public PageData findByCondition(PageData pd) throws Exception { +/* PageData ls = new PageData(); + List lsList = customStatisticsMapper.findByCondition(pd); + if(lsList != null && lsList.size() > 0) { + ls = lsList.get(0); + }*/ + return customStatisticsMapper.findByCondition(pd); + } + + @Override + public List getCountList(PageData pd) throws Exception { + return customStatisticsMapper.getCountList(pd); + } + + @Override + public PageData getTimeAstrict(PageData pd) throws Exception { + return customStatisticsMapper.getTimeAstrict(pd); + } + + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + public List countStaByUser(PageData pd)throws Exception{ + return customStatisticsMapper.countStaByUser(pd); + } + + /**人员应处理清单数 + * @param pd + * @throws Exception + */ + public List countSta(PageData pd)throws Exception{ + return customStatisticsMapper.countSta(pd); + } + + /**检查情况列表 + * @param pd + * @throws Exception + */ + public List checkSituation(PageData pd)throws Exception{ + return customStatisticsMapper.checkSituation(pd); + } + + /**人员应处理清单个数(节假日清单数算1) + * @param pd + * @throws Exception + */ + public List countListStaByUser(PageData pd)throws Exception{ + return customStatisticsMapper.countListStaByUser(pd); + } + /**人员应处理清单数(各周期) + * @param pd + * @throws Exception + */ + public List countByPeriodUser(PageData pd)throws Exception{ + return customStatisticsMapper.countByPeriodUser(pd); + } + + public List listAllForPlan(PageData pd)throws Exception{ + return customStatisticsMapper.listAllForPlan(pd); + } +} + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml index f37f9e2..94c2bbf 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CommonMapper.xml @@ -96,7 +96,8 @@ f.ISDELETE = 0 and bhci.ISDELETE = 0 and f.COMMON_STATUS = 1 - and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} + and bhci.COMMON_ITEM_STATUS = 1 + and ( diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml new file mode 100644 index 0000000..6eb5b48 --- /dev/null +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml @@ -0,0 +1,1610 @@ + + + + + + + bus_hiddendangercheckstandard_checkrecord + + + + + SYS_DICTIONARIES + + + + + f.CUSTOM_ID, + f.CORPINFO_ID, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, + f.ISDELETE, + f.LONGITUDE, + f.LATITUDE, + f.CHECKRECORD_ID, + f.CHECK_TIME, + f.REASON, + f.DESCR, + f.FINISHED, + f.TYPE, + f.PERIODSTART, + f.PERIODEND, + f.ISSTATISTICS + + + + + LISTMANAGER_ID, + LIST_NAME, + CORPINFO_ID, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + ISDELETE, + LONGITUDE, + LATITUDE, + CHECKRECORD_ID, + CHECK_TIME, + REASON, + DESCR, + FINISHED, + TYPE, + PERIODSTART, + PERIODEND, + ISSTATISTICS + + + + + #{LISTMANAGER_ID}, + #{LIST_NAME}, + #{CORPINFO_ID}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{ISDELETE}, + #{LONGITUDE}, + #{LATITUDE}, + #{CHECKRECORD_ID}, + #{CHECK_TIME}, + #{REASON}, + #{DESCR}, + #{FINISHED}, + #{TYPE}, + #{PERIODSTART}, + #{PERIODEND}, + #{ISSTATISTICS} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + CHECKRECORD_ID = #{CHECKRECORD_ID} + + + + + update + + set + FINISHED=#{FINISHED}, + CHECK_TIME=#{CHECK_TIME}, + + PERIODSTART=#{PERIODSTART}, + + + PERIODEND=#{PERIODEND}, + + DESCR=#{DESCR}, + CHECKRECORD_ID = CHECKRECORD_ID + where + CHECKRECORD_ID = #{CHECKRECORD_ID} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + CHECKRECORD_ID in + + #{item} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update + + set + ISSTATISTICS= #{ISSTATISTICS} + where + LISTMANAGER_ID = #{LISTMANAGER_ID} + AND + DATE_FORMAT( CHECK_TIME, '%Y-%m-%d ' ) between DATE_FORMAT( #{STARTTIME}, '%Y-%m-%d' ) AND DATE_FORMAT( #{ENDTIME}, '%Y-%m-%d' ) + AND + CORPINFO_ID = #{CORPINFO_ID} + + + + + update + + set + + CREATOR = #{CREATOR}, + + + OPERATOR = #{OPERATOR}, + + + DESCR = #{DESCR}, + + + LONGITUDE = #{LONGITUDE}, + + + LATITUDE = #{LATITUDE}, + + + CHECK_TIME = #{CHECK_TIME}, + + + ISSTATISTICS = #{ISSTATISTICS}, + + + REASON = #{REASON}, + + + TYPE = #{TYPE}, + + CHECKRECORD_ID = CHECKRECORD_ID + where + CHECKRECORD_ID = #{CHECKRECORD_ID} + + + + + + + + + + + + + + + + + update + BUS_CHECKRECORD + set + IS_DOCKING = 1 + where + CHECKRECORD_ID = #{CHECKRECORD_ID} + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml new file mode 100644 index 0000000..7f8f143 --- /dev/null +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomDisableTimeMapper.xml @@ -0,0 +1,180 @@ + + + + + + + BUS_HIDDENDANGERCHECKSTANDARD_CUSTOMDISABLETIME + + + + + SYS_DICTIONARIES + + + + + f.CUSTOMDISABLETIME_ID, + f.CUSTOM_ID + f.CORPINFO_ID, + f.STARTTIME, + f.ENDTIME, + f.ISDELETE, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME + + + + + CUSTOM_ID, + CORPINFO_ID, + STARTTIME, + ENDTIME, + ISDELETE, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + CUSTOMDISABLETIME_ID + + + + + #{CUSTOM_ID}, + #{CORPINFO_ID}, + #{STARTTIME}, + #{ENDTIME}, + #{ISDELETE}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{CUSTOMDISABLETIME_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID} + + + + + update + + set + LISTMANAGER_ID = #{LISTMANAGER_ID}, + CORPINFO_ID = #{CORPINFO_ID}, + STARTTIME = #{STARTTIME}, + ENDTIME = #{ENDTIME}, + CUSTOMDISABLETIME_ID = CUSTOMDISABLETIME_ID + where + CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID} + + + + + update + + set + ENDTIME = #{ENDTIME}, + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + CUSTOMDISABLETIME_ID = #{CUSTOMDISABLETIME_ID} + + + + + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + CUSTOMDISABLETIME_ID in + + #{item} + + + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml index acfbc88..e859278 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml @@ -16,64 +16,73 @@ f.CUSTOM_ID, + f.NAME, + f.PERIOD, + f.TYPE, f.CORPINFO_ID, - f.INDUSTRY_TYPE, - f.INDUSTRY_TYPE_TREE, - f.INDUSTRY_TYPE_NAMES, - f.CHECK_STANDARD_NAME, - f.COMMON_STATUS, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, f.ISDELETE, - f.CREATOR_ID, - f.CREATOR_NAME, - f.CREATE_TIME, - f.OPERATOR_ID, - f.OPERATOR_NAME, - f.OPERATE_TIME, - f.DELETEOR_ID, - f.DELETEOR_NAME, - f.DELETE_TIME + f.DEPARTMENT_ID, + f.POST_ID, + f.USER_ID, + f.START_DATE, + f.END_DATE, + f.SCREENTYPE, + f.BAO_BAO_DEPARTMENT_ID, + f.BAO_BAO_USER_ID, + f.BAO_BAO_TYPE, + f.TASK_TYPE CUSTOM_ID, + NAME, + PERIOD, + TYPE, CORPINFO_ID, - INDUSTRY_TYPE, - INDUSTRY_TYPE_TREE, - INDUSTRY_TYPE_NAMES, - CHECK_STANDARD_NAME, - COMMON_STATUS, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, ISDELETE, - CREATOR_ID, - CREATOR_NAME, - CREATE_TIME, - OPERATOR_ID, - OPERATOR_NAME, - OPERATE_TIME, - DELETEOR_ID, - DELETEOR_NAME, - DELETE_TIME + DEPARTMENT_ID, + POST_ID, + USER_ID, + START_DATE, + END_DATE, + SCREENTYPE, + BAO_BAO_DEPARTMENT_ID, + BAO_BAO_USER_ID, + BAO_BAO_TYPE, + TASK_TYPE #{CUSTOM_ID}, + #{NAME}, + #{PERIOD}, + #{TYPE}, #{CORPINFO_ID}, - #{INDUSTRY_TYPE}, - #{INDUSTRY_TYPE_TREE}, - #{INDUSTRY_TYPE_NAMES}, - #{CHECK_STANDARD_NAME}, - #{COMMON_STATUS}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, #{ISDELETE}, - #{CREATOR_ID}, - #{CREATOR_NAME}, - #{CREATE_TIME}, - #{OPERATOR_ID}, - #{OPERATOR_NAME}, - #{OPERATE_TIME}, - #{DELETEOR_ID}, - #{DELETEOR_NAME}, - #{DELETE_TIME} + #{DEPARTMENT_ID}, + #{POST_ID}, + #{USER_ID}, + #{START_DATE}, + #{END_DATE}, + #{SCREENTYPE}, + #{BAO_BAO_DEPARTMENT_ID}, + #{BAO_BAO_USER_ID}, + #{BAO_BAO_TYPE}, + #{TASK_TYPE} @@ -90,43 +99,220 @@ + + + + + + update + + set + ISDELETE = '1' + + ,OPERATTIME =#{OPERATTIME} + + + ,OPERATOR =#{OPERATOR} + + where + CUSTOM_ID = #{CUSTOM_ID} + + + + + update + + set + ISDELETE = '2' + + ,OPERATTIME =#{OPERATTIME} + + + ,OPERATOR =#{OPERATOR} + + where + CUSTOM_ID = #{CUSTOM_ID} + + + + + update + + set + ISDELETE = '-1' + + ,OPERATTIME =#{OPERATTIME} + + + ,OPERATOR =#{OPERATOR} + + where + CUSTOM_ID = #{CUSTOM_ID} + + + + update + + set + ISDELETE = '0' + + ,OPERATTIME =#{OPERATTIME} + + + ,OPERATOR =#{OPERATOR} + + where + CUSTOM_ID = #{CUSTOM_ID} + + + +