From 9a81906a53b3612135e306b2e68135d7aa62d0e0 Mon Sep 17 00:00:00 2001 From: zhangyanli Date: Thu, 1 Feb 2024 08:37:20 +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=A3240201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check/ListManagerController.java | 185 +- .../CustomCheckRecordController.java | 1482 +++++++++++++++++ .../CustomController.java | 910 +++++----- .../CustomHiddenController.java | 26 +- .../datasource/check/ListManagerMapper.java | 8 +- .../CustomCheckUserMapper.java | 78 + .../CustomItemMapper.java | 51 + .../service/check/ListManagerService.java | 11 + .../check/impl/ListManagerServiceImpl.java | 16 + .../CustomCheckUserService.java | 78 + .../CustomItemService.java | 51 +- .../CustomService.java | 41 +- .../impl/CustomCheckUserServiceImpl.java | 109 ++ .../impl/CustomItemServiceImpl.java | 64 + .../impl/CustomServiceImpl.java | 30 + .../impl/CustomStatisticsServiceImpl.java | 5 - .../datasource/check/ListManagerMapper.xml | 922 ++++++++++ .../CustomCheckRecordMapper.xml | 63 +- .../CustomCheckUserMapper.xml | 248 +++ .../CustomHiddenMapper.xml | 2 +- .../CustomItemMapper.xml | 139 +- .../CustomMapper.xml | 228 +++ .../CustomStatisticsMapper.xml | 477 ++++++ 23 files changed, 4769 insertions(+), 455 deletions(-) create mode 100644 src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckUserService.java create mode 100644 src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckUserServiceImpl.java create mode 100644 src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.xml create mode 100644 src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.xml diff --git a/src/main/java/com/zcloud/controller/check/ListManagerController.java b/src/main/java/com/zcloud/controller/check/ListManagerController.java index 880a2cc..5eec737 100644 --- a/src/main/java/com/zcloud/controller/check/ListManagerController.java +++ b/src/main/java/com/zcloud/controller/check/ListManagerController.java @@ -7,6 +7,7 @@ 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.CustomService; import com.zcloud.service.offduty.OffDutyService; import com.zcloud.service.risk.IdentificationPartsService; import com.zcloud.service.risk.RiskPointService; @@ -61,6 +62,9 @@ public class ListManagerController extends BaseController { private UsersService usersService; @Autowired private OffDutyService offdutyService; + @Autowired + private CustomService customService; + /**新增 * @param * @throws Exception @@ -941,7 +945,7 @@ public class ListManagerController extends BaseController { }else { list.put("stateMy", "1"); } - + list.put("List_type", "1"); //清单种类:风险管控清单 } map.put("varList", varList); map.put("page", page); @@ -1023,6 +1027,81 @@ public class ListManagerController extends BaseController { return map; } + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/riskStandardRecordList") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "列表") + public Object riskStandardRecordList(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + PageData npd = new PageData(); + pd = this.getPageData(); + npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 +// pd.put("POST_ID", Jurisdiction.getPOST_ID()); //岗位 + pd.put("USER_ID", Jurisdiction.getUSER_ID()); + npd.put("ISMAIN", Jurisdiction.getIS_MAIN()); + npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE()); + npd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID()); + PageData cpd = new PageData(); + cpd = usersService.findById(pd); + npd.put("ISLEADER", cpd.getString("ISLEADER")); + if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){ + String DEPARTMENT_ID = npd.getString("DEPARTMENT_ID"); + String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID); + ids=npd.getString("DEPARTMENT_ID")+","+ids; //把自己部门插入进去 + if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) { + ids = ids.substring(0,ids.lastIndexOf(",")); + npd.put("DEPARTMENT_IDS", ids.split(",")); + }else { + npd.put("DEPARTMENT_IDS", DEPARTMENT_ID); + } + }else { + if(npd.getString("ISMAIN").equals("0")){ + npd.put("USER_ID",Jurisdiction.getUSER_ID()); + } + } + String DEPTIDS = pd.getString("DEPTIDS"); + if(Tools.notEmpty(DEPTIDS)) { + String DEPT_IDS[] = DEPTIDS.split(","); + npd.put("DEPT_IDS", DEPT_IDS); + } + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))npd.put("KEYWORDS", KEYWORDS.trim()); + String STARTTIME = pd.getString("STARTTIME"); //关键词检索条件 + if(Tools.notEmpty(STARTTIME))npd.put("STARTTIME", STARTTIME.trim() + " 00:00:00"); + String ENDTIME = pd.getString("ENDTIME"); //关键词检索条件 + if(Tools.notEmpty(ENDTIME))npd.put("ENDTIME", ENDTIME.trim() + " 23:59:59"); + npd.put("ISDELETE",pd.getString("ISDELETE")); + npd.put("USERNAME",pd.getString("USERNAME")); + npd.put("STATUS",pd.getString("STATUS")); + npd.put("PERIOD",pd.getString("PERIOD")); + npd.put("OVERTIME",pd.getString("OVERTIME")); + npd.put("WORKSTATUS",pd.getString("WORKSTATUS")); + npd.put("LISTINGLEVEL",pd.getString("LISTINGLEVEL")); + npd.put("TYPE",pd.getString("TYPE")); + npd.put("HASHIDDEN",pd.getString("HASHIDDEN")); + npd.put("RISKCHECKLISTTYPE",pd.getString("RISKCHECKLISTTYPE")); + page.setPd(npd); + List varList = listmanagerService.riskStandardRecordList(page); //列出ListManager列表 + for (PageData list : varList) { + String userId= list.getString("USER_ID"); + if(userId.equals(Jurisdiction.getUSER_ID())) { + list.put("stateMy", "0"); + }else { + list.put("stateMy", "1"); + } + } + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + /**去修改页面获取数据 * @param * @throws Exception @@ -1734,4 +1813,108 @@ public class ListManagerController extends BaseController { map.put("result", errInfo); return map; } + + /**清单排查列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/riskStandardCheckList") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单排查",instructionsType = "列表") + public Object riskStandardCheckList(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData isRest = this.getPageData(); + isRest.put("ISREST", "1"); + isRest.put("USER_ID", Jurisdiction.getUSER_ID()); + isRest.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + List restList = offdutyService.listAll(isRest); + if(restList != null && restList.size() > 0) { + // 休假中 + map.put("ISREST", "1"); + } else { + // 正常工作 + map.put("ISREST", "0"); + } + PageData npd = new PageData(); + npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 +// pd.put("POST_ID", Jurisdiction.getPOST_ID()); //岗位 + pd.put("USER_ID", Jurisdiction.getUSER_ID()); + String indexType = pd.getString("indexType"); //关键词检索条件 + if(Tools.notEmpty(indexType))pd.put("indexType", indexType.trim()); + if("1".equals(indexType)) { + npd.put("STATUS", "0"); + String DEPARTMENT_ID = Jurisdiction.getDEPARTMENT_ID(); + npd.put("DEPARTMENT_ID", DEPARTMENT_ID); + } else if("2".equals(indexType)) { + + npd.put("STATUS", "1"); + String DEPARTMENT_ID = Jurisdiction.getDEPARTMENT_ID(); + npd.put("DEPARTMENT_ID", DEPARTMENT_ID); + } else { + String DEPARTMENT_ID = Jurisdiction.getDEPARTMENT_ID(); + String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID); + if(Jurisdiction.getIS_MAIN().equals("0")) { + if(ids!=null && Tools.notEmpty(ids) && ids.lastIndexOf(",")>-1 ) { + ids = ids.substring(0,ids.lastIndexOf(",")); + npd.put("DEPARTMENT_IDS", ids.split(",")); + }else { + npd.put("DEPARTMENT_ID", DEPARTMENT_ID); + } + } + } + + npd.put("orderUserId", Jurisdiction.getUSER_ID()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))npd.put("KEYWORDS", KEYWORDS.trim()); + String USERNAME = pd.getString("USERNAME"); //关键词检索条件 + if(Tools.notEmpty(USERNAME))npd.put("USERNAME", USERNAME.trim()); + npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + npd.put("ISMAIN", Jurisdiction.getIS_MAIN()); + npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE()); + npd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID()); + PageData cpd = new PageData(); + cpd = usersService.findById(pd); + npd.put("ISLEADER", cpd.getString("ISLEADER")); + if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){ + String DEPARTMENT_ID = npd.getString("DEPARTMENT_ID"); + String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID); + ids=npd.getString("DEPARTMENT_ID")+","+ids; //把自己部门插入进去 + if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) { + ids = ids.substring(0,ids.lastIndexOf(",")); + npd.put("DEPARTMENT_IDS", ids.split(",")); + }else { + npd.put("DEPARTMENT_IDS", DEPARTMENT_ID); + } + }else{ + if(npd.getString("ISMAIN").equals("0")){ + npd.put("USER_ID",Jurisdiction.getUSER_ID()); + } + } + String DEPTIDS = pd.getString("DEPTIDS"); + if(Tools.notEmpty(DEPTIDS)) { + String DEPT_IDS[] = DEPTIDS.split(","); + npd.put("DEPT_IDS", DEPT_IDS); + } + npd.put("PERIOD",pd.getString("PERIOD")); + npd.put("STATUS",pd.getString("STATUS")); + npd.put("LISTINGLEVEL",pd.getString("LISTINGLEVEL")); + page.setPd(npd); + List varList = listmanagerService.riskStandardCheckList(page); //列出ListManager列表 + for (PageData list : varList) { + String userId= list.getString("USER_ID"); + if(userId.equals(Jurisdiction.getUSER_ID())) { + list.put("stateMy", "0"); + }else { + list.put("stateMy", "1"); + } + list.put("List_type", "1"); //清单种类:风险管控清单 + } + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } } diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java new file mode 100644 index 0000000..b723380 --- /dev/null +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java @@ -0,0 +1,1482 @@ +package com.zcloud.controller.hiddenDangerCheckStandard; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.logs.LogAnno; +import com.zcloud.service.check.*; +import com.zcloud.service.corp.CorpInfoService; +import com.zcloud.service.hiddenDangerCheckStandard.*; +import com.zcloud.service.offduty.OffDutyService; +import com.zcloud.service.sms.SMSLogService; +import com.zcloud.service.sms.SMSManagementService; +import com.zcloud.service.system.DepartmentService; +import com.zcloud.service.system.ImgFilesService; +import com.zcloud.service.system.UsersService; +import com.zcloud.util.*; +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 org.springframework.web.servlet.ModelAndView; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 说明:清单检查记录 作者:luoxiaobao 时间:2021-01-04 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/customCheckrecord") +public class CustomCheckRecordController extends BaseController { + @Autowired + private CorpInfoService corpinfoService; + @Autowired + private CustomCheckRecordService customCheckRecordService; + @Autowired + private CustomCheckRecordItemService customCheckRecordItemService; + @Autowired + private CustomItemService customItemService; + @Autowired + private CustomHiddenService hiddenService; + @Autowired + private CustomCheckUserService checkuserService; + @Autowired + private CustomStatisticsService listStatisticsService; + @Autowired + private CustomService customService; + @Autowired + private UsersService usersService; + @Autowired + private SMSManagementService smsmanagementService; + @Autowired + private SMSLogService smSlogService; + @Autowired + private DepartmentService departmentService; + @Autowired + private ImgFilesService imgFilesService; + @Autowired + private OffDutyService offDutyService; + @Autowired + private SysDateService sysDateService; + @Autowired + private CustomDisableTimeService customDisableTimeService; + @Autowired + private SendMessageUtil sendMessageUtil; + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + // @RequiresPermissions("checkrecord:add") + @ResponseBody + @Transactional + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单排查",instructionsType = "新增记录") + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData sysdate = new PageData(); + sysdate.put("DATE", pd.get("CHECK_TIME")); + sysdate = sysDateService.findByDate(sysdate); + pd.put("CHECKRECORD_ID", this.get32UUID()); // 主键 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + pd.put("ISDELETE", "0"); // 是否删除 + pd.put("CREATOR", Jurisdiction.getName()); // 添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 创建时间 + pd.put("OPERATOR", Jurisdiction.getName()); // 修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); + pd.put("FINISHED", '1'); + pd.put("ISSTATISTICS", '1'); + pd.put("TYPE", '1'); + pd.put("CUSTOM_ID", pd.get("ID")); + PageData list = customService.findById(pd); + String periodstart = ""; + String periodend = ""; + if(!list.get("TYPE").toString().equals("listType0005")) { + switch (list.get("PERIOD").toString()) { + case "checkPeriod0001": + periodstart = sysdate.getString("DAY_START"); + periodend = sysdate.getString("DAY_END"); + break; + case "checkPeriod0002": + periodstart = sysdate.getString("WEEK_START"); + periodend = sysdate.getString("WEEK_END"); + break; + case "checkPeriod0003": + periodstart = sysdate.getString("XUN_START"); + periodend = sysdate.getString("XUN_END"); + break; + case "checkPeriod0004": + periodstart = sysdate.getString("MONTH_START"); + periodend = sysdate.getString("MONTH_END"); + break; + case "checkPeriod0005": + periodstart = sysdate.getString("QUARTER_START"); + periodend = sysdate.getString("QUARTER_END"); + break; + case "checkPeriod0006": + periodstart = sysdate.getString("YEAR_START"); + periodend = sysdate.getString("YEAR_END"); + break; + case "checkPeriod0007": + periodstart = sysdate.getString("HALFYEAR_START"); + periodend = sysdate.getString("HALFYEAR_END"); + break; + } + pd.put("PERIODSTART", periodstart); + pd.put("PERIODEND", periodend); + } else { + pd.put("PERIODSTART", list.get("START_DATE")); + pd.put("PERIODEND", list.get("END_DATE")); + } + customCheckRecordService.save(pd); + checkuserService.delete(pd); + PageData checkUser = new PageData(); + checkUser.put("CHECKUSER_ID", this.get32UUID()); // 主键 + checkUser.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + checkUser.put("DEPARTMENT_ID", pd.get("CHECKDEPT")); + checkUser.put("USER_ID", pd.get("CHECKOR")); + PageData u = usersService.findUserDept(checkUser); + + checkUser.put("USER_NAME", u.get("USER_NAME")); + checkUser.put("DEPARTMENT_NAME", u.get("DEPARTMENT_NAME")); + + checkuserService.save(checkUser); + if (pd.get("OTHER") != null && !pd.get("OTHER").equals("")) { + List otherList = (List) JSON.parse(pd.get("OTHER").toString()); + for (JSONObject json : otherList) { + if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null + && json.get("USER_ID") != "") { + PageData other = new PageData(); + other.put("CHECKUSER_ID", this.get32UUID()); // 主键 + other.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + other.put("DEPARTMENT_ID", json.get("DEPARTMENT_ID")); + other.put("USER_ID", json.get("USER_ID")); + PageData ou = usersService.findUserDept(other); + + other.put("USER_NAME", ou.get("USER_NAME")); + other.put("DEPARTMENT_NAME", ou.get("DEPARTMENT_NAME")); + + checkuserService.save(other); + } + } + } + if (pd.get("ITEMS") != null && !pd.get("ITEMS").equals("")) { + List itemsList = (List) JSON.parse(pd.get("ITEMS").toString()); + for (JSONObject json : itemsList) { + PageData item = new PageData(); + item.put("RECORDITEM_ID", json.get("RECORDITEM_ID")); // 主键 + item.put("CUSTOM_ITEM_ID", json.get("CUSTOM_ITEM_ID")); + PageData chei = customItemService.findById(item); + item.put("ISNORMAL", json.get("ISNORMAL")); + item.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + item.put("CUSTOM_ID", pd.get("CUSTOM_ID")); + item.put("CHECK_CATEGORY", chei.get("CHECK_CATEGORY")); + item.put("CHECK_CATEGORY_NAME", chei.get("CHECK_CATEGORY_NAME")); + item.put("CHECK_ITEM", chei.get("CHECK_ITEM")); + item.put("CHECK_ITEM_NAME", chei.get("CHECK_ITEM_NAME")); + item.put("CHECK_CONTENT", chei.get("CHECK_CONTENT")); + item.put("CHECK_STANDARD", chei.get("CHECK_STANDARD")); + item.put("REFERENCE_BASIS", chei.get("REFERENCE_BASIS")); + item.put("ISNORMAL", chei.get("ISNORMAL")); + item.put("CHECK_RESULT", chei.get("CHECK_RESULT")); + item.put("COMMON_ITEM_SORT", chei.get("COMMON_ITEM_SORT")); + item.put("LONGITUDE", pd.get("LONGITUDE")); + item.put("LATITUDE", pd.get("LATITUDE")); + item.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + item.put("ISDELETE", "0"); + item.put("CREATOR_ID", Jurisdiction.getUSER_ID()); + item.put("CREATOR_NAME", Jurisdiction.getUsername()); + item.put("CREATOR_TIME", DateUtil.date2Str(new Date())); //删除时间 + customCheckRecordItemService.save(item); + } + } + if (pd.get("IDS") != null && !pd.get("IDS").equals("")) { + String ids = pd.get("IDS").toString(); + String ArrayDATA_IDS[] = ids.split(","); + PageData hiddens = new PageData(); + hiddens.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + hiddens.put("IDS", ArrayDATA_IDS); + hiddenService.updateAll(hiddens); + } + hiddenService.submit(pd); + + hiddenService.submitList(pd);// 其他隐患提交 + + List hList = hiddenService.getHiddenByRecord(pd); + if (hList.size() > 0) { + for (PageData h : hList) { + if ("2".equals(h.get("RECTIFICATIONTYPE").toString())) { + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", h.get("RECTIFICATIONOR"));// 收信人userid + mes.put("templateCode", "SMS_215820677");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "time");// 存入短信模板中的参数名称 + params1.put("value", h.get("RECTIFICATIONDEADLINE"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + + sendMessageUtil.sendMessages(mes, paramsList); + } + } + } + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/delete") + // @RequiresPermissions("checkrecord:del") + @ResponseBody + @Transactional + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "删除检查记录") + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + customCheckRecordService.delete(pd); + customCheckRecordItemService.delete(pd); + map.put("result", errInfo); // 返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + // @RequiresPermissions("checkrecord:edit") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "修改") + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + customCheckRecordService.edit(pd); + map.put("result", errInfo); + return map; + } + + /** + * 获取隐患数据 + * @param + * @throws Exception + */ + @RequestMapping(value = "/findHidden") + @ResponseBody + public Object findHidden() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + map.put("pd",customItemService.findHidden(pd)); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + // @RequiresPermissions("checkrecord:list") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "检查记录列表") + public Object list(Page page) 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()); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + /*PageData ls = listmanagerService.findById(pd); + // 拼接sql语句 + StringBuffer sql = new StringBuffer(); + sql.append("WHERE 1 = 1 "); + // 排除当前周期 + if(ls.get("TYPE") != null && Tools.notEmpty(ls.get("TYPE").toString())) { + if(!"listType0005".equals(ls.get("TYPE").toString())) { + sql.append(" AND ( CONCAT(DATE,'00:00:00') "); + if(ls.get("PERIOD") != null && Tools.notEmpty(ls.get("PERIOD").toString())) { + String period = ls.get("PERIOD").toString(); + String todayDate = ""; + switch (period) { + case "checkPeriod0001"://每日 + todayDate = DateUtil.getDay()+" 00:00:00"; + break; + + case "checkPeriod0002"://每周 + todayDate = DateUtil.getWeekStart(); + 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"; + } + + todayDate = startTime; + break; + + case "checkPeriod0004"://每月 + todayDate = DateUtil.getMonthFirstDay()+" 00:00:00"; + break; + + case "checkPeriod0005"://每季 + todayDate = DateUtil.quarterStart()+" 00:00:00"; + break; + + case "checkPeriod0006"://每年 + todayDate = DateUtil.getCurrYearFirst()+" 00:00:00"; + break; + + case "checkPeriod0007"://半年 + String byear = DateUtil.getYear().toString(); + Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString()); + if(bmonth <= 6) { + todayDate = byear+"-01-01 00:00:00"; + } else if(bmonth > 6) { + todayDate = byear+"-07-01 00:00:00"; + } + break; + + default: + break; + } + sql.append(" < '"+todayDate+"' )"); + } + } + } + // 用户休班列表 + PageData timePd = new PageData(); + timePd.put("USER_ID", ls.get("USER_ID")); + timePd.put("CORPINFO_ID", ls.get("CORPINFO_ID")); + List userRestList = offDutyService.listAll(timePd); + if(userRestList != null && userRestList.size() > 0) { + for(PageData userRest : userRestList) { + sql.append(" AND (DAY_START < '"+userRest.getString("STARTTIME")+" 00:00:00' or DAY_END > '"+userRest.getString("ENDTIME")+" 23:59:59' ) "); + } + } + // 清单禁用列表 + PageData disPd = new PageData(); + disPd.put("LISTMANAGER_ID", ls.get("LISTMANAGER_ID")); + disPd.put("CORPINFO_ID", ls.get("CORPINFO_ID")); + List listDisList = listDisableTimeService.listByFull(disPd); + if(listDisList != null && listDisList.size() > 0) { + for(PageData listDis : listDisList) { + sql.append(" AND (DAY_START < '"+listDis.getString("STARTTIME")+"' or DAY_END > '"+listDis.getString("ENDTIME")+"' ) "); + } + } + List varList = new ArrayList(); + if(ls.getString("TYPE").equals("listType0005")) { + PageData type = new PageData(); + type.put("LISTMANAGER_ID", ls.get("LISTMANAGER_ID")); + type.put("IS_XUN", 1); + type.put("FINISHED", '1'); + type.put("BEGINTIME", ls.getString("START_DATE")+" 00:00:00"); + type.put("ENDTIME", ls.getString("END_DATE")+" 23:59:59"); + page.setPd(type); + varList = customCheckRecordService.listAllList(page); + // 查看节假日清单期间,是否有请假或者停用 + PageData sqlStr = new PageData(); + sqlStr.put("SQL", sql.toString()); + List jjrDate = sysDateService.listAllByJjr(sqlStr); + if(jjrDate != null && jjrDate.size() > 0) {// 节假日期间,若存在非请假活停用日期,则补全 + if(DateUtil.timeCompare(DateUtil.fomatDateTime(ls.getString("END_DATE")+" 23:59:59"),new Date())) { + PageData jjr = new PageData(); + jjr.put("DATESTART", ls.get("START_DATE")+" 00:00:00"); + jjr.put("DATEEND", ls.get("END_DATE")+" 23:59:59"); + if(varList.size() < 2) { + for(int i = varList.size();i <2;i++) { + varList.add(jjr); + } + } + } + } + page.setCurrentPage(1); + page.setShowCount(10); + page.setTotalPage(1); + page.setTotalResult(varList.size()); + } else { + pd.put("LISTDATE", ls.get("CREATTIME")); + pd.put("LISTTYPE", ls.get("PERIOD")); + if(ls.getString("TYPE").equals("listType0005")) { + pd.put("STATUS", "1"); + } + pd.put("ISDELETE", ls.get("ISDELETE")); + pd.put("DELETEDATE", ls.get("OPERATTIME")); + pd.put("SQL", sql.toString()); + page.setPd(pd); + varList = customCheckRecordService.list(page); // 列出CheckRecord列表 + }*/ + page.setPd(pd); + List varList = customCheckRecordService.list(page); + PageData ls = customService.findById(pd); + map.put("varList", varList); + map.put("page", page); + map.put("ls", ls); + map.put("result", errInfo); + return map; + } + + /** + * 清单统计 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/getListConut") + @ResponseBody + public Object getListConut() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List lists = listStatisticsService.getCountList(pd); + + map.put("result", errInfo); + return map; + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "去修改页面获取数据") + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = customCheckRecordService.findById(pd); // 根据ID读取 + PageData condition = new PageData(); + condition.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID")); + PageData listManager = customService.findById(condition); + pd.put("BAO_BAO_TYPE",listManager.getString("BAO_BAO_TYPE")); + PageData users = checkuserService.getCheckUser(pd); + List varList = customCheckRecordItemService.listAll(pd); + if(users != null) { + pd.put("USERS", users.get("USERS")); + } + PageData pd2 = new PageData(); + pd2.put("FOREIGN_KEY",pd.get("CHECKRECORD_ID")); + pd2.put("TYPE","13"); + List qianming = imgFilesService.listAll(pd2); + + + map.put("qianming", qianming); + map.put("varList", varList); + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + @RequestMapping(value = "/goMap") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "获取地图信息") + public Object goMap() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData checkrecord = customCheckRecordService.findById(pd); + List varList = customCheckRecordItemService.listAllForMap(checkrecord); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData cinfo = corpinfoService.findById(pd); + checkrecord.put("FIND_CHECKRECORD_ID", checkrecord.get("CHECKRECORD_ID")); + List hdList = hiddenService.listAll(checkrecord); + map.put("varList", varList); + map.put("hdList", hdList); + map.put("pd", pd); + map.put("cinfo", cinfo); + map.put("checkrecord", checkrecord); + map.put("result", errInfo); + return map; + } + + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + // @RequiresPermissions("checkrecord:del") + @ResponseBody + 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(","); + customCheckRecordService.deleteAll(ArrayDATA_IDS); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("result", errInfo); // 返回结果 + return map; + } + + /** + * 导出到excel + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/excel") + public ModelAndView exportExcel() throws Exception { + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("清单ID"); // 1 + titles.add("清单名称"); // 2 + titles.add("企业"); // 3 + titles.add("添加人"); // 4 + titles.add("创建时间"); // 5 + titles.add("修改人"); // 6 + titles.add("修改时间"); // 7 + titles.add("是否删除"); // 8 + dataMap.put("titles", titles); + List varOList = customCheckRecordService.listAll(pd); + List varList = new ArrayList(); + for (int i = 0; i < varOList.size(); i++) { + PageData vpd = new PageData(); + vpd.put("var1", varOList.get(i).getString("LISTMANAGER_ID")); // 1 + vpd.put("var2", varOList.get(i).getString("LIST_NAME")); // 2 + vpd.put("var3", varOList.get(i).getString("CORPINFO_ID")); // 3 + vpd.put("var4", varOList.get(i).getString("CREATOR")); // 4 + vpd.put("var5", varOList.get(i).getString("CREATTIME")); // 5 + vpd.put("var6", varOList.get(i).getString("OPERATOR")); // 6 + vpd.put("var7", varOList.get(i).getString("OPERATTIME")); // 7 + vpd.put("var8", varOList.get(i).get("ISDELETE").toString()); // 8 + varList.add(vpd); + } + dataMap.put("varList", varList); + ObjectExcelView erv = new ObjectExcelView(); + mv = new ModelAndView(erv, dataMap); + return mv; + } + + public static String getLastDayOfMonth(int year, int month) { + Calendar cal = Calendar.getInstance(); + // 设置年份 + cal.set(Calendar.YEAR, year); + // 设置月份 + cal.set(Calendar.MONTH, month - 1); + // 获取某月最大天数 + int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + // 设置日历中月份的最大天数 + cal.set(Calendar.DAY_OF_MONTH, lastDay); + // 格式化日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String lastDayOfMonth = sdf.format(cal.getTime()); + + return lastDayOfMonth; + } + + /** + * main + */ + public static void main(String[] args) { + Double aDouble = 0d / 1d; + DecimalFormat df = new DecimalFormat("#0.00"); + System.out.println(df.format(aDouble)); + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goBiListCount") + @ResponseBody + public Object goBiListCount() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + + switch (pd.get("COUNTTYPE").toString()) { + case "day":// 每日 + pd.put("STARTTIME", DateUtil.getDay() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getDay() + " 23:59:59"); + break; + + case "week":// 每周 + pd.put("STARTTIME", DateUtil.getWeekStart()); + pd.put("ENDTIME", DateUtil.getWeekEnd()); + break; + + case "xun":// 每旬 + 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 "month":// 每月 + pd.put("STARTTIME", DateUtil.getMonthFirstDay() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getMonthEndDay() + " 23:59:59"); + break; + + case "quarter":// 每季 + pd.put("STARTTIME", DateUtil.quarterStart() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.quarterEnd() + " 23:59:59"); + break; + + case "year":// 每年 + pd.put("STARTTIME", DateUtil.getCurrYearFirst() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getCurrYearLast() + " 23:59:59"); + break; + + case "halfyear":// 半年 + 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; + } +// switch (pd.get("COUNTTYPE").toString()) { +// case "month": +// pd.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00"); +// pd.put("ENDTIME", DateUtil.getMonthEndDay()+" 23:59:59"); +// break; +// case "quarter": +// pd.put("STARTTIME", DateUtil.quarterStart()+" 00:00:00"); +// pd.put("ENDTIME", DateUtil.quarterEnd()+" 23:59:59"); +// break; +// case "year": +// pd.put("STARTTIME", DateUtil.getCurrYearFirst()+" 00:00:00"); +// pd.put("ENDTIME", DateUtil.getCurrYearLast()+" 23:59:59"); +// break; +// +// default: +// break; +// } + String STARTTIME = pd.getString("STARTTIME"); + String ENDTIME = pd.getString("ENDTIME"); + + /* + * List varList = new ArrayList(); PageData listType0001 = + * new PageData(); PageData listType0002 = new PageData(); PageData listType0003 + * = new PageData(); PageData listType0004 = new PageData(); PageData + * listType0005 = new PageData(); + */ + PageData all = new PageData(); + all.put("type", "all"); + all.put("name", "合计"); + all.put("molecule", 0); + all.put("denominator", 0); + all.put("percentage", 0d); + /* + * Map varMap = new HashMap(); + * + * listType0001.put("type", "listType0001"); listType0001.put("name", "日常"); + * listType0001.put("molecule", 0); listType0001.put("denominator", 0); + * listType0001.put("percentage", 0d); listType0002.put("type", "listType0002"); + * listType0002.put("name", "综合"); listType0002.put("molecule", 0); + * listType0002.put("denominator", 0); listType0002.put("percentage", 0d); + * + * + * listType0003.put("type", "listType0003"); listType0003.put("name", "专业"); + * listType0003.put("molecule", 0); listType0003.put("denominator", 0); + * listType0003.put("percentage", 0d); + * + * + * listType0004.put("type", "listType0004"); listType0004.put("name", "季节性"); + * listType0004.put("molecule", 0); listType0004.put("denominator", 0); + * listType0004.put("percentage", 0d); + * + * + * listType0005.put("type", "listType0005"); listType0005.put("name", "节假日"); + * listType0005.put("molecule", 0); listType0005.put("denominator", 0); + * listType0005.put("percentage", 0d); + * + * + * + * + * varMap.put("listType0001", listType0001); varMap.put("listType0002", + * listType0002); varMap.put("listType0003", listType0003); + * varMap.put("listType0004", listType0004); varMap.put("listType0005", + * listType0005); varMap.put("all", all); + */ + + List countList = listStatisticsService.getCountList(pd);// 统计分母 + + if (countList != null && countList.size() > 0) { + int sum = 0; + List dayList = customCheckRecordService.listCountDay(pd); // 统计--日 + if (dayList != null && dayList.size() > 0) { + for (PageData count : dayList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List weekList = customCheckRecordService.listCountWeek(pd); // 统计--周 + if (weekList != null && weekList.size() > 0) { + for (PageData count : weekList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List monthList = customCheckRecordService.listCountMonth(pd); // 统计--月 + + if (monthList != null && monthList.size() > 0) { + for (PageData count : monthList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List quarterList = customCheckRecordService.listCountQuarter(pd); // 统计--季 + + if (quarterList != null && quarterList.size() > 0) { + for (PageData count : quarterList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List halfYearList = customCheckRecordService.listCountHalfYear(pd); // 统计--半年 + + if (halfYearList != null && halfYearList.size() > 0) { + for (PageData count : halfYearList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List yearList = customCheckRecordService.listCountYear(pd); // 统计--年 + if (yearList != null && yearList.size() > 0) { + for (PageData count : yearList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + // 处理旬时间 + StringBuffer stt = new StringBuffer(); + stt.append(pd.getString("STARTTIME")); + stt.setCharAt(9, '1'); + pd.put("STARTTIME", stt.toString()); + + String endDay = ENDTIME.substring(8, 10); + Integer endTime = Integer.parseInt(endDay); + StringBuffer et = new StringBuffer(); + et.append(pd.getString("ENDTIME")); + + if (endTime <= 10) { + stt.setCharAt(8, '1'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else if (endTime <= 20) { + stt.setCharAt(8, '2'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else { + Integer endMonth = Integer.parseInt(ENDTIME.substring(5, 7)); + Integer endYear = Integer.parseInt(ENDTIME.substring(0, 4)); + pd.put("ENDTIME", getLastDayOfMonth(endYear, endMonth) + " 23:59:59"); + } + List tenDaysList = customCheckRecordService.listCountTenDays(pd); // 统计--旬 + if (tenDaysList != null && tenDaysList.size() > 0) { + for (PageData count : tenDaysList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + // 分母 + for (PageData count : countList) { + + Integer allDenominator = Integer.parseInt(count.get("NOTEXAMINEDNUM").toString()) + + Integer.parseInt(all.get("denominator").toString()); + all.put("denominator", allDenominator); + } + + Integer jjr = customCheckRecordService.listCountJjr(pd) == null ? 0 : customCheckRecordService.listCountJjr(pd); + all.put("molecule", sum + jjr); + } + /* + * if(!varMap.get("listType0005").get("denominator").toString().equals("0")) { + * + * if(jjr == 0) { varMap.get("listType0005").put("percentage", 0d); } else { + * Double denominator= + * Double.parseDouble(varMap.get("listType0005").get("denominator").toString()); + * Double molecule= Double.valueOf(jjr); Double percentage = + * molecule/denominator*100; DecimalFormat df = new DecimalFormat("#.00"); + * varMap.get("listType0005").put("percentage", df.format(percentage)); } } + * Integer allMolecule = + * Integer.parseInt(varMap.get("listType0005").get("molecule").toString()) + + * Integer.parseInt(all.get("molecule").toString()); all.put("molecule", + * allMolecule); varList.add(varMap.get("listType0005")); + */ + if (!all.get("denominator").toString().equals("0")) { + if (all.get("molecule").toString().equals("0")) { + all.put("percentage", 0d); + } else { + Double denominator = Double.parseDouble(all.get("denominator").toString()); + Double molecule = Double.parseDouble(all.get("molecule").toString()); + Double percentage = molecule / denominator * 100; + DecimalFormat df = new DecimalFormat("#0.00"); + all.put("percentage", df.format(percentage)); + } + } + + map.put("all", all); + map.put("result", errInfo); + return map; + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goIndexCount") + @ResponseBody + @LogAnno(menuType= "首页",menuServer= "首页",instructionsOperate = "首页",instructionsType = "去修改页面获取数据") + public Object goIndexCount() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + String STARTTIME = pd.getString("STARTTIME"); // 关键词检索条件 + if (Tools.notEmpty(STARTTIME)) + pd.put("STARTTIME", STARTTIME.trim() + " 00:00:00"); + String ENDTIME = pd.getString("ENDTIME"); // 关键词检索条件 + if (Tools.notEmpty(ENDTIME)) + pd.put("ENDTIME", ENDTIME.trim() + " 23:59:59"); + + List varList = new ArrayList(); + PageData listType0001 = new PageData(); + PageData listType0002 = new PageData(); + PageData listType0003 = new PageData(); + PageData listType0004 = new PageData(); + PageData listType0005 = new PageData(); +// PageData listType0006 = new PageData(); + PageData all = new PageData(); + + Map varMap = new HashMap(); + + listType0001.put("type", "listType0001"); + listType0001.put("name", "日常"); + listType0001.put("molecule", 0); + listType0001.put("denominator", 0); + listType0001.put("percentage", 0d); + + listType0002.put("type", "listType0002"); + listType0002.put("name", "综合"); + listType0002.put("molecule", 0); + listType0002.put("denominator", 0); + listType0002.put("percentage", 0d); + + listType0003.put("type", "listType0003"); + listType0003.put("name", "专业"); + listType0003.put("molecule", 0); + listType0003.put("denominator", 0); + listType0003.put("percentage", 0d); + + listType0004.put("type", "listType0004"); + listType0004.put("name", "季节性"); + listType0004.put("molecule", 0); + listType0004.put("denominator", 0); + listType0004.put("percentage", 0d); + + listType0005.put("type", "listType0005"); + listType0005.put("name", "节假日"); + listType0005.put("molecule", 0); + listType0005.put("denominator", 0); + listType0005.put("percentage", 0d); + +// listType0006.put("type", "listType0006"); +// listType0006.put("name", "临时"); +// listType0006.put("molecule", 0); +// listType0006.put("denominator", 0); +// listType0006.put("percentage", 0d); + + all.put("type", "all"); + all.put("name", "合计"); + all.put("molecule", 0); + all.put("denominator", 0); + all.put("percentage", 0d); + + varMap.put("listType0001", listType0001); + varMap.put("listType0002", listType0002); + varMap.put("listType0003", listType0003); + varMap.put("listType0004", listType0004); + varMap.put("listType0005", listType0005); +// varMap.put("listType0006", listType0006); + varMap.put("all", all); + + List countList = listStatisticsService.getCountList(pd);// 统计分母 + + if (countList != null && countList.size() > 0) { + List dayList = customCheckRecordService.listCountDay(pd); // 统计--日 + if (dayList != null && dayList.size() > 0) { + for (PageData count : dayList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List weekList = customCheckRecordService.listCountWeek(pd); // 统计--周 + if (weekList != null && weekList.size() > 0) { + for (PageData count : weekList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List monthList = customCheckRecordService.listCountMonth(pd); // 统计--月 + + if (monthList != null && monthList.size() > 0) { + for (PageData count : monthList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List quarterList = customCheckRecordService.listCountQuarter(pd); // 统计--季 + + if (quarterList != null && quarterList.size() > 0) { + for (PageData count : quarterList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List halfYearList = customCheckRecordService.listCountHalfYear(pd); // 统计--半年 + + if (halfYearList != null && halfYearList.size() > 0) { + for (PageData count : halfYearList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List yearList = customCheckRecordService.listCountYear(pd); // 统计--年 + if (yearList != null && yearList.size() > 0) { + for (PageData count : yearList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + // 处理旬时间 + StringBuffer stt = new StringBuffer(); + stt.append(pd.getString("STARTTIME")); + stt.setCharAt(9, '1'); + pd.put("STARTTIME", stt.toString()); + + String endDay = ENDTIME.substring(8, 10); + Integer endTime = Integer.parseInt(endDay); + StringBuffer et = new StringBuffer(); + et.append(pd.getString("ENDTIME")); + + if (endTime <= 10) { + stt.setCharAt(8, '1'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else if (endTime <= 20) { + stt.setCharAt(8, '2'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else { + Integer endMonth = Integer.parseInt(ENDTIME.substring(5, 7)); + Integer endYear = Integer.parseInt(ENDTIME.substring(0, 4)); + pd.put("ENDTIME", getLastDayOfMonth(endYear, endMonth) + " 23:59:59"); + } + List tenDaysList = customCheckRecordService.listCountTenDays(pd); // 统计--旬 + if (tenDaysList != null && tenDaysList.size() > 0) { + for (PageData count : tenDaysList) { + Integer molecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("molecule").toString()); + varMap.get(count.get("TYPE")).put("molecule", molecule); + + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + // 分母 + for (PageData count : countList) { + Integer denominator = Integer.parseInt(count.get("NOTEXAMINEDNUM").toString()) + + Integer.parseInt(varMap.get(count.get("TYPE")).get("denominator").toString()); + varMap.get(count.get("TYPE")).put("denominator", denominator); + + Integer allDenominator = Integer.parseInt(count.get("NOTEXAMINEDNUM").toString()) + + Integer.parseInt(varMap.get("all").get("denominator").toString()); + varMap.get("all").put("denominator", allDenominator); + } + } + for (int i = 1; i < 5; i++) { + String type = "listType000" + i; + if (!varMap.get(type).get("denominator").toString().equals("0")) { + if (varMap.get(type).get("molecule").toString().equals("0")) { + varMap.get(type).put("percentage", 0d); + } else { + Double denominator = Double.parseDouble(varMap.get(type).get("denominator").toString()); + Double molecule = Double.parseDouble(varMap.get(type).get("molecule").toString()); + Double percentage = molecule / denominator * 100; + DecimalFormat df = new DecimalFormat("#0.00"); + varMap.get(type).put("percentage", df.format(percentage)); + } + + } + varList.add(varMap.get(type)); + } + if (!varMap.get("listType0005").get("denominator").toString().equals("0")) { + Integer jjr = customCheckRecordService.listCountJjr(pd) == null ? 0 : customCheckRecordService.listCountJjr(pd); + if (jjr == 0) { + varMap.get("listType0005").put("percentage", 0d); + } else { + Double denominator = Double.parseDouble(varMap.get("listType0005").get("denominator").toString()); + Double molecule = Double.valueOf(jjr); + Double percentage = molecule / denominator * 100; + DecimalFormat df = new DecimalFormat("#0.00"); + varMap.get("listType0005").put("percentage", df.format(percentage)); + } + } + Integer allMolecule = Integer.parseInt(varMap.get("listType0005").get("molecule").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + varList.add(varMap.get("listType0005")); + if (!varMap.get("all").get("denominator").toString().equals("0")) { + if (varMap.get("all").get("molecule").toString().equals("0")) { + varMap.get("all").put("percentage", 0d); + } else { + Double denominator = Double.parseDouble(varMap.get("all").get("denominator").toString()); + Double molecule = Double.parseDouble(varMap.get("all").get("molecule").toString()); + Double percentage = molecule / denominator * 100; + DecimalFormat df = new DecimalFormat("#0.00"); + varMap.get("all").put("percentage", df.format(percentage)); + } + } + varList.add(varMap.get("all")); + map.put("varList", varList); + map.put("varMap", varMap); + map.put("result", errInfo); + return map; + } + + /** + * BI页辨识部位检查记录 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/listLogByIde") + @ResponseBody + public Object listLogByIde() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + List varList = customCheckRecordService.listLogByIde(pd); + map.put("varList", varList); + map.put("result", errInfo); + return map; + } + + /** + * BI页隐患排查人员/部门/清单数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/countNumBi") + @ResponseBody + public Object countNumBi() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + int allUser = usersService.getUserCount(pd); + int workUser = customCheckRecordService.getWorkedUserCount(pd); + int allDep = departmentService.getDepCount(pd); + int workDep = customCheckRecordService.getWorkedDepCount(pd); + int allList = customService.getListCount(pd); + int workList = customService.getWorkedListCount(pd); + map.put("allUser", allUser); + map.put("workUser", workUser); + map.put("allDep", allDep); + map.put("workDep", workDep); + map.put("allList", allList); + map.put("workList", workList); + map.put("result", errInfo); + return map; + } + + /** + * BI页清单排查类型统计 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/listTypeBi") + @ResponseBody + public Object listTypeBi() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 +// pd.put("YEAR",new Date().getYear()+1900); + List typeList = customCheckRecordService.listTypeBi(pd); + map.put("typeList", typeList); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/allList") + // @RequiresPermissions("checkrecord:list") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "检查记录管理",instructionsType = "检查记录列表") + public Object allList(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + PageData npd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) + npd.put("KEYWORDS", KEYWORDS.trim()); + npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE()); + npd.put("SELF_DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID()); + npd.put("ISMAIN",Jurisdiction.getIS_MAIN()); + pd.put("USER_ID",Jurisdiction.getUSER_ID()); + PageData cpd = new PageData(); + cpd = usersService.findById(pd); + npd.put("ISLEADER", cpd.getString("ISLEADER")); + if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){ + String DEPARTMENT_ID = npd.getString("SELF_DEPARTMENT_ID"); + String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID); + ids=npd.getString("SELF_DEPARTMENT_ID")+","+ids; //把自己部门插入进去 + if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) { + ids = ids.substring(0,ids.lastIndexOf(",")); + npd.put("DEPARTMENT_IDS", ids.split(",")); + }else { + npd.put("DEPARTMENT_IDS", DEPARTMENT_ID); + } + }else { + if(npd.getString("ISMAIN").equals("0")){ + npd.put("USER_ID",Jurisdiction.getUSER_ID()); + } + } + npd.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID")); + npd.put("DEPARTMENT_ID",pd.getString("DEPARTMENT_ID")); + npd.put("TYPE",pd.getString("TYPE")); + npd.put("STARTTIME",pd.getString("STARTTIME")); + npd.put("ENDTIME",pd.getString("ENDTIME")); + page.setPd(npd); + List varList = customCheckRecordService.list(page); + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 补录 + * TODO + * @param + * @throws Exception + */ + @RequestMapping(value = "/recording") + // @RequiresPermissions("checkrecord:add") + @ResponseBody + @Transactional + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "补录") + public Object recording() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + + pd.put("TYPE", "1"); + pd.put("ISSTATISTICS", "1"); + + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + pd.put("OPERATOR", Jurisdiction.getName()); // 添加人 + customCheckRecordService.recording(pd);// 修改检查记录 + checkuserService.delete(pd); + PageData checkUser = new PageData(); + checkUser.put("CHECKUSER_ID", this.get32UUID()); // 主键 + checkUser.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + checkUser.put("DEPARTMENT_ID", pd.get("CHECKDEPT")); + checkUser.put("USER_ID", pd.get("CHECKOR")); + PageData u = usersService.findUserDept(checkUser); + + checkUser.put("USER_NAME", u.get("USER_NAME")); + checkUser.put("DEPARTMENT_NAME", u.get("DEPARTMENT_NAME")); + + checkuserService.save(checkUser); + if (pd.get("OTHER") != null && !pd.get("OTHER").equals("")) { + List otherList = (List) JSON.parse(pd.get("OTHER").toString()); + for (JSONObject json : otherList) { + if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null + && json.get("USER_ID") != "") { + PageData other = new PageData(); + other.put("CHECKUSER_ID", this.get32UUID()); // 主键 + other.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + other.put("DEPARTMENT_ID", json.get("DEPARTMENT_ID")); + other.put("USER_ID", json.get("USER_ID")); + PageData ou = usersService.findUserDept(other); + + other.put("USER_NAME", ou.get("USER_NAME")); + other.put("DEPARTMENT_NAME", ou.get("DEPARTMENT_NAME")); + + checkuserService.save(other); + } + } + } + if (pd.get("ITEMS") != null && !pd.get("ITEMS").equals("")) { + List itemsList = (List) JSON.parse(pd.get("ITEMS").toString()); + for (JSONObject json : itemsList) { + PageData item = new PageData(); + item.put("RECORDITEM_ID", json.get("RECORDITEM_ID")); // 主键 + item.put("LISTCHECKITEM_ID", json.get("LISTCHECKITEM_ID")); + PageData chei = customItemService.findById(item); + item.put("ISNORMAL", json.get("ISNORMAL")); + item.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + item.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + item.put("RISKUNITNAME", chei.get("RISKUNITNAME")); + item.put("PARTSNAME", chei.get("PARTSNAME")); + item.put("RISK_DESCR", chei.get("RISK_DESCR")); + item.put("POSITIONNAME", chei.get("POSITIONNAME")); + item.put("LEVEL_NAME", chei.get("DNAME5")); + item.put("CHECK_CONTENT", chei.get("CHECK_CONTENT")); + item.put("RISKPOINT_ID", chei.get("RISKPOINT_ID")); + item.put("LONGITUDE", pd.get("LONGITUDE")); + item.put("LATITUDE", pd.get("LATITUDE")); + item.put("CORPINFO_ID", pd.get("CORPINFO_ID")); + item.put("ISDELETE", pd.get("0")); + customCheckRecordItemService.save(item); + + } + } + if (pd.get("IDS") != null && !pd.get("IDS").equals("")) { + String ids = pd.get("IDS").toString(); + String ArrayDATA_IDS[] = ids.split(","); + PageData hiddens = new PageData(); + hiddens.put("CHECKRECORD_ID", pd.get("CHECKRECORD_ID")); + hiddens.put("IDS", ArrayDATA_IDS); + hiddenService.updateAll(hiddens); + } + hiddenService.submit(pd); + + hiddenService.submitList(pd);// 其他隐患提交 + List hList = hiddenService.getHiddenByRecord(pd); + if (hList.size() > 0) { + for (PageData h : hList) { + if ("2".equals(h.get("RECTIFICATIONTYPE").toString())) { + // 发短信 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", h.get("RECTIFICATIONOR"));// 收信人userid + mes.put("templateCode", "SMS_215820677");// 短信模板编码 + mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id + + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "time");// 存入短信模板中的参数名称 + params1.put("value", h.get("RECTIFICATIONDEADLINE"));// 存入上面参数名称所传递的值 + paramsList.add(params1); + + sendMessageUtil.sendMessages(mes, paramsList); + } + } + } + map.put("result", errInfo); + return map; + } + + /** + * 员工清单检查情况(月) + * + * @throws Exception + */ + @RequestMapping(value = "/monthStatistics") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "员工清单检查情况",instructionsType = "员工清单检查情况(月)") + public Object monthStatistics(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + PageData npd = new PageData(); + pd = this.getPageData(); + String month = pd.getString("MONTH"); + npd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + String DEPTIDS = pd.getString("DEPTIDS"); + if(Tools.notEmpty(DEPTIDS)) { + String DEPT_IDS[] = DEPTIDS.split(","); + npd.put("DEPT_IDS", DEPT_IDS); + } + npd.put("ISMAIN", Jurisdiction.getIS_MAIN()); + npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE()); + npd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID()); + pd.put("USER_ID",Jurisdiction.getUSER_ID()); + PageData cpd = new PageData(); + cpd = usersService.findById(pd); + npd.put("ISLEADER", cpd.getString("ISLEADER")); + if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){ + String DEPARTMENT_ID = npd.getString("DEPARTMENT_ID"); + String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID); + ids=npd.getString("DEPARTMENT_ID")+","+ids; //把自己部门插入进去 + if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) { + ids = ids.substring(0,ids.lastIndexOf(",")); + npd.put("DEPARTMENT_IDS", ids.split(",")); + }else { + npd.put("DEPARTMENT_IDS", DEPARTMENT_ID); + } + }else { + if(npd.getString("ISMAIN").equals("0")){ + npd.put("USER_ID",Jurisdiction.getUSER_ID()); + } + } + String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) + npd.put("KEYWORDS", KEYWORDS.trim()); + npd.put("USERNAME",pd.getString("USERNAME")); + page.setPd(npd); + List lists = customService.getListByCorplistPage(page); + + if(lists!=null && lists.size()>0){ + Map resmap = new HashMap<>(); + List listIds = new ArrayList<>(); + lists.forEach(list -> { + resmap.put(list.getString("LISTMANAGER_ID"),new HashMap()); + listIds.add(list.getString("LISTMANAGER_ID")); + if(DateSysUtil.isSameMonth(list.getString("CREATTIME"),month)){//如果清单创建时间是查询月 + List datesInRange = DateSysUtil.getDatesInRange(month+"-01 00:00:00",list.getString("CREATTIME")); + for (int i = 0; i < datesInRange.size()-1; i++) { + Map data = new HashMap(); + data.put("TYPE", "3"); + data.put("HIDDEN_COUNT", "-"); + resmap.get(list.getString("LISTMANAGER_ID")).put(datesInRange.get(i), data);//将1号到创建日期期间得值设为3:未建立 + } + } + }); + + if(listIds.size() > 0){ + pd.put("LIST_IDS",listIds); + List recordList = customCheckRecordService.listForIdsAndMonth(pd);//获取查询月在检查周期内的检查记录 + recordList.forEach(record -> { + List datesInRange = DateSysUtil.getDatesInRange(record.getString("PERIODSTART"),record.getString("PERIODEND")); + for (int i = 0; i < datesInRange.size(); i++) { + Map data = new HashMap(); + data.put("TYPE", record.getString("TYPE")); + if ("1".equals(record.getString("TYPE"))) { + if (datesInRange.get(i).equals(record.getString("CREATTIME").substring(0, 10))) { + data.put("HIDDEN_COUNT", record.getString("HIDDEN_COUNT")); + } else { + data.put("HIDDEN_COUNT", "0"); + } + } + resmap.get(record.getString("LISTMANAGER_ID")).put(datesInRange.get(i), data); //2未检查 + } + }); + } + + map.put("list",lists); + map.put("resmap",resmap); + } + map.put("page",page); + map.put("result", "success"); + return map; + } +} diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java index 97a8305..a05102c 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomController.java @@ -1,5 +1,7 @@ package com.zcloud.controller.hiddenDangerCheckStandard; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -21,10 +23,7 @@ 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; +import java.util.*; /** * 说明:清单管理-隐患排查清单 @@ -36,202 +35,346 @@ import java.util.Map; @RequestMapping("/hiddenstandardCustom") public class CustomController extends BaseController { - @Autowired - private CustomService customService; - @Autowired - private CustomItemService customItemService; - @Autowired - private CustomDisableTimeService customDisableTimeService; - @Autowired - private DepartmentService departmentService; - @Autowired - private CustomCheckRecordService customCheckRecordService; - @Autowired - private RecordItemService recordItemService; - @Autowired - private CustomStatisticsService customStatisticsService; - @Autowired - private IdentificationPartsService identificationPartsService; - @Autowired - private ListDisableTimeService listdisabletimeService; - @Autowired - private CheckRouteService checkRouteService; - @Autowired - private UsersService usersService; - @Autowired - private OffDutyService offdutyService; - /**新增 - * @param - * @throws Exception - */ - @RequestMapping(value="/add") - @ResponseBody - @Transactional - @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "新增") - public Object add() throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - pd.put("CUSTOM_ID", this.get32UUID()); - Warden.initDate(pd); - customService.save(pd); - PageData itempd = new PageData(); - itempd.putAll(pd); - itempd.put("CUSTOM_ITEM_ID", this.get32UUID()); - customItemService.save(itempd); - map.put("result", errInfo); - return map; - } + @Autowired + private CustomService customService; + @Autowired + private CustomItemService customItemService; + @Autowired + private CustomDisableTimeService customDisableTimeService; + @Autowired + private DepartmentService departmentService; + @Autowired + private CustomCheckRecordService customCheckRecordService; + @Autowired + private RecordItemService recordItemService; + @Autowired + private CustomStatisticsService customStatisticsService; + @Autowired + private IdentificationPartsService identificationPartsService; + @Autowired + private ListDisableTimeService listdisabletimeService; + @Autowired + private CheckRouteService checkRouteService; + @Autowired + private UsersService usersService; + @Autowired + private OffDutyService offdutyService; - /**列表 - * @param page - * @throws Exception - */ - @RequestMapping(value="/list") - @ResponseBody - @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "列表") - public Object list(Page page) throws Exception{ - Map map = new HashMap(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 - 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 + * @throws Exception + */ + @RequestMapping(value = "/add") + @ResponseBody + @Transactional + @LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "新增") + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 + if (pd.getString("TYPE").equals("listType0006")) { + pd.put("ISDELETE", "-99"); + } else { + pd.put("ISDELETE", "0"); //是否删除 + } + pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间 + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + String listPeriod = pd.getString("PERIOD"); + if (pd.get("USER_IDS") != null && Tools.notEmpty(pd.get("USER_IDS").toString())) { + String[] userIds = pd.get("USER_IDS").toString().split(","); + for (int i = 0; i < userIds.length; i++) { + pd.put("CUSTOM_ID", this.get32UUID()); //主键 + pd.put("USER_ID", userIds[i]); + if (pd.get("LISTITEM") != null && !pd.get("LISTITEM").equals("")) { + List list = (List) JSON.parse(pd.get("LISTITEM").toString()); + for (JSONObject json : list) { + PageData itme = new PageData(); + itme.put("CUSTOM_ITEM_ID", this.get32UUID()); //主键 + itme.put("CUSTOM_ID", pd.get("CUSTOM_ID")); + itme.put("CHECK_CATEGORY", json.get("CHECK_CATEGORY")); + itme.put("CHECK_ITEM", json.get("CHECK_ITEM")); + itme.put("CHECK_CONTENT", json.get("CHECK_CONTENT")); + itme.put("CHECK_STANDARD", json.get("CHECK_STANDARD")); + itme.put("REFERENCE_BASIS", json.get("REFERENCE_BASIS")); + itme.put("CHECK_QUALIFIED", json.get("CHECK_QUALIFIED")); + itme.put("CHECK_UNQUALIFIED", json.get("CHECK_UNQUALIFIED")); + itme.put("OPERATION_TYPE", json.get("OPERATION_TYPE")); + itme.put("COMMON_ITEM_SORT", Tools.notEmpty(json.get("COMMON_ITEM_SORT").toString())? json.get("COMMON_ITEM_SORT") : ""); + itme.put("COMMON_ID", Tools.notEmpty(json.get("COMMON_ID").toString()) ? json.get("COMMON_ID") : ""); + itme.put("COMMON_ITEM_ID", Tools.notEmpty(json.get("COMMON_ITEM_ID").toString()) ? json.get("COMMON_ITEM_ID") : ""); + itme.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 + itme.put("ISDELETE", "0"); //是否删除 + itme.put("CREATOR_ID", Jurisdiction.getUSER_ID()); //添加人id + itme.put("CREATOR_NAME", Jurisdiction.getUsername()); //添加人 + itme.put("CREATE_TIME", DateUtil.date2Str(new Date())); //创建时间 + itme.put("OPERATOR_ID", Jurisdiction.getUSER_ID()); //修改人 + itme.put("OPERATOR_NAME", Jurisdiction.getUsername()); //修改时间 + itme.put("OPERATE_TIME", DateUtil.date2Str(new Date())); //修改时间 + itme.put("DELETEOR_ID", Jurisdiction.getUSER_ID()); //添加人id + itme.put("DELETEOR_NAME", Jurisdiction.getUsername()); //添加人 + itme.put("DELETE_TIME", DateUtil.date2Str(new Date())); //删除时间 + customItemService.save(itme); + } + } + pd.put("PERIOD", listPeriod); + customService.save(pd); + // 修改清单统计 + if (!pd.getString("TYPE").equals("listType0006")) { + if (pd.get("TYPE") != null && Tools.notEmpty(pd.get("TYPE").toString())) { + pd.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键 + if ("listType0005".equals(pd.get("TYPE").toString())) { + 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); + } else { + pd.put("NOTEXAMINEDNUM", 2); + customStatisticsService.save(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); + } else { + pd.put("NOTEXAMINEDNUM", 1); + customStatisticsService.save(pd); + } + } + } + } + + } + } + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + @ResponseBody + @LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "列表") + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + 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); - // 记录清单禁用开始时间 + /** + * 禁用 + * + * @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; + 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 "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 "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 "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 "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 "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; + 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); - } + 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; - } + pd.put("ISSTATISTICS", '0'); + // 本期已检查的不计入统计 + customCheckRecordService.editStatistics(pd); + } + } + // 将本频率内已检查的记录,改为不计入 + map.put("result", errInfo); //返回结果 + return map; + } // /**列表 @@ -411,205 +554,208 @@ public class CustomController extends BaseController { // map.put("result", errInfo); // return map; // } -// -// /**去修改页面获取数据 -// * @param -// * @throws Exception -// */ -// @RequestMapping(value="/goEdit") -// @ResponseBody -// @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "去修改页面获取数据") -// public Object goEdit() 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); -// pd = listmanagerService.findById(pd); //根据ID读取 -// -// for (PageData item : varList) { -// item.put("RECORDITEM_ID", this.get32UUID()); //主键 -// } + + /**去修改页面获取数据 + * @param + * @throws Exception + */ + @RequestMapping(value="/goEdit") + @ResponseBody + @LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单管理",instructionsType = "去修改页面获取数据") + public Object goEdit() 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()); + pd.put("CUSTOM_ID", pd.get("ID")); + List varList = customItemService.listAll(pd); + pd = customService.findById(pd); //根据ID读取 + + for (PageData item : varList) { + item.put("RECORDITEM_ID", this.get32UUID()); //主键 + } // List ideList = identificationPartsService.listAllByList(pd); -// -// map.put("varList", varList); + + map.put("varList", varList); // map.put("ideList", ideList); -// map.put("pd", pd); -// 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); //返回结果 + map.put("pd", pd); + 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; - } + /** + * 批量删除 + * + * @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 diff --git a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomHiddenController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomHiddenController.java index 07f841c..cb0752b 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomHiddenController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomHiddenController.java @@ -15,6 +15,7 @@ import com.zcloud.service.hidden.HiddenCheckService; import com.zcloud.service.hidden.HiddenSchemeService; import com.zcloud.service.hidden.HiddenService; import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenService; +import com.zcloud.service.hiddenDangerCheckStandard.CustomService; import com.zcloud.service.inspection.SafetyEnvironmentalService; import com.zcloud.service.sms.SMSLogService; import com.zcloud.service.sms.SMSManagementService; @@ -68,7 +69,7 @@ public class CustomHiddenController extends BaseController { @Autowired private SMSLogService smSlogService; @Autowired - private ListManagerService listmanagerService; + private CustomService customService; @Autowired private RecordItemService recordItemService; @Autowired @@ -784,12 +785,13 @@ public class CustomHiddenController extends BaseController { pd = this.getPageData(); pd.put("USER_ID", Jurisdiction.getUSER_ID()); String USER_ID = pd.get("USER_ID").toString(); - pd = listmanagerService.findById(pd); + pd.put("CUSTOM_ID", pd.get("ID")); + pd = customService.findById(pd); if (pd.getString("TYPE").equals("listType0005")) { if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(pd.getString("START_DATE") + " 00:00:00"), DateUtil.fomatDateTime(pd.getString("END_DATE") + " 23:59:59"))) { PageData type = new PageData(); - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_XUN", 1);// 查询方法和旬一样,直接借用 type.put("STATE", "0"); type.put("USER_ID", USER_ID); @@ -804,12 +806,12 @@ public class CustomHiddenController extends BaseController { String cycle = pd.getString("PERIODNAME"); PageData type = new PageData(); if (cycle.equals("每日")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_DAY", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); } else if (cycle.equals("每周")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_WEEK", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); @@ -818,7 +820,7 @@ public class CustomHiddenController extends BaseController { if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_XUN", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); @@ -829,7 +831,7 @@ public class CustomHiddenController extends BaseController { if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_XUN", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); @@ -840,7 +842,7 @@ public class CustomHiddenController extends BaseController { if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_XUN", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); @@ -849,22 +851,22 @@ public class CustomHiddenController extends BaseController { } } else if (cycle.equals("每月")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_MONTH", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); } else if (cycle.equals("每季")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_QUARTER", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); } else if (cycle.equals("半年")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_HALFYEAR", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); } else if (cycle.equals("每年")) { - type.put("LISTMANAGER_ID", pd.get("LISTMANAGER_ID")); + type.put("CUSTOM_ID", pd.get("CUSTOM_ID")); type.put("IS_YEAR", 1); type.put("STATE", "0"); type.put("USER_ID", USER_ID); diff --git a/src/main/java/com/zcloud/mapper/datasource/check/ListManagerMapper.java b/src/main/java/com/zcloud/mapper/datasource/check/ListManagerMapper.java index 0af1250..e92130e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/check/ListManagerMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/check/ListManagerMapper.java @@ -103,7 +103,7 @@ public interface ListManagerMapper { List recordlistPage(Page page); - + List riskStandardRecordlistPage(Page page); /**待检查清单数量 * @param pd @@ -186,6 +186,12 @@ public interface ListManagerMapper { */ List checklistPage(Page page); + /**列表 + * @param page + * @throws Exception + */ + List riskStandardChecklistPage(Page page); + /**上期超期未检查的清单 * @param pd * @throws Exception diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.java new file mode 100644 index 0000000..4b3547f --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.java @@ -0,0 +1,78 @@ +package com.zcloud.mapper.datasource.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单检查记录 + * 作者:luoxiaobao + * 时间:2021-01-25 + * 官网:www.zcloudchina.com + */ +public interface CustomCheckUserMapper { + + /**新增 + * @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 page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**查看检查清单检查人 + * @param pd + * @throws Exception + */ + PageData getCheckUser(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + /**查询人员检查数 + * @param pd + * @throws Exception + */ + List countCheByUser(PageData pd); + + /**绩效得分 + * @param pd + * @throws Exception + */ + List getDeptExamine(PageData pd); + + List getUserExamine(PageData pd); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomItemMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomItemMapper.java index d92942d..97eeedb 100644 --- a/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomItemMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenDangerCheckStandard/CustomItemMapper.java @@ -1,5 +1,6 @@ package com.zcloud.mapper.datasource.hiddenDangerCheckStandard; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import java.util.List; @@ -23,5 +24,55 @@ public interface CustomItemMapper { * @throws Exception */ List getCheckItem(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(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); + + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + /**批量删除 + * @param pd + * @throws Exception + */ + void deleteList(PageData pd); + + /**获取隐患数据 + * @param pd + * @throws Exception + */ + PageData findHidden(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/check/ListManagerService.java b/src/main/java/com/zcloud/service/check/ListManagerService.java index c47a9ef..4934fad 100644 --- a/src/main/java/com/zcloud/service/check/ListManagerService.java +++ b/src/main/java/com/zcloud/service/check/ListManagerService.java @@ -87,6 +87,12 @@ public interface ListManagerService { */ public List checklistPage(Page page)throws Exception; + /**列表 + * @param page + * @throws Exception + */ + public List riskStandardCheckList(Page page)throws Exception; + /**列表(全部) * @param pd * @throws Exception @@ -117,6 +123,11 @@ public interface ListManagerService { */ public List recordList(Page page)throws Exception; + /**部门清单列表 + * * @param pd + * @throws Exception + */ + public List riskStandardRecordList(Page page)throws Exception; /**待检查清单数量 * @param pd diff --git a/src/main/java/com/zcloud/service/check/impl/ListManagerServiceImpl.java b/src/main/java/com/zcloud/service/check/impl/ListManagerServiceImpl.java index f66ff50..831ff78 100644 --- a/src/main/java/com/zcloud/service/check/impl/ListManagerServiceImpl.java +++ b/src/main/java/com/zcloud/service/check/impl/ListManagerServiceImpl.java @@ -113,6 +113,14 @@ public class ListManagerServiceImpl implements ListManagerService { return listmanagerMapper.checklistPage(page); } + /**清单检查分页 + * @param pd + * @throws Exception + */ + public List riskStandardCheckList(Page page)throws Exception{ + return listmanagerMapper.riskStandardChecklistPage(page); + } + /**查询部门清单 * @param pd * @throws Exception @@ -173,6 +181,14 @@ public class ListManagerServiceImpl implements ListManagerService { return listmanagerMapper.recordlistPage(page); } + /**部门清单列表 + * * @param pd + * @throws Exception + */ + public List riskStandardRecordList(Page page)throws Exception{ + return listmanagerMapper.riskStandardRecordlistPage(page); + } + /**待检查清单数量 * @param pd * @throws Exception diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckUserService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckUserService.java new file mode 100644 index 0000000..1451c8c --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomCheckUserService.java @@ -0,0 +1,78 @@ +package com.zcloud.service.hiddenDangerCheckStandard; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:清单检查记录 + * 作者:luoxiaobao + * 时间:2021-01-25 + * 官网:www.zcloudchina.com + */ +public interface CustomCheckUserService { + + /**新增 + * @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 page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**查看检查清单检查人 + * @param pd + * @throws Exception + */ + public PageData getCheckUser(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + /**查询人员检查数 + * @param pd + * @throws Exception + */ + public List countCheByUser(PageData pd)throws Exception; + + /**绩效得分 + * @param pd + * @throws Exception + */ + public List getDeptExamine(PageData pd)throws Exception; + public List getUserExamine(PageData pd)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomItemService.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomItemService.java index 1563662..22d5e71 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomItemService.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomItemService.java @@ -1,5 +1,6 @@ package com.zcloud.service.hiddenDangerCheckStandard; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import java.util.List; @@ -17,13 +18,61 @@ public interface CustomItemService { * @param pd * @throws Exception */ - void save(PageData 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 page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(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 void deleteList(PageData pd)throws Exception; /**获取用户检查清单的检查项目 * @param pd * @throws Exception */ List getCheckItem(PageData pd)throws Exception; + + + /**获取隐患数据 + * @param pd + * @throws Exception + */ + public PageData findHidden(PageData pd)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 4ad9a53..5d385bd 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/CustomService.java @@ -23,38 +23,39 @@ public interface CustomService { * @param pd * @throws Exception */ - public List listAll(PageData pd)throws Exception; + List listAll(PageData pd)throws Exception; /**列表 * @param page * @throws Exception */ - public List list(Page page)throws Exception; + List list(Page page)throws Exception; /**禁用 * @param pd * @throws Exception */ - public void delete(PageData pd)throws Exception; + void delete(PageData pd)throws Exception; /**删除 * @param pd * @throws Exception */ - public void remove(PageData pd)throws Exception; + void remove(PageData pd)throws Exception; /**彻底删除 * @param pd * @throws Exception */ - public void deleted(PageData pd)throws Exception; + void deleted(PageData pd)throws Exception; /**启用 * @param pd * @throws Exception */ - public void enable(PageData pd)throws Exception; -/**通过id获取数据 + void enable(PageData pd)throws Exception; + + /**通过id获取数据 * @param pd * @throws Exception */ @@ -65,5 +66,31 @@ public interface CustomService { * @throws Exception */ List getMyCheckList(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + List checklistPage(Page page)throws Exception; + + /** + * 查询公司清单总数 + * @param pd + * @return + */ + public int getListCount(PageData pd)throws Exception; + + /** + * 查询公司检查过清单的总数 + * @param pd + * @return + */ + public int getWorkedListCount(PageData pd)throws Exception; + + /**查询人员清单 + * @param page + * @throws Exception + */ + public List getListByCorplistPage(Page page)throws Exception; } diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckUserServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckUserServiceImpl.java new file mode 100644 index 0000000..de483a6 --- /dev/null +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomCheckUserServiceImpl.java @@ -0,0 +1,109 @@ +package com.zcloud.service.hiddenDangerCheckStandard.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.check.CheckUserMapper; +import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckUserService; +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-25 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class CustomCheckUserServiceImpl implements CustomCheckUserService { + + @Autowired + private CheckUserMapper checkuserMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + checkuserMapper.save(pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + checkuserMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + checkuserMapper.edit(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return checkuserMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return checkuserMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return checkuserMapper.findById(pd); + } + + /**查看检查清单检查人 + * @param pd + * @throws Exception + */ + public PageData getCheckUser(PageData pd)throws Exception{ + return checkuserMapper.getCheckUser(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + checkuserMapper.deleteAll(ArrayDATA_IDS); + } + + /**查询人员检查数 + * @param pd + * @throws Exception + */ + public List countCheByUser(PageData pd)throws Exception{ + return checkuserMapper.countCheByUser(pd); + } + + /**绩效得分 + * @param pd + * @throws Exception + */ + public List getDeptExamine(PageData pd)throws Exception{ + return checkuserMapper.getDeptExamine(pd); + } + public List getUserExamine(PageData pd)throws Exception{ + return checkuserMapper.getUserExamine(pd); + } +} + diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomItemServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomItemServiceImpl.java index 94ca954..977427c 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomItemServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomItemServiceImpl.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.CustomItemMapper; import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService; @@ -31,11 +32,74 @@ public class CustomItemServiceImpl implements CustomItemService { customItemMapper.save(pd); } + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + customItemMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + customItemMapper.edit(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return customItemMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return customItemMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return customItemMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + customItemMapper.deleteAll(ArrayDATA_IDS); + } + + /**批量删除 + * @param pd + * @throws Exception + */ + public void deleteList(PageData pd)throws Exception{ + customItemMapper.deleteList(pd); + } + @Override public List getCheckItem(PageData pd)throws Exception { return customItemMapper.getCheckItem(pd); } + /**获取隐患数据 + * @param pd + * @throws Exception + */ + public PageData findHidden(PageData pd)throws Exception{ + return customItemMapper.findHidden(pd); + } } 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 33c1397..57cda77 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomServiceImpl.java @@ -95,6 +95,36 @@ public class CustomServiceImpl implements CustomService { public List getMyCheckList(PageData pd)throws Exception{ return customMapper.getMyCheckList(pd); } + + /**清单检查分页 + * @param pd + * @throws Exception + */ + public List checklistPage(Page page)throws Exception{ + return customMapper.checklistPage(page); + } + + /** + * 查询公司清单总数 + * @param pd + * @return + */ + public int getListCount(PageData pd)throws Exception{ + return customMapper.getListCount(pd); + } + + /** + * 查询公司检查过清单的总数 + * @param pd + * @return + */ + public int getWorkedListCount(PageData pd)throws Exception{ + return customMapper.getWorkedListCount(pd); + } + + public List getListByCorplistPage(Page page)throws Exception{ + return customMapper.getListByCorplistPage(page); + } } diff --git a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java index c6d3dbe..ab388b2 100644 --- a/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenDangerCheckStandard/impl/CustomStatisticsServiceImpl.java @@ -92,11 +92,6 @@ public class CustomStatisticsServiceImpl implements CustomStatisticsService { */ @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); } diff --git a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml index a9195b7..7270a6f 100644 --- a/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml +++ b/src/main/resources/mybatis/datasource/check/ListManagerMapper.xml @@ -1347,6 +1347,243 @@ order by f.USER_ID= #{pd.orderUserId} desc ,f.DEPARTMENT_ID asc,f.OPERATTIME desc + + + + ( select * from + ( + select + f.LISTMANAGER_ID, + f.NAME, + f.OPERATTIME, + f.ISDELETE, + f.DEPARTMENT_ID, + f.POST_ID, + f.USER_ID, + "1" as list_type, + u.WORKSTATUS, + a.STARTTIME, + a.ENDTIME , + p.NAME PERIODNAME, + t.NAME TYPENAME, + m.NAME SCREENTYPENAME, + d.NAME as DEPARTMENT_NAME, + getFullName(d.DEPARTMENT_ID) as DEPARTMENT_NAME_ALL, + sp.NAME + AS POST_NAME, + u.NAME as USER_NAME, + ( + select count(1) from BUS_CHECKRECORD ch + where ch.LISTMANAGER_ID=f.LISTMANAGER_ID AND ch.type = '1' + and ch.FINISHED='1' and ch.ISDELETE =0 + ) as count , + ( + select + count(1) + from BUS_CHECKRECORD ch + left join bus_hidden h on h.CHECKRECORD_ID = ch.CHECKRECORD_ID + where ch.LISTMANAGER_ID=f.LISTMANAGER_ID + and ch.FINISHED='1' + and ch.ISDELETE =0 + and h.ISDELETE =0 + and h.HIDDEN_ID is not null + ) as hiddenCount, + + ( + CASE + WHEN f.TYPE = 'listType0005' THEN + CONCAT( f.START_DATE, " 00:00:00" ) + WHEN f.PERIOD = 'checkPeriod0001' THEN + (select sd.DAY_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0002' THEN + (select sd.WEEK_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0003' THEN + (select sd.XUN_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0004' THEN + (select sd.MONTH_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0005' THEN + (select sd.QUARTER_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0006' THEN + (select sd.YEAR_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0007' THEN + (select sd.HALFYEAR_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + END + ) DATESTART, + bb.NAME AS TASK_TYPE_NAME, + ( + CASE + WHEN f.TYPE = 'listType0005' THEN + CONCAT( f.END_DATE, " 23:59:59" ) + WHEN f.PERIOD = 'checkPeriod0001' THEN + (select sd.DAY_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0002' THEN + (select sd.WEEK_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0003' THEN + (select sd.XUN_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0004' THEN + (select sd.MONTH_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0005' THEN + (select sd.QUARTER_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0006' THEN + (select sd.YEAR_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0007' THEN + (select sd.HALFYEAR_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + END + ) DATEEND, + getCheckedNum(f.LISTMANAGER_ID) checkCount, + (select count(1) from bus_checkrecord cc where cc.LISTMANAGER_ID = f.LISTMANAGER_ID and cc.FINISHED ='1' and type ='2') overTimeCount + from + + f + LEFT JOIN BUS_OFFDUTY a on f.USER_ID = a.USER_ID and a.isdelete = '0' and a.STARTTIME <= date_format(now(),'%Y-%m-%d') and a.ENDTIME >= date_format(now(),'%Y-%m-%d') + left join sys_dictionaries p on f.PERIOD = p.BIANMA + left join sys_dictionaries t on f.TYPE = t.BIANMA + left join sys_dictionaries m on f.SCREENTYPE = m.BIANMA + left join OA_DEPARTMENT d on d.DEPARTMENT_ID = f.DEPARTMENT_ID + LEFT JOIN sys_dictionaries bb ON f.TASK_TYPE = bb.DICTIONARIES_ID + left join + SYS_POST sp on sp.POST_ID=f.POST_ID + left join SYS_USER u on u.USER_ID = f.USER_ID + where f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.ISDELETE != '-99' + + and f.SCREENTYPE = #{pd.RISKCHECKLISTTYPE} + + + and + ( + f.LISTMANAGER_ID in + + '${item}' + + ) + + + and + ( + f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') + ) + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + and f.DEPARTMENT_ID = #{pd.DEPT_ID} + + + 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 = #{pd.DEPT_ID} + + + + 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 = #{pd.DEPT_ID} + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + and + f.DEPARTMENT_ID = #{pd.DEPT_ID} + + + and f.USER_ID = #{pd.USER_ID} + and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID} + + + + + + + + and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%') + + + + and f.ISDELETE = #{pd.ISDELETE} + + + + + + AND getCheckedNum(f.LISTMANAGER_ID) > 0 + + + AND getCheckedNum(f.LISTMANAGER_ID) = 0 + + + + + + + + + AND (select count(1) from bus_checkrecord cc where cc.LISTMANAGER_ID = f.LISTMANAGER_ID and cc.FINISHED ='1' and type ='2') > 0 + + + AND (select count(1) from bus_checkrecord cc where cc.LISTMANAGER_ID = f.LISTMANAGER_ID and cc.FINISHED ='1' and type ='2') = 0 + + + + + + + and f.PERIOD = #{pd.PERIOD} + + + and f.TYPE = #{pd.TYPE} + + + and ( + (a.STARTTIME is null or a.ENDTIME is null) + or (to_days(a.STARTTIME) < to_days(NOW()) and to_days(a.ENDTIME) > to_days(NOW())) + AND u.WORKSTATUS != '2' + ) + + + and !( + (a.STARTTIME is null or a.ENDTIME is null) + or (to_days(a.STARTTIME) < to_days(NOW()) and to_days(a.ENDTIME) > to_days(NOW())) + or u.WORKSTATUS = '2' + ) + + + + + and d.LEVEL = '' + + + and d.LEVEL = #{pd.LISTINGLEVEL} + + + + + + + and f.LISTMANAGER_ID in + ( + SELECT LISTMANAGER_ID + FROM BUS_CHECKRECORD + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') >= #{pd.STARTTIME} + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') <= #{pd.ENDTIME} + ) + + + and f.LISTMANAGER_ID in + ( + SELECT LISTMANAGER_ID + FROM BUS_CHECKRECORD + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') >= #{pd.STARTTIME} + ) + + + and f.LISTMANAGER_ID in + ( + SELECT LISTMANAGER_ID + FROM BUS_CHECKRECORD + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') <= #{pd.ENDTIME} + ) + + + + + ) f + where 1= 1 + + + + and f.hiddenCount = 0 + + + and f.hiddenCount > 0 + + + + group by f.LISTMANAGER_ID + order by field(f.ISDELETE,'0','1','2','-1') ,f.OPERATTIME desc ) + union + (select * from + ( + select + f.CUSTOM_ID, + f.NAME, + f.OPERATTIME, + f.ISDELETE, + f.DEPARTMENT_ID, + f.POST_ID, + f.USER_ID, + "2" as list_type, + u.WORKSTATUS, + a.STARTTIME, + a.ENDTIME , + p.NAME PERIODNAME, + t.NAME TYPENAME, + m.NAME SCREENTYPENAME, + d.NAME as DEPARTMENT_NAME, + getFullName(d.DEPARTMENT_ID) as DEPARTMENT_NAME_ALL, + sp.NAME + AS POST_NAME, + u.NAME as USER_NAME, + ( + select count(1) from bus_hiddendangercheckstandard_checkrecord ch + where ch.CUSTOM_ID=f.CUSTOM_ID AND ch.type = '1' + and ch.FINISHED='1' and ch.ISDELETE =0 + ) as count , + ( + select + count(1) + from bus_hiddendangercheckstandard_checkrecord ch + left join bus_hiddendangercheckstandard_hidden h on h.CHECKRECORD_ID = ch.CHECKRECORD_ID + where ch.CUSTOM_ID=f.CUSTOM_ID + and ch.FINISHED='1' + and ch.ISDELETE =0 + and h.ISDELETE =0 + and h.HIDDEN_ID is not null + ) as hiddenCount, + + ( + CASE + WHEN f.TYPE = 'listType0005' THEN + CONCAT( f.START_DATE, " 00:00:00" ) + WHEN f.PERIOD = 'checkPeriod0001' THEN + (select sd.DAY_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0002' THEN + (select sd.WEEK_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0003' THEN + (select sd.XUN_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0004' THEN + (select sd.MONTH_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0005' THEN + (select sd.QUARTER_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0006' THEN + (select sd.YEAR_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0007' THEN + (select sd.HALFYEAR_START from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + END + ) DATESTART, + bb.NAME AS TASK_TYPE_NAME, + ( + CASE + WHEN f.TYPE = 'listType0005' THEN + CONCAT( f.END_DATE, " 23:59:59" ) + WHEN f.PERIOD = 'checkPeriod0001' THEN + (select sd.DAY_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0002' THEN + (select sd.WEEK_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0003' THEN + (select sd.XUN_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0004' THEN + (select sd.MONTH_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0005' THEN + (select sd.QUARTER_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0006' THEN + (select sd.YEAR_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + WHEN f.PERIOD = 'checkPeriod0007' THEN + (select sd.HALFYEAR_END from v_sysdate sd where DATE_FORMAT( sd.`date`,'%Y-%m-%d' ) = DATE_FORMAT(now(),'%Y-%m-%d') ) + END + ) DATEEND, + getStandardCheckedNum(f.CUSTOM_ID) checkCount, + (select count(1) from bus_hiddendangercheckstandard_checkrecord cc where cc.CUSTOM_ID = f.CUSTOM_ID and cc.FINISHED ='1' and type ='2') overTimeCount + from + bus_hiddendangercheckstandard_custom + f + LEFT JOIN BUS_OFFDUTY a on f.USER_ID = a.USER_ID and a.isdelete = '0' and a.STARTTIME <= date_format(now(),'%Y-%m-%d') and a.ENDTIME >= date_format(now(),'%Y-%m-%d') + left join sys_dictionaries p on f.PERIOD = p.BIANMA + left join sys_dictionaries t on f.TYPE = t.BIANMA + left join sys_dictionaries m on f.SCREENTYPE = m.BIANMA + left join OA_DEPARTMENT d on d.DEPARTMENT_ID = f.DEPARTMENT_ID + LEFT JOIN sys_dictionaries bb ON f.TASK_TYPE = bb.DICTIONARIES_ID + left join SYS_POST sp on sp.POST_ID=f.POST_ID + left join SYS_USER u on u.USER_ID = f.USER_ID + where f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.ISDELETE != '-99' + + and + ( + f.CUSTOM_ID in + + '${item}' + + ) + + + and + ( + f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') + ) + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + + + + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + and f.DEPARTMENT_ID = #{pd.DEPT_ID} + + + 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 = #{pd.DEPT_ID} + + + + 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 = #{pd.DEPT_ID} + + + and + f.DEPARTMENT_ID in + + '${item}' + + + + + + and + f.DEPARTMENT_ID = #{pd.DEPT_ID} + + + and f.USER_ID = #{pd.USER_ID} + and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID} + + + + + + + + and u.NAME LIKE CONCAT(CONCAT('%', #{pd.USERNAME}),'%') + + + + and f.ISDELETE = #{pd.ISDELETE} + + + + + + AND getStandardCheckedNum(f.CUSTOM_ID) > 0 + + + AND getStandardCheckedNum(f.CUSTOM_ID) = 0 + + + + + + + + + AND (select count(1) from bus_hiddendangercheckstandard_checkrecord cc where cc.CUSTOM_ID = f.CUSTOM_ID and cc.FINISHED ='1' and type ='2') > 0 + + + AND (select count(1) from bus_hiddendangercheckstandard_checkrecord cc where cc.CUSTOM_ID = f.CUSTOM_ID and cc.FINISHED ='1' and type ='2') = 0 + + + + + + + and f.PERIOD = #{pd.PERIOD} + + + and f.TYPE = #{pd.TYPE} + + + and ( + (a.STARTTIME is null or a.ENDTIME is null) + or (to_days(a.STARTTIME) < to_days(NOW()) and to_days(a.ENDTIME) > to_days(NOW())) + AND u.WORKSTATUS != '2' + ) + + + and !( + (a.STARTTIME is null or a.ENDTIME is null) + or (to_days(a.STARTTIME) < to_days(NOW()) and to_days(a.ENDTIME) > to_days(NOW())) + or u.WORKSTATUS = '2' + ) + + + + + and d.LEVEL = '' + + + and d.LEVEL = #{pd.LISTINGLEVEL} + + + + + + + and f.CUSTOM_ID in + ( + SELECT CUSTOM_ID + FROM bus_hiddendangercheckstandard_checkrecord + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') >= #{pd.STARTTIME} + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') <= #{pd.ENDTIME} + ) + + + and f.CUSTOM_ID in + ( + SELECT CUSTOM_ID + FROM bus_hiddendangercheckstandard_checkrecord + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') >= #{pd.STARTTIME} + ) + + + and f.LISTMANAGER_ID in + ( + SELECT CUSTOM_ID + FROM bus_hiddendangercheckstandard_checkrecord + WHERE FINISHED = '1' + AND ISDELETE = 0 + and DATE_FORMAT(CHECK_TIME,'%Y-%m-%d %H:%i:%s') <= #{pd.ENDTIME} + ) + + + + + ) f + where 1= 1 + + + + and f.hiddenCount = 0 + + + and f.hiddenCount > 0 + + + + group by f.CUSTOM_ID + order by field(f.ISDELETE,'0','1','2','-1') ,f.OPERATTIME desc ) + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml index 42541ad..8a156ec 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml @@ -36,14 +36,14 @@ - LISTMANAGER_ID, - LIST_NAME, + CUSTOM_ID, CORPINFO_ID, CREATOR, CREATTIME, OPERATOR, OPERATTIME, ISDELETE, + CHECK_USERS, LONGITUDE, LATITUDE, CHECKRECORD_ID, @@ -54,19 +54,20 @@ TYPE, PERIODSTART, PERIODEND, - ISSTATISTICS + ISSTATISTICS, + IMEI - #{LISTMANAGER_ID}, - #{LIST_NAME}, + #{CUSTOM_ID}, #{CORPINFO_ID}, #{CREATOR}, #{CREATTIME}, #{OPERATOR}, #{OPERATTIME}, #{ISDELETE}, + #{CHECK_USERS}, #{LONGITUDE}, #{LATITUDE}, #{CHECKRECORD_ID}, @@ -77,7 +78,8 @@ #{TYPE}, #{PERIODSTART}, #{PERIODEND}, - #{ISSTATISTICS} + #{ISSTATISTICS}, + #{IMEI} @@ -134,7 +136,7 @@ l.END_DATE from f - left join BUS_LISTMANAGER l on f.LISTMANAGER_ID = l.LISTMANAGER_ID + left join bus_hiddendangercheckstandard_custom l on f.CUSTOM_ID = l.CUSTOM_ID left join sys_dictionaries p on l.PERIOD = p.BIANMA left join sys_dictionaries t on l.TYPE = t.BIANMA left join sys_dictionaries s on l.SCREENTYPE = s.BIANMA @@ -143,16 +145,11 @@ where f.CHECKRECORD_ID = #{CHECKRECORD_ID} - - select - f.LISTMANAGER_ID, - f.LIST_NAME, + f.CUSTOM_ID, f.CORPINFO_ID, f.CREATOR, f.CREATTIME, @@ -230,11 +226,11 @@ f.PERIODEND DATEEND, u.NAME AS USER_NAME, su.NAME AS PRINCIPALNAME, - (select group_concat(IFNULL(bh.USER_NAME,chr.NAME)) from BUS_CHECKUSER bh left join sys_user chr on chr.USER_ID=bh.USER_ID where bh.CHECKRECORD_ID=f.CHECKRECORD_ID) CHECK_USERS + (select group_concat(IFNULL(bh.USER_NAME,chr.NAME)) from bus_hiddendangercheckstandard_checkuser bh left join sys_user chr on chr.USER_ID=bh.USER_ID where bh.CHECKRECORD_ID=f.CHECKRECORD_ID) CHECK_USERS from f left join SYS_USER u on u.USERNAME=f.CREATOR - LEFT JOIN BUS_LISTMANAGER l ON l.LISTMANAGER_ID = f.LISTMANAGER_ID + LEFT JOIN bus_hiddendangercheckstandard_custom l ON l.CUSTOM_ID = f.CUSTOM_ID LEFT JOIN SYS_USER su ON su.USER_ID = l.USER_ID where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.FINISHED='1' @@ -244,10 +240,10 @@ f.LIST_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') ) - + and ( - f.LISTMANAGER_ID = #{pd.LISTMANAGER_ID} + f.CUSTOM_ID = #{CUSTOM_ID} ) @@ -256,12 +252,6 @@ l.DEPARTMENT_ID = #{pd.DEPARTMENT_ID} ) - and DATE_FORMAT(CONCAT(#{pd.STARTTIME},' 00:00:00'),'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(f.CREATTIME,'%Y-%m-%d %H:%i:%s') @@ -278,14 +268,6 @@ and f.TYPE= #{pd.TYPE} - @@ -830,6 +812,9 @@ from f where 1=1 and f.ISDELETE =0 + + and f.CUSTOM_ID = #{CUSTOM_ID} + and f.FINISHED=#{FINISHED} @@ -838,10 +823,6 @@ and f.CREATOR=#{USER_ID} - - and - f.LISTMANAGER_ID = #{LISTMANAGER_ID} - and TO_DAYS(f.CHECK_TIME) = TO_DAYS(NOW()) diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.xml new file mode 100644 index 0000000..cbdd253 --- /dev/null +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckUserMapper.xml @@ -0,0 +1,248 @@ + + + + + + + bus_hiddendangercheckstandard_checkuser + + + + + SYS_DICTIONARIES + + + + + f.CHECKRECORD_ID, + f.DEPARTMENT_ID, + f.USER_ID, + f.CHECKUSER_ID, + f.DEPARTMENT_NAME, + f.USER_NAME + + + + + CHECKRECORD_ID, + DEPARTMENT_ID, + USER_ID, + CHECKUSER_ID, + DEPARTMENT_NAME, + USER_NAME + + + + + #{CHECKRECORD_ID}, + #{DEPARTMENT_ID}, + #{USER_ID}, + #{CHECKUSER_ID}, + #{DEPARTMENT_NAME}, + #{USER_NAME} + + + + + insert into + + ( + + ) values ( + + ) + + + + + delete from + + where + CHECKRECORD_ID = #{CHECKRECORD_ID} + + + + + update + + set + CHECKRECORD_ID = #{CHECKRECORD_ID}, + DEPARTMENT_ID = #{DEPARTMENT_ID}, + USER_ID = #{USER_ID}, + CHECKUSER_ID = CHECKUSER_ID + where + CHECKUSER_ID = #{CHECKUSER_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + CHECKUSER_ID in + + #{item} + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomHiddenMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomHiddenMapper.xml index 237245a..dfcdf84 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomHiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomHiddenMapper.xml @@ -1288,7 +1288,7 @@ SELECT FROM - BUS_HIDDEN f + f WHERE f.ISDELETE = '0' and f.SOURCE = '3' diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomItemMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomItemMapper.xml index 3b2570b..847e515 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomItemMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomItemMapper.xml @@ -37,7 +37,8 @@ f.OPERATE_TIME, f.DELETEOR_ID, f.DELETEOR_NAME, - f.DELETE_TIME + f.DELETE_TIME, + f.BAO_BAO_NUM @@ -65,7 +66,7 @@ DELETEOR_ID, DELETEOR_NAME, DELETE_TIME, - COMMON_ITEM_ID + BAO_BAO_NUM @@ -93,7 +94,7 @@ #{DELETEOR_ID}, #{DELETEOR_NAME}, #{DELETE_TIME}, - #{COMMON_ITEM_ID} + #{BAO_BAO_NUM} @@ -106,6 +107,126 @@ ) + + + update + + set + ISDELETE = '1' + where + CUSTOM_ITEM_ID = #{CUSTOM_ITEM_ID} + + + + + update + + set + CHECK_CATEGORY = #{CHECK_CATEGORY}, + CHECK_ITEM = #{CHECK_ITEM}, + CHECK_CONTENT = #{CHECK_CONTENT}, + CHECK_STANDARD = #{CHECK_STANDARD}, + REFERENCE_BASIS = #{REFERENCE_BASIS}, + CHECK_QUALIFIED = #{CHECK_QUALIFIED}, + CHECK_UNQUALIFIED = #{CHECK_UNQUALIFIED}, + OPERATION_TYPE = #{OPERATION_TYPE}, + BAO_BAO_NUM = #{BAO_BAO_NUM}, + LISTCHECKITEM_ID = LISTCHECKITEM_ID + where + CUSTOM_ITEM_ID = #{CUSTOM_ITEM_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1', + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + CUSTOM_ID = #{CUSTOM_ID} + + + + update + + set + ISDELETE = '1' + where + CUSTOM_ITEM_ID in + + #{item} + + - + + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml index 917dceb..0d027af 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomMapper.xml @@ -352,4 +352,232 @@ GROUP BY f.CUSTOM_ID ORDER BY f.COMMON_ITEM_SORT ASC + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.xml new file mode 100644 index 0000000..dda4455 --- /dev/null +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomStatisticsMapper.xml @@ -0,0 +1,477 @@ + + + + + + + bus_hiddendangercheckstandard_statistics + + + + + SYS_DICTIONARIES + + + + + f.STARTTIME, + f.ENDTIME, + f.NOTEXAMINEDNUM, + f.TYPE, + f.PERIOD, + f.CORPINFO_ID, + f.CUSTOMSTATISTICS_ID, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, + f.USER_ID + + + + + + STARTTIME, + ENDTIME, + NOTEXAMINEDNUM, + TYPE, + PERIOD, + CORPINFO_ID, + CUSTOMSTATISTICS_ID, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + USER_ID + + + + + #{STARTTIME}, + #{ENDTIME}, + #{NOTEXAMINEDNUM}, + #{TYPE}, + #{PERIOD}, + #{CORPINFO_ID}, + #{CUSTOMSTATISTICS_ID}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{USER_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + LISTSTATISTICS_ID = #{LISTSTATISTICS_ID} + + + + + delete from + + where + CUSTOMSTATISTICS_ID = #{CUSTOMSTATISTICS_ID} + + + + update + + set + NOTEXAMINEDNUM = #{NOTEXAMINEDNUM}, + OPERATTIME = #{OPERATTIME}, + CUSTOMSTATISTICS_ID = CUSTOMSTATISTICS_ID + where + CUSTOMSTATISTICS_ID = #{CUSTOMSTATISTICS_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + CUSTOMSTATISTICS_ID in + + #{item} + + + + + + + + + + + + + + + + + + + + + + + + +