From c886521b5b3d1061bfd7cb72b22395880e175fbc Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Sun, 4 Feb 2024 08:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E5=8D=95=E6=A3=80=E6=9F=A5=E6=83=85?= =?UTF-8?q?=E5=86=B5=E5=AE=8C=E5=96=84=E9=9A=90=E6=82=A3=E6=8E=92=E6=9F=A5?= =?UTF-8?q?=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check/CheckRecordController.java | 2393 +++++++++-------- .../CustomCheckRecordController.java | 2 +- .../datasource/check/CheckRecordMapper.xml | 185 +- .../CustomCheckRecordItemMapper.xml | 3 +- .../CustomCheckRecordMapper.xml | 3 +- 5 files changed, 1384 insertions(+), 1202 deletions(-) diff --git a/src/main/java/com/zcloud/controller/check/CheckRecordController.java b/src/main/java/com/zcloud/controller/check/CheckRecordController.java index 964bcd0..dfe43eb 100644 --- a/src/main/java/com/zcloud/controller/check/CheckRecordController.java +++ b/src/main/java/com/zcloud/controller/check/CheckRecordController.java @@ -9,6 +9,7 @@ import com.zcloud.logs.LogAnno; import com.zcloud.service.check.*; import com.zcloud.service.corp.CorpInfoService; import com.zcloud.service.hidden.HiddenService; +import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService; import com.zcloud.service.offduty.OffDutyService; import com.zcloud.service.sms.SMSLogService; import com.zcloud.service.sms.SMSManagementService; @@ -35,282 +36,284 @@ import java.util.*; @Controller @RequestMapping("/checkrecord") public class CheckRecordController extends BaseController { - @Autowired - private CorpInfoService corpinfoService; - @Autowired - private CheckRecordService checkrecordService; - @Autowired - private RecordItemService recordItemService; - @Autowired - private ListCheckItemService listcheckitemService; - @Autowired - private HiddenService hiddenService; - @Autowired - private CheckUserService checkuserService; - @Autowired - private ListStatisticsService listStatisticsService; - @Autowired - private ListManagerService listmanagerService; - @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 ListDisableTimeService listDisableTimeService; - @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'); - PageData list = listmanagerService.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")); - } - checkrecordService.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); + @Autowired + private CorpInfoService corpinfoService; + @Autowired + private CheckRecordService checkrecordService; + @Autowired + private RecordItemService recordItemService; + @Autowired + private ListCheckItemService listcheckitemService; + @Autowired + private HiddenService hiddenService; + @Autowired + private CheckUserService checkuserService; + @Autowired + private ListStatisticsService listStatisticsService; + @Autowired + private ListManagerService listmanagerService; + @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 ListDisableTimeService listDisableTimeService; + @Autowired + private SendMessageUtil sendMessageUtil; - checkUser.put("USER_NAME", u.get("USER_NAME")); - checkUser.put("DEPARTMENT_NAME", u.get("DEPARTMENT_NAME")); + /** + * 新增 + * + * @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'); + PageData list = listmanagerService.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")); + } + checkrecordService.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); - 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); + checkUser.put("USER_NAME", u.get("USER_NAME")); + checkUser.put("DEPARTMENT_NAME", u.get("DEPARTMENT_NAME")); - other.put("USER_NAME", ou.get("USER_NAME")); - other.put("DEPARTMENT_NAME", ou.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); - 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 = listcheckitemService.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")); - recordItemService.save(item); + other.put("USER_NAME", ou.get("USER_NAME")); + other.put("DEPARTMENT_NAME", ou.get("DEPARTMENT_NAME")); - } - } - 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); + 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 = listcheckitemService.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")); + recordItemService.save(item); - hiddenService.submitList(pd);// 其他隐患提交 + } + } + 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); - 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 + hiddenService.submitList(pd);// 其他隐患提交 - // 参数集合 - List paramsList = new ArrayList(); - // 第1个参数 - PageData params1 = new PageData(); - params1.put("name", "time");// 存入短信模板中的参数名称 - params1.put("value", h.get("RECTIFICATIONDEADLINE"));// 存入上面参数名称所传递的值 - paramsList.add(params1); + 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 - sendMessageUtil.sendMessages(mes, paramsList); - } - } - } - map.put("result", errInfo); - return map; - } + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "time");// 存入短信模板中的参数名称 + params1.put("value", h.get("RECTIFICATIONDEADLINE"));// 存入上面参数名称所传递的值 + paramsList.add(params1); - /** - * 删除 - * - * @param out - * @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(); - checkrecordService.delete(pd); - recordItemService.delete(pd); - map.put("result", errInfo); // 返回结果 - return map; - } + sendMessageUtil.sendMessages(mes, paramsList); + } + } + } + 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(); - checkrecordService.edit(pd); - map.put("result", errInfo); - return map; - } + /** + * 删除 + * + * @param out + * @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(); + checkrecordService.delete(pd); + recordItemService.delete(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",listcheckitemService.findHidden(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(); + checkrecordService.edit(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()); + /** + * 获取隐患数据 + * + * @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", listcheckitemService.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(); @@ -442,265 +445,264 @@ public class CheckRecordController extends BaseController { page.setPd(pd); varList = checkrecordService.list(page); // 列出CheckRecord列表 }*/ - page.setPd(pd); - List varList = checkrecordService.list(page); - PageData ls = listmanagerService.findById(pd); - map.put("varList", varList); - map.put("page", page); - map.put("ls", ls); - map.put("result", errInfo); - return map; - } + page.setPd(pd); + // 风险管控清单 + map.put("ls", listmanagerService.findById(pd)); + map.put("varList", checkrecordService.list(page)); + map.put("page", page); + 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); + /** + * 清单统计 + * + * @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; - } + 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 = checkrecordService.findById(pd); // 根据ID读取 - PageData condition = new PageData(); - condition.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID")); - PageData listManager = listmanagerService.findById(condition); - pd.put("BAO_BAO_TYPE",listManager.getString("BAO_BAO_TYPE")); - PageData users = checkuserService.getCheckUser(pd); - List varList = recordItemService.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); + /** + * 去修改页面获取数据 + * + * @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 = checkrecordService.findById(pd); // 根据ID读取 + PageData condition = new PageData(); + condition.put("LISTMANAGER_ID", pd.getString("LISTMANAGER_ID")); + PageData listManager = listmanagerService.findById(condition); + pd.put("BAO_BAO_TYPE", listManager.getString("BAO_BAO_TYPE")); + PageData users = checkuserService.getCheckUser(pd); + List varList = recordItemService.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; - } + 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 = checkrecordService.findById(pd); - List varList = recordItemService.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; - } + @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 = checkrecordService.findById(pd); + List varList = recordItemService.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(","); - checkrecordService.deleteAll(ArrayDATA_IDS); - errInfo = "success"; - } else { - errInfo = "error"; - } - 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(","); + checkrecordService.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 = checkrecordService.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; - } + /** + * 导出到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 = checkrecordService.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()); + 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; - } + 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)); - } + /** + * 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()); // 企业 + /** + * 去修改页面获取数据 + * + * @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; + 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 "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 "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 "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 "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 "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; + 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; - } + default: + break; + } // switch (pd.get("COUNTTYPE").toString()) { // case "month": // pd.put("STARTTIME", DateUtil.getMonthFirstDay()+" 00:00:00"); @@ -718,231 +720,231 @@ public class CheckRecordController extends BaseController { // default: // break; // } - String STARTTIME = pd.getString("STARTTIME"); - String ENDTIME = pd.getString("ENDTIME"); + 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 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);// 统计分母 + List countList = listStatisticsService.getCountList(pd);// 统计分母 - if (countList != null && countList.size() > 0) { - int sum = 0; - List dayList = checkrecordService.listCountDay(pd); // 统计--日 - if (dayList != null && dayList.size() > 0) { - for (PageData count : dayList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - List weekList = checkrecordService.listCountWeek(pd); // 统计--周 - if (weekList != null && weekList.size() > 0) { - for (PageData count : weekList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - List monthList = checkrecordService.listCountMonth(pd); // 统计--月 + if (countList != null && countList.size() > 0) { + int sum = 0; + List dayList = checkrecordService.listCountDay(pd); // 统计--日 + if (dayList != null && dayList.size() > 0) { + for (PageData count : dayList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List weekList = checkrecordService.listCountWeek(pd); // 统计--周 + if (weekList != null && weekList.size() > 0) { + for (PageData count : weekList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List monthList = checkrecordService.listCountMonth(pd); // 统计--月 - if (monthList != null && monthList.size() > 0) { - for (PageData count : monthList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - List quarterList = checkrecordService.listCountQuarter(pd); // 统计--季 + if (monthList != null && monthList.size() > 0) { + for (PageData count : monthList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List quarterList = checkrecordService.listCountQuarter(pd); // 统计--季 - if (quarterList != null && quarterList.size() > 0) { - for (PageData count : quarterList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - List halfYearList = checkrecordService.listCountHalfYear(pd); // 统计--半年 + if (quarterList != null && quarterList.size() > 0) { + for (PageData count : quarterList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List halfYearList = checkrecordService.listCountHalfYear(pd); // 统计--半年 - if (halfYearList != null && halfYearList.size() > 0) { - for (PageData count : halfYearList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - List yearList = checkrecordService.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()); + if (halfYearList != null && halfYearList.size() > 0) { + for (PageData count : halfYearList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List yearList = checkrecordService.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")); + 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 = checkrecordService.listCountTenDays(pd); // 统计--旬 - if (tenDaysList != null && tenDaysList.size() > 0) { - for (PageData count : tenDaysList) { - sum += Integer.parseInt(count.get("NUM").toString()); - } - } - // 分母 - for (PageData count : countList) { + 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 = checkrecordService.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 allDenominator = Integer.parseInt(count.get("NOTEXAMINEDNUM").toString()) + + Integer.parseInt(all.get("denominator").toString()); + all.put("denominator", allDenominator); + } - Integer jjr = checkrecordService.listCountJjr(pd) == null ? 0 : checkrecordService.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)); - } - } + Integer jjr = checkrecordService.listCountJjr(pd) == null ? 0 : checkrecordService.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; - } + 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"); + /** + * 去修改页面获取数据 + * + * @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(); + 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(); + PageData all = new PageData(); - Map varMap = new HashMap(); + Map varMap = new HashMap(); - listType0001.put("type", "listType0001"); - listType0001.put("name", "日常"); - listType0001.put("molecule", 0); - listType0001.put("denominator", 0); - listType0001.put("percentage", 0d); + 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); + 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); + 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); + 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); + 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", "临时"); @@ -950,345 +952,346 @@ public class CheckRecordController extends BaseController { // 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); + 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("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); + varMap.put("all", all); - List countList = listStatisticsService.getCountList(pd);// 统计分母 + List countList = listStatisticsService.getCountList(pd);// 统计分母 - if (countList != null && countList.size() > 0) { - List dayList = checkrecordService.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); + if (countList != null && countList.size() > 0) { + List dayList = checkrecordService.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 = checkrecordService.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 weekList = checkrecordService.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 = checkrecordService.listCountMonth(pd); // 统计--月 + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List monthList = checkrecordService.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); + 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 = checkrecordService.listCountQuarter(pd); // 统计--季 + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List quarterList = checkrecordService.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); + 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 = checkrecordService.listCountHalfYear(pd); // 统计--半年 + Integer allMolecule = Integer.parseInt(count.get("NUM").toString()) + + Integer.parseInt(varMap.get("all").get("molecule").toString()); + varMap.get("all").put("molecule", allMolecule); + } + } + List halfYearList = checkrecordService.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); + 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 = checkrecordService.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); + } + } + List yearList = checkrecordService.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()); + 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")); + 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 = checkrecordService.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); + 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 = checkrecordService.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 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)); - } + 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 = checkrecordService.listCountJjr(pd) == null ? 0 : checkrecordService.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; - } + } + varList.add(varMap.get(type)); + } + if (!varMap.get("listType0005").get("denominator").toString().equals("0")) { + Integer jjr = checkrecordService.listCountJjr(pd) == null ? 0 : checkrecordService.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 = checkrecordService.listLogByIde(pd); - map.put("varList", varList); - 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 = checkrecordService.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 = checkrecordService.getWorkedUserCount(pd); - int allDep = departmentService.getDepCount(pd); - int workDep = checkrecordService.getWorkedDepCount(pd); - int allList = listmanagerService.getListCount(pd); - int workList = listmanagerService.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 = "/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 = checkrecordService.getWorkedUserCount(pd); + int allDep = departmentService.getDepCount(pd); + int workDep = checkrecordService.getWorkedDepCount(pd); + int allList = listmanagerService.getListCount(pd); + int workList = listmanagerService.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()); // 企业 + /** + * 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 = checkrecordService.listTypeBi(pd); - map.put("typeList", typeList); - map.put("result", errInfo); - return map; - } + List typeList = checkrecordService.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 = checkrecordService.list(page); - map.put("varList", varList); - map.put("page", page); - 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 = checkrecordService.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(); + /** + * 补录 + * 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("TYPE", "1"); + pd.put("ISSTATISTICS", "1"); - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 - pd.put("OPERATOR", Jurisdiction.getName()); // 添加人 - checkrecordService.recording(pd);// 修改检查记录 - //pd = checkrecordService.findById(pd); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + pd.put("OPERATOR", Jurisdiction.getName()); // 添加人 + checkrecordService.recording(pd);// 修改检查记录 + //pd = checkrecordService.findById(pd); // PageData sysdate = new PageData(); // sysdate.put("DATE", pd.get("CHECK_TIME")); // sysdate = sysDateService.findByDate(sysdate); @@ -1334,191 +1337,191 @@ public class CheckRecordController extends BaseController { // pd.put("PERIODEND", list.get("END_DATE")); // } // checkrecordService.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); + 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")); + 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); + 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")); + 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 = listcheckitemService.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")); - recordItemService.save(item); + 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 = listcheckitemService.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")); + recordItemService.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); + } + } + 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 + 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); + // 参数集合 + 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; - } + 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 = listmanagerService.getListByCorplistPage(page); + /** + * 员工清单检查情况(月) + * + * @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 = listmanagerService.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 (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 = checkrecordService.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未检查 - } - }); - } + if (listIds.size() > 0) { + pd.put("LIST_IDS", listIds); + List recordList = checkrecordService.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; - } + 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/CustomCheckRecordController.java b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java index b723380..61b8348 100644 --- a/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java +++ b/src/main/java/com/zcloud/controller/hiddenDangerCheckStandard/CustomCheckRecordController.java @@ -491,7 +491,7 @@ public class CustomCheckRecordController extends BaseController { pd = this.getPageData(); pd = customCheckRecordService.findById(pd); // 根据ID读取 PageData condition = new PageData(); - condition.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID")); + condition.put("CUSTOM_ID",pd.getString("CUSTOM_ID")); PageData listManager = customService.findById(condition); pd.put("BAO_BAO_TYPE",listManager.getString("BAO_BAO_TYPE")); PageData users = checkuserService.getCheckUser(pd); diff --git a/src/main/resources/mybatis/datasource/check/CheckRecordMapper.xml b/src/main/resources/mybatis/datasource/check/CheckRecordMapper.xml index 0523511..63e30be 100644 --- a/src/main/resources/mybatis/datasource/check/CheckRecordMapper.xml +++ b/src/main/resources/mybatis/datasource/check/CheckRecordMapper.xml @@ -212,7 +212,8 @@ diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordItemMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordItemMapper.xml index 23ec3d8..d03430e 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordItemMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordItemMapper.xml @@ -157,8 +157,7 @@ select , (select h.HIDDEN_ID from BUS_HIDDENDANGERCHECKSTANDARD_HIDDEN h where h.RECORDITEM_ID=f.RECORDITEM_ID and h.CHECKRECORD_ID=f.CHECKRECORD_ID and h.ISDELETE= '0') as HIDDEN_ID, - ( select count(1) from bus_imgfiles i where i.FOREIGN_KEY = f.RECORDITEM_ID and i.TYPE = '14' ) AS IMGCOUNT, - r.IDENTIFICATION_ID + ( select count(1) from bus_imgfiles i where i.FOREIGN_KEY = f.RECORDITEM_ID and i.TYPE = '14' ) AS IMGCOUNT from f where f.CHECKRECORD_ID=#{CHECKRECORD_ID} diff --git a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml index 5ccdb01..3cf2b03 100644 --- a/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenDangerCheckStandard/CustomCheckRecordMapper.xml @@ -210,7 +210,6 @@ order by IFNULL( f.CHECK_TIME, f.PERIODEND ) desc