| | |
| | | HiddenDangerCheckPointExport export = new HiddenDangerCheckPointExport(); |
| | | export.setIndex(String.valueOf(i + 1)); |
| | | if (hcp != null) { |
| | | //排查方式 |
| | | if ("2".equals(hcp.getDangerSources())) { |
| | | export.setCheckType("隐患上报"); |
| | | } else { |
| | | if ("1".equals(hcp.getCheckType())) { |
| | | export.setCheckType("基础清单排查"); |
| | | } else if ("2".equals(hcp.getCheckType())) { |
| | | export.setCheckType("风险单元清单排查"); |
| | | } else { |
| | | export.setCheckType("风险单元清单排查"); |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getDangerDescription())){ |
| | | export.setDangerDescription(hcp.getDangerDescription()); |
| | | } |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getCheckPerson())){ |
| | | export.setCheckPerson(hcp.getCheckPerson()); |
| | | } |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getFindTime())){ |
| | | export.setFindTime(DateUtils.parseDateToStr("yyyy-MM-dd", hcp.getFindTime())); |
| | | } |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getDangerLevel())){ |
| | | if (hcp.getDangerLevel().equals("0")){ |
| | | export.setDangerLevel("一般隐患"); |
| | | }else if (hcp.getDangerLevel().equals("1")){ |
| | | export.setDangerLevel("重大隐患"); |
| | | }else if (hcp.getDangerLevel().equals("2")){ |
| | | export.setDangerLevel("不是隐患"); |
| | | } |
| | | } |
| | | |
| | | //基础清单名称 |
| | | if ("1".equals(hcp.getCheckType()) && !StringUtils.isEmpty(hcp.getRiskName())) { |
| | | export.setBaseRiskName(hcp.getRiskName()); |
| | | } else { |
| | | export.setBaseRiskName("-"); |
| | | } |
| | | |
| | | //风险单元 |
| | | if ((!("1".equals(hcp.getCheckType()))) && !StringUtils.isEmpty(hcp.getRiskName())) { |
| | | export.setRiskPointName(hcp.getRiskName()); |
| | | } else { |
| | | export.setRiskPointName("-"); |
| | | } |
| | | |
| | | //风险单元类型 |
| | | if ("1".equals(hcp.getRiskType())) { |
| | | export.setRiskPointType("设备设施清单"); |
| | | } else if ("2".equals(hcp.getRiskType())) { |
| | | export.setRiskPointType("作业活动清单"); |
| | | } else if ("3".equals(hcp.getRiskType())) { |
| | | export.setRiskPointType("工艺节点清单"); |
| | | } |
| | | // 隐患责任部门 |
| | | export.setDangerDep(hcp.getRectifyDeptName()); |
| | | |
| | | //隐患名称 |
| | | export.setDangerName(hcp.getDangerName()); |
| | | |
| | | //隐患描述 todo |
| | | export.setDangerDescription(hcp.getDangerDescription()); |
| | | |
| | | //隐患级别 |
| | | if ("0".equals(hcp.getDangerLevel())) { |
| | | export.setDangerLevel("一般隐患"); |
| | | } else if ("1".equals(hcp.getDangerLevel())) { |
| | | export.setDangerLevel("重大隐患"); |
| | | } else if ("2".equals(hcp.getDangerLevel())) { |
| | | export.setDangerLevel("不是隐患"); |
| | | } else { |
| | | export.setDangerLevel(""); |
| | | } |
| | | |
| | | //隐患来源 |
| | | if ("1".equals(hcp.getDangerSources())) { |
| | | export.setDangerSources("隐患排查计划"); |
| | | } else if ("2".equals(hcp.getDangerSources())) { |
| | | export.setDangerSources("隐患上报"); |
| | | } else if ("3".equals(hcp.getDangerSources())) { |
| | | export.setDangerSources("定时隐患排查"); |
| | | } else { |
| | | export.setDangerSources(""); |
| | | } |
| | | |
| | | //整改完成期限 |
| | | if(ObjectUtils.isNotEmpty(hcp.getRectifyDeadlineTime())){ |
| | | export.setRectifyDeadlineTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyDeadlineTime())); |
| | | export.setRectifyDeadlineTime(DateUtils.parseDateToStr("yyyy-MM-dd", hcp.getRectifyDeadlineTime())); |
| | | } |
| | | |
| | | //整改完成时间 |
| | | if(ObjectUtils.isNotEmpty(hcp.getRectifyCompleteTime())){ |
| | | export.setRectifyCompleteTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyCompleteTime())); |
| | | if (ObjectUtils.isNotEmpty(hcp.getJudgeUserName())){ |
| | | export.setJudgeUserName(hcp.getJudgeUserName()); |
| | | } |
| | | |
| | | //整改状态 |
| | | if (!StringUtils.isEmpty(hcp.getStage())) { |
| | | if ("3".equals(hcp.getStage())) { |
| | | if (!StringUtils.isEmpty(hcp.getExamineStatus())) { |
| | | if ("0".equals(hcp.getExamineStatus())) { |
| | | export.setRectifyStatus("待核查"); |
| | | } else if ("1".equals(hcp.getExamineStatus())) { |
| | | export.setRectifyStatus("已核查"); |
| | | } |
| | | } |
| | | } else if ("4".equals(hcp.getStage())) { |
| | | if (!StringUtils.isEmpty(hcp.getRectifyStatus())) { |
| | | if ("0".equals(hcp.getRectifyStatus())) { |
| | | export.setRectifyStatus("未整改"); |
| | | } else if ("1".equals(hcp.getRectifyStatus())) { |
| | | export.setRectifyStatus("已整改"); |
| | | } |
| | | } |
| | | } else if ("5".equals(hcp.getStage())) { |
| | | if (!StringUtils.isEmpty(hcp.getAcceptStatus())) { |
| | | if ("0".equals(hcp.getAcceptStatus())) { |
| | | export.setRectifyStatus("未验收"); |
| | | } else if ("1".equals(hcp.getAcceptStatus())) { |
| | | export.setRectifyStatus("已验收"); |
| | | } else if ("2".equals(hcp.getAcceptStatus())) { |
| | | export.setRectifyStatus("验收未通过"); |
| | | } |
| | | } |
| | | SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | if (f.parse(f.format(hcp.getRectifyDeadlineTime())).before(f.parse(f.format(hcp.getRectifyCompleteTime())))) { |
| | | export.setRectifyStatus(export.getRectifyStatus() + "(超期改)"); |
| | | } else { |
| | | export.setRectifyStatus(export.getRectifyStatus() + "(按期改)"); |
| | | } |
| | | } catch (ParseException e) { |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(hcp.getRectifyMeasure())){ |
| | | export.setRectifyMeasure(hcp.getRectifyMeasure()); |
| | | } |
| | | if (hcp.getRegisterCreateTime() != null) { |
| | | export.setRegisterCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRegisterCreateTime())); |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getRectifyCompleteTime())){ |
| | | export.setRectifyCompleteTime(DateUtils.parseDateToStr("yyyy-MM-dd", hcp.getRectifyCompleteTime())); |
| | | } |
| | | if (hcp.getExamineCreateTime() != null) { |
| | | export.setExamineCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getExamineCreateTime())); |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getAcceptUserName())){ |
| | | export.setAcceptUserName(hcp.getAcceptUserName()); |
| | | } |
| | | if (hcp.getRectifyCreateTime() != null) { |
| | | export.setRectifyCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyCreateTime())); |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getAcceptCreateTime())){ |
| | | export.setAcceptCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd", hcp.getAcceptCreateTime())); |
| | | } |
| | | if (hcp.getAcceptCreateTime() != null) { |
| | | export.setAcceptCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getAcceptCreateTime())); |
| | | |
| | | if (ObjectUtils.isNotEmpty(hcp.getAcceptOpinion())){ |
| | | export.setAcceptOpinion(hcp.getAcceptOpinion()); |
| | | } |
| | | export.setPreRectifyPhoto(hcp.getPreRectifyPhoto()); |
| | | export.setTroubleTypeName(hcp.getTroubleTypeName()); |
| | | export.setRegisterUserName(hcp.getRegisterUserName()); |
| | | export.setExamineUserName(hcp.getExamineUserName()); |
| | | export.setRectifyUserName(hcp.getRectifyUserName()); |
| | | export.setRectifyMeasure(hcp.getRectifyMeasure()); |
| | | export.setPostRectifyPhoto(hcp.getPostRectifyPhoto()); |
| | | export.setAcceptUserName(hcp.getAcceptUserName()); |
| | | exportList.add(export); |
| | | |
| | | } |
| | | exportList.add(export); |
| | | } |
| | | |
| | | // for (int i = 0; i < list.size(); i++) { |
| | | // HiddenDangerCheckPoint hcp = list.get(i); |
| | | // HiddenDangerCheckPointExport export = new HiddenDangerCheckPointExport(); |
| | | // export.setIndex(String.valueOf(i + 1)); |
| | | // if (hcp != null) { |
| | | // //排查方式 |
| | | // if ("2".equals(hcp.getDangerSources())) { |
| | | // export.setCheckType("隐患上报"); |
| | | // } else { |
| | | // if ("1".equals(hcp.getCheckType())) { |
| | | // export.setCheckType("基础清单排查"); |
| | | // } else if ("2".equals(hcp.getCheckType())) { |
| | | // export.setCheckType("风险单元清单排查"); |
| | | // } else { |
| | | // export.setCheckType("风险单元清单排查"); |
| | | // } |
| | | // } |
| | | // |
| | | // //基础清单名称 |
| | | // if ("1".equals(hcp.getCheckType()) && !StringUtils.isEmpty(hcp.getRiskName())) { |
| | | // export.setBaseRiskName(hcp.getRiskName()); |
| | | // } else { |
| | | // export.setBaseRiskName("-"); |
| | | // } |
| | | // |
| | | // //风险单元 |
| | | // if ((!("1".equals(hcp.getCheckType()))) && !StringUtils.isEmpty(hcp.getRiskName())) { |
| | | // export.setRiskPointName(hcp.getRiskName()); |
| | | // } else { |
| | | // export.setRiskPointName("-"); |
| | | // } |
| | | // |
| | | // //风险单元类型 |
| | | // if ("1".equals(hcp.getRiskType())) { |
| | | // export.setRiskPointType("设备设施清单"); |
| | | // } else if ("2".equals(hcp.getRiskType())) { |
| | | // export.setRiskPointType("作业活动清单"); |
| | | // } else if ("3".equals(hcp.getRiskType())) { |
| | | // export.setRiskPointType("工艺节点清单"); |
| | | // } |
| | | // // 隐患责任部门 |
| | | // export.setDangerDep(hcp.getRectifyDeptName()); |
| | | // |
| | | // //隐患名称 |
| | | // export.setDangerName(hcp.getDangerName()); |
| | | // |
| | | // //隐患描述 todo |
| | | // export.setDangerDescription(hcp.getDangerDescription()); |
| | | // |
| | | // //隐患级别 |
| | | // if ("0".equals(hcp.getDangerLevel())) { |
| | | // export.setDangerLevel("一般隐患"); |
| | | // } else if ("1".equals(hcp.getDangerLevel())) { |
| | | // export.setDangerLevel("重大隐患"); |
| | | // } else if ("2".equals(hcp.getDangerLevel())) { |
| | | // export.setDangerLevel("不是隐患"); |
| | | // } else { |
| | | // export.setDangerLevel(""); |
| | | // } |
| | | // |
| | | // //隐患来源 |
| | | // if ("1".equals(hcp.getDangerSources())) { |
| | | // export.setDangerSources("隐患排查计划"); |
| | | // } else if ("2".equals(hcp.getDangerSources())) { |
| | | // export.setDangerSources("隐患上报"); |
| | | // } else if ("3".equals(hcp.getDangerSources())) { |
| | | // export.setDangerSources("定时隐患排查"); |
| | | // } else { |
| | | // export.setDangerSources(""); |
| | | // } |
| | | // |
| | | // //整改完成期限 |
| | | // if(ObjectUtils.isNotEmpty(hcp.getRectifyDeadlineTime())){ |
| | | // export.setRectifyDeadlineTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyDeadlineTime())); |
| | | // } |
| | | // |
| | | // //整改完成时间 |
| | | // if(ObjectUtils.isNotEmpty(hcp.getRectifyCompleteTime())){ |
| | | // export.setRectifyCompleteTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyCompleteTime())); |
| | | // } |
| | | // |
| | | // //整改状态 |
| | | // if (!StringUtils.isEmpty(hcp.getStage())) { |
| | | // if ("3".equals(hcp.getStage())) { |
| | | // if (!StringUtils.isEmpty(hcp.getExamineStatus())) { |
| | | // if ("0".equals(hcp.getExamineStatus())) { |
| | | // export.setRectifyStatus("待核查"); |
| | | // } else if ("1".equals(hcp.getExamineStatus())) { |
| | | // export.setRectifyStatus("已核查"); |
| | | // } |
| | | // } |
| | | // } else if ("4".equals(hcp.getStage())) { |
| | | // if (!StringUtils.isEmpty(hcp.getRectifyStatus())) { |
| | | // if ("0".equals(hcp.getRectifyStatus())) { |
| | | // export.setRectifyStatus("未整改"); |
| | | // } else if ("1".equals(hcp.getRectifyStatus())) { |
| | | // export.setRectifyStatus("已整改"); |
| | | // } |
| | | // } |
| | | // } else if ("5".equals(hcp.getStage())) { |
| | | // if (!StringUtils.isEmpty(hcp.getAcceptStatus())) { |
| | | // if ("0".equals(hcp.getAcceptStatus())) { |
| | | // export.setRectifyStatus("未验收"); |
| | | // } else if ("1".equals(hcp.getAcceptStatus())) { |
| | | // export.setRectifyStatus("已验收"); |
| | | // } else if ("2".equals(hcp.getAcceptStatus())) { |
| | | // export.setRectifyStatus("验收未通过"); |
| | | // } |
| | | // } |
| | | // SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); |
| | | // try { |
| | | // if (f.parse(f.format(hcp.getRectifyDeadlineTime())).before(f.parse(f.format(hcp.getRectifyCompleteTime())))) { |
| | | // export.setRectifyStatus(export.getRectifyStatus() + "(超期改)"); |
| | | // } else { |
| | | // export.setRectifyStatus(export.getRectifyStatus() + "(按期改)"); |
| | | // } |
| | | // } catch (ParseException e) { |
| | | // } |
| | | // } |
| | | // } |
| | | // if (hcp.getRegisterCreateTime() != null) { |
| | | // export.setRegisterCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRegisterCreateTime())); |
| | | // } |
| | | // if (hcp.getExamineCreateTime() != null) { |
| | | // export.setExamineCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getExamineCreateTime())); |
| | | // } |
| | | // if (hcp.getRectifyCreateTime() != null) { |
| | | // export.setRectifyCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getRectifyCreateTime())); |
| | | // } |
| | | // if (hcp.getAcceptCreateTime() != null) { |
| | | // export.setAcceptCreateTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", hcp.getAcceptCreateTime())); |
| | | // } |
| | | // export.setPreRectifyPhoto(hcp.getPreRectifyPhoto()); |
| | | // export.setTroubleTypeName(hcp.getTroubleTypeName()); |
| | | // export.setRegisterUserName(hcp.getRegisterUserName()); |
| | | // export.setExamineUserName(hcp.getExamineUserName()); |
| | | // export.setRectifyUserName(hcp.getRectifyUserName()); |
| | | // export.setRectifyMeasure(hcp.getRectifyMeasure()); |
| | | // export.setPostRectifyPhoto(hcp.getPostRectifyPhoto()); |
| | | // export.setAcceptUserName(hcp.getAcceptUserName()); |
| | | // exportList.add(export); |
| | | // } |
| | | // } |
| | | |
| | | ExcelUtilByDangerLedger<HiddenDangerCheckPointExport> util = new ExcelUtilByDangerLedger<HiddenDangerCheckPointExport>(HiddenDangerCheckPointExport.class); |
| | | return util.exportExcel(exportList, companyName + "隐患排查台账"); |
| | | } |