| | |
| | | var pageReqVO = new cn.iocoder.yudao.module.mes.controller.admin.safety.vo.cert.SafetyCertificatePageReqVO(); |
| | | pageReqVO.setPageNo(1); |
| | | pageReqVO.setPageSize(50_000); |
| | | List<List<Object>> rows = certificateService.getCertificatePage(pageReqVO) |
| | | .getList().stream() |
| | | var certs = certificateService.getCertificatePage(pageReqVO).getList(); |
| | | // 导出时用员工档案的最新姓名/工号/部门 |
| | | certificateService.fillEmployeeInfo(certs); |
| | | List<List<Object>> rows = certs.stream() |
| | | .map(c -> Arrays.<Object>asList( |
| | | str(c.getEmployeeName()), str(c.getEmployeeNo()), str(c.getDeptName()), |
| | | SafetyCertificateTypeEnum.getNameByType(c.getCertType()), str(c.getCertNo()), |
| | |
| | | if (start != null && end != null) { |
| | | reqVO.setInspectTime(new java.time.LocalDateTime[]{start.atStartOfDay(), end.atTime(23, 59, 59)}); |
| | | } |
| | | List<List<Object>> rows = inspectionService.getInspectionPage(reqVO).getList().stream() |
| | | var inspections = inspectionService.getInspectionPage(reqVO).getList(); |
| | | inspectionService.fillInspectorNames(inspections); |
| | | List<List<Object>> rows = inspections.stream() |
| | | .map(i -> Arrays.<Object>asList( |
| | | dateTime(i.getInspectTime()), str(i.getPointName()), |
| | | SafetyInspectionPointTypeEnum.getNameByType(i.getPointType()), |
| | |
| | | if (start != null && end != null) { |
| | | reqVO.setReportTime(new java.time.LocalDateTime[]{start.atStartOfDay(), end.atTime(23, 59, 59)}); |
| | | } |
| | | List<List<Object>> rows = hazardService.getHazardPage(reqVO).getList().stream() |
| | | var hazards = hazardService.getHazardPage(reqVO).getList(); |
| | | hazardService.fillPersonNames(hazards); |
| | | List<List<Object>> rows = hazards.stream() |
| | | .map(h -> Arrays.<Object>asList( |
| | | str(h.getCode()), str(h.getTitle()), |
| | | SafetyHazardLevelEnum.getNameByLevel(h.getLevel()), |
| | |
| | | if (start != null && end != null) { |
| | | reqVO.setPlanStartTime(new java.time.LocalDateTime[]{start.atStartOfDay(), end.atTime(23, 59, 59)}); |
| | | } |
| | | List<List<Object>> rows = permitService.getPermitPage(reqVO).getList().stream() |
| | | var permits = permitService.getPermitPage(reqVO).getList(); |
| | | permitService.fillPermitRefs(permits); |
| | | List<List<Object>> rows = permits.stream() |
| | | .map(p -> Arrays.<Object>asList( |
| | | str(p.getCode()), SafetyPermitTypeEnum.getNameByType(p.getPermitType()), |
| | | str(p.getTitle()), str(p.getWorkshopName()), str(p.getLocation()), |
| | |
| | | reqVO.setPageSize(5_000); |
| | | List<List<Object>> rows = new ArrayList<>(); |
| | | for (SafetyWorkPermitDO permit : permitService.getPermitPage(reqVO).getList()) { |
| | | for (SafetyWorkPermitMonitorDO monitor : permitService.getMonitorList(permit.getId())) { |
| | | var monitors = permitService.getMonitorList(permit.getId()); |
| | | permitService.fillMonitorGuardians(monitors); |
| | | for (SafetyWorkPermitMonitorDO monitor : monitors) { |
| | | rows.add(Arrays.asList(str(permit.getCode()), dateTime(monitor.getMonitorTime()), |
| | | str(monitor.getGuardian()), str(monitor.getMonitorContent()), str(monitor.getAbnormal()))); |
| | | } |
| | |
| | | var reqVO = new cn.iocoder.yudao.module.mes.controller.admin.safety.vo.material.SafetyMaterialPageReqVO(); |
| | | reqVO.setPageNo(1); |
| | | reqVO.setPageSize(50_000); |
| | | List<List<Object>> rows = materialService.getMaterialPage(reqVO).getList().stream() |
| | | var materials = materialService.getMaterialPage(reqVO).getList(); |
| | | materialService.fillManagers(materials); |
| | | List<List<Object>> rows = materials.stream() |
| | | .map(m -> Arrays.<Object>asList( |
| | | str(m.getCode()), str(m.getName()), |
| | | SafetyMaterialCategoryEnum.getNameByCategory(m.getCategory()), |
| | |
| | | private Sheet trainingSheet(LocalDate start, LocalDate end) { |
| | | List<String> headers = List.of("培训日期", "培训主题", "培训类型", "学时", "讲师/组织人", |
| | | "培训地点", "参加人数", "培训内容", "考核情况"); |
| | | List<List<Object>> rows = trainingService.listTrainingBetween(start, end).stream() |
| | | var trainings = trainingService.listTrainingBetween(start, end); |
| | | trainingService.fillTrainers(trainings); |
| | | List<List<Object>> rows = trainings.stream() |
| | | .map(t -> Arrays.<Object>asList( |
| | | date(t.getTrainDate()), str(t.getTitle()), |
| | | SafetyTrainingTypeEnum.getNameByType(t.getTrainingType()), |
| | |
| | | private Sheet drillSheet(LocalDate start, LocalDate end) { |
| | | List<String> headers = List.of("演练日期", "演练名称", "演练类型", "地点", "组织人", |
| | | "参加人数", "时长(分钟)", "演练过程", "总结与改进"); |
| | | List<List<Object>> rows = trainingService.listDrillBetween(start, end).stream() |
| | | var drills = trainingService.listDrillBetween(start, end); |
| | | trainingService.fillOrganizers(drills); |
| | | List<List<Object>> rows = drills.stream() |
| | | .map(d -> Arrays.<Object>asList( |
| | | date(d.getDrillDate()), str(d.getTitle()), |
| | | SafetyDrillTypeEnum.getNameByType(d.getDrillType()), str(d.getLocation()), |
| | |
| | | private Sheet accidentSheet(LocalDate start, LocalDate end) { |
| | | List<String> headers = List.of("事故编号", "事故名称", "事故类型", "等级", "发生时间", "发生地点", |
| | | "伤亡情况", "经济损失(元)", "事故经过", "原因分析", "处理措施", "状态"); |
| | | List<List<Object>> rows = trainingService.listAccidentBetween(start, end).stream() |
| | | var accidents = trainingService.listAccidentBetween(start, end); |
| | | trainingService.fillAccidentRefs(accidents); |
| | | List<List<Object>> rows = accidents.stream() |
| | | .map(a -> Arrays.<Object>asList( |
| | | str(a.getCode()), str(a.getTitle()), |
| | | SafetyAccidentTypeEnum.getNameByType(a.getAccidentType()), |