From 299fa5c882af4577ba867ed9de9e2dc4fade3f6d Mon Sep 17 00:00:00 2001 From: 郑永安 <zyazyz250@sina.com> Date: 星期一, 19 六月 2023 14:50:38 +0800 Subject: [PATCH] 迁移提交 --- src/main/java/com/gk/hotwork/specialWork/repository/WorkGroundBreakingInfoRepository.java | 28 src/main/java/com/gk/hotwork/specialWork/enums/RuleContinueTimeUnitEnum.java | 62 src/main/java/com/gk/hotwork/HotworkApplication.java | 54 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskMapService.java | 28 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemListRespDTO.java | 125 src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointCoordMapper.xml | 25 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigServiceImpl.java | 44 src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandPageQuery.java | 32 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyEight.java | 8 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageMapper.xml | 303 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsPreventDangerPageReqDTO.java | 110 src/main/java/com/gk/hotwork/Controller/AppFileController.java | 210 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManageTimeout.java | 71 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlTemplateServiceImpl.java | 27 src/main/java/com/gk/hotwork/Domain/Enum/SendStatus.java | 31 src/main/java/com/gk/hotwork/specialWork/util/WorkPrintShiftUtil.java | 88 src/main/java/com/gk/hotwork/specialWork/model/update/EntityStatusBatchUO.java | 60 src/main/java/com/gk/hotwork/Mapper/HiddenDangerResourceMapper.java | 10 src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanMapper.xml | 34 src/main/java/com/gk/hotwork/Mapper/DictionaryItemInfoMapper.java | 33 src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessDetectionInfo.java | 178 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkConfinedSpaceInfo.xml | 56 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskAnaUnitController.java | 32 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlClassifyMapper.xml | 63 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyOperatorInfoService.java | 14 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyGroundBreakingRespDTO.java | 80 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskEventQueryReqDTO.java | 23 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleItemMeasureService.java | 53 src/main/java/com/gk/hotwork/Domain/Vo/CheckReportVo.java | 47 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalUnitInfoMapper.xml | 159 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventsListQueryRespDTO.java | 41 src/main/java/com/gk/hotwork/specialWork/enums/WorkModeEnum.java | 46 src/main/java/com/gk/hotwork/Domain/UserInfo.java | 546 src/main/java/com/gk/hotwork/Service/ServiceImpl/HelpDocServiceImpl.java | 44 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskControlMeasureMapper.xml | 120 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyDeleteReqDTO.java | 16 src/main/java/com/gk/hotwork/doublePrevention/enums/DeviceStatusEnum.java | 26 src/main/java/com/gk/hotwork/Controller/LoginController.java | 226 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHoistingInfoMapper.xml | 49 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskAnaUnitService.java | 69 src/main/java/com/gk/hotwork/Domain/FourColorPoint.java | 105 src/main/java/com/gk/hotwork/Domain/TaskWorker.java | 173 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigMapper.xml | 32 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkDeleteReqDTO.java | 17 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemStandRespDTO.java | 153 src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/WaitExecConsumer.java | 89 src/main/java/com/gk/hotwork/Service/RiskControlClassifyService.java | 63 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskEventMapper.xml | 129 src/main/java/com/gk/hotwork/Domain/RiskMap.java | 127 src/main/java/com/gk/hotwork/Domain/Vo/TaskWorkerVo.java | 52 src/main/java/com/gk/hotwork/Domain/GasWarnInfo.java | 120 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerManageUpdateParams.java | 201 src/main/java/com/gk/hotwork/Mapper/UserFaceMapper.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskEventServiceImpl.java | 208 src/main/java/com/gk/hotwork/Domain/Enum/MsgType.java | 32 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemMeasureRespDTO.java | 94 src/main/java/com/gk/hotwork/Mapper/EquipmentInfoMapper.java | 26 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventReportConfigUpdateParams.java | 70 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageImageRespDTO.java | 46 src/main/java/com/gk/hotwork/Domain/Utils/DigestUtils.java | 29 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitRepository.java | 49 src/main/java/com/gk/hotwork/specialWork/entity/WorkHotInfo.java | 131 src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePingServiceImpl.java | 11 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureUpdateParams.java | 182 src/main/java/com/gk/hotwork/Service/MajorEquipmentAlarmService.java | 34 src/main/resources/error.setting | 34 src/main/java/com/gk/hotwork/Domain/Vo/UserVo.java | 184 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskAnaUnitService.java | 42 src/main/java/com/gk/hotwork/Mapper/GasWarnInfoMapper.java | 20 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalUnitListDbQuery.java | 85 src/main/resources/docxTemplate/workConfinedSpace.docx | 0 src/main/java/com/gk/hotwork/Service/VideoService.java | 12 src/main/java/com/gk/hotwork/Service/DevicePingService.java | 7 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskEventRepository.java | 36 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemMeasureInfoRepository.java | 16 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitQueryReqDTO.java | 61 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBrokenCircuitInfo.xml | 55 src/main/java/com/gk/hotwork/Domain/RiskControlClassify.java | 160 src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointCoordServiceImpl.java | 23 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportBatchServiceImpl.java | 27 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalRuleInfoServiceImpl.java | 30 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitItemMapper.xml | 380 src/main/java/com/gk/hotwork/specialWork/model/dto/req/DeleteForm.java | 20 src/main/java/com/gk/hotwork/Service/ServiceImpl/GasWarnServiceImpl.java | 52 src/main/java/com/gk/hotwork/Domain/Enum/CertificateStatus.java | 45 src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetWorkTimeSchedule.java | 149 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskEventController.java | 33 src/main/java/com/gk/hotwork/Service/TaskReviewService.java | 18 src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyPendingPageQuery.java | 53 src/main/java/com/gk/hotwork/Config/Oauth2/WebSecurityConfig.java | 87 src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerBySafeCheckVo.java | 90 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckTaskFromWork.java | 191 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageRepository.java | 91 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskMapServiceImpl.java | 86 src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml | 351 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessDetectionInfoService.java | 15 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskAnaUnitQueryRespDTO.java | 249 src/main/java/com/gk/hotwork/Scheduls/location/LocationReceiver.java | 130 src/main/java/com/gk/hotwork/specialWork/service/WorkTemporaryPowerPrintService.java | 11 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/DepRPCRespDTO.java | 100 src/main/java/com/gk/hotwork/Domain/Vo/ResultVO.java | 78 src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskInfo.java | 23 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventSaveReqDTO.java | 41 src/main/java/com/gk/hotwork/specialWork/service/WorkBlindPlatePluggingPrintService.java | 11 src/main/java/com/gk/hotwork/specialWork/controller/WorkProcessController.java | 74 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskService.java | 145 src/main/java/com/gk/hotwork/Domain/HiddenDangerLog.java | 128 src/main/java/com/gk/hotwork/Service/PermissionService.java | 14 src/main/java/com/gk/hotwork/Domain/TaskGasInfo.java | 166 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessDetectionInfoServiceImpl.java | 42 src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerLogServiceImpl.java | 11 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckRecordFromTaskRespDTO.java | 206 src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointServiceImpl.java | 22 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkUpdateReqDTO.java | 167 src/main/java/com/gk/hotwork/Domain/Utils/PageUtils.java | 30 src/main/java/com/gk/hotwork/specialWork/controller/WorkApplyController.java | 233 src/main/java/com/gk/hotwork/doublePrevention/config/MybatisPlusConfig.java | 21 src/main/java/com/gk/hotwork/Service/FourColorMapService.java | 17 src/main/java/com/gk/hotwork/specialWork/service/WorkStatisticService.java | 12 src/main/resources/docxTemplate/workBlindPlatePlugging.docx | 0 src/main/java/com/gk/hotwork/Domain/Utils/RPCUtils.java | 25 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerRectifyMapper.xml | 251 src/main/java/com/gk/hotwork/Scheduls/warning/Warning.java | 173 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleMapper.xml | 142 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskQueryReqDTO.java | 72 src/main/java/com/gk/hotwork/Domain/Utils/PageUtil.java | 36 src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRocketMQService.java | 6 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLogServiceImpl.java | 19 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalStepRespDTO.java | 203 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDeleteParams.java | 55 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceQueryParams.java | 69 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemDBQuery.java | 51 src/main/java/com/gk/hotwork/Mapper/mybatis/BlackListInfoMapper.xml | 31 src/main/java/com/gk/hotwork/Scheduls/uploadUser/uploadUserTask.java | 77 src/main/java/com/gk/hotwork/specialWork/enums/WorkTypeEnum.java | 64 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckRecordFromTaskServiceImpl.java | 72 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskEventServiceImpl.java | 86 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskMap.java | 148 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/CheckResultReportDO.java | 41 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleListDbQuery.java | 91 src/main/java/com/gk/hotwork/Mapper/DevicePingMapper.java | 9 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemStandnfoMapper.xml | 72 src/main/java/com/gk/hotwork/specialWork/service/WorkAtHeightPrintService.java | 11 src/main/java/com/gk/hotwork/specialWork/util/WorkExportUtil.java | 729 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemAddReqDTO.java | 46 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemDataReqDTO.java | 40 src/main/java/com/gk/hotwork/Service/ServiceImpl/RoleServiceImpl.java | 70 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEnclosureMapper.xml | 27 src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyRecordInfo.java | 118 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskAnaUnitServiceImpl.java | 241 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskAnaUnit.java | 194 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskControlMeasure.java | 229 src/main/java/com/gk/hotwork/Service/TaskLocationService.java | 9 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemAddReqDTO.java | 59 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkDepStatisticRespDTO.java | 42 src/main/java/com/gk/hotwork/doublePrevention/service/impl/ReportServiceImpl.java | 476 src/main/java/com/gk/hotwork/specialWork/enums/WorkReportSourceEnum.java | 30 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyOperatorRespDTO.java | 79 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkGroundBreakingPrintServiceImpl.java | 274 src/main/java/com/gk/hotwork/Mapper/TaskRiskMapper.java | 11 src/main/resources/printTemplate/allworkcert.doc | 0 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasure.java | 140 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalUnitInfoServiceImpl.java | 125 src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSize.java | 45 src/main/java/com/gk/hotwork/specialWork/repository/WorkBlindPlatePluggingInfoRepository.java | 28 src/main/java/com/gk/hotwork/specialWork/service/RuleItemService.java | 42 src/main/java/com/gk/hotwork/Domain/Enum/TaskType.java | 39 src/main/java/com/gk/hotwork/Domain/Utils/ConfigUtil.java | 39 src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml | 41 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHoistingReqDTO.java | 33 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHoistingInfoService.java | 52 src/main/java/com/gk/hotwork/Config/Oauth2/SpringContextUtil.java | 69 src/main/java/com/gk/hotwork/Domain/UserFace.java | 52 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskMapMapper.xml | 29 src/main/java/com/gk/hotwork/Domain/Utils/SpringBeanUtil.java | 64 src/main/java/com/gk/hotwork/Mapper/mybatis/AuthorizationInfoMapper.xml | 30 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportDangerInfoController.java | 33 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWork.java | 388 src/main/java/com/gk/hotwork/doublePrevention/enums/SyncEnum.java | 44 src/main/java/com/gk/hotwork/Service/SafetySelfInspectionService.java | 43 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportBatchMapper.xml | 14 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceQueryRespDTO.java | 163 src/main/java/com/gk/hotwork/specialWork/enums/WorkGroundBreakingStatusEnum.java | 41 src/main/java/com/gk/hotwork/Mapper/MajorEquipmentDataMapper.java | 19 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventCloseDangerReqDTO.java | 29 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskUnitAndMeasureService.java | 28 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHoistingPrintServiceImpl.java | 277 src/main/java/com/gk/hotwork/Mapper/EmergencyPlanMapper.java | 15 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskEvent.java | 167 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportDangerInfoDTO.java | 335 src/main/java/com/gk/hotwork/specialWork/service/WorkApplyService.java | 84 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRocketMQServiceImpl.java | 55 src/main/java/com/gk/hotwork/Service/HelpDocService.java | 13 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyOperatorInfoMapper.xml | 54 src/main/java/com/gk/hotwork/Service/TaskEquipmentBindService.java | 9 src/main/java/com/gk/hotwork/Domain/DevicePing.java | 114 src/main/java/com/gk/hotwork/Config/Oauth2/LoginAuthenticationFilter.java | 77 src/main/java/com/gk/hotwork/specialWork/controller/RuleItemController.java | 74 src/main/java/com/gk/hotwork/Service/DictionaryItemService.java | 21 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskQueryRespDTO.java | 350 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventGetAnaUnitByDeviceIdRespDTO.java | 52 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEnclosureServiceImpl.java | 73 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandPageDBQuery.java | 43 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBlindPlatePluggingInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/Config/DataSource/MybatisAspectj.java | 27 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskControlMeasureRepository.java | 36 src/main/java/com/gk/hotwork/Config/DataSource/MyBatisConfigOne.java | 82 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemMeasureQuery.java | 49 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapSaveReqDTO.java | 33 src/main/java/com/gk/hotwork/Service/TaskEnclosureService.java | 22 src/main/java/com/gk/hotwork/Sms/Supplier/Abstract/Supplier.java | 54 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkTemporaryPowerInfoMapper.xml | 50 src/main/java/com/gk/hotwork/specialWork/util/QrCodeUtil.java | 106 src/main/java/com/gk/hotwork/Service/ServiceImpl/BlackListServiceImpl.java | 46 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageTimeoutRepository.java | 21 src/main/java/com/gk/hotwork/Service/DistrictService.java | 21 src/main/java/com/gk/hotwork/specialWork/repository/WorkBrokenCircuitInfoRepository.java | 28 src/main/java/com/gk/hotwork/Mapper/mybatis/DepartmentInfoMapper.xml | 98 src/main/java/com/gk/hotwork/doublePrevention/service/ReportService.java | 52 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemDeductionMapper.xml | 40 src/main/resources/printTemplate/certificatelicense.docx | 0 src/main/java/com/gk/hotwork/Domain/WarningInfo.java | 171 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTask.java | 386 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerImageService.java | 17 src/main/java/com/gk/hotwork/specialWork/enums/RuleStandMatchingTypeEnum.java | 43 src/main/java/com/gk/hotwork/specialWork/model/query/WorkConfinedSpaceQuery.java | 36 src/main/java/com/gk/hotwork/Domain/MajorEquipmentAlarm.java | 179 src/main/java/com/gk/hotwork/Domain/Utils/Tree.java | 104 src/main/java/com/gk/hotwork/Sms/SmsServiceConfig.java | 95 src/main/java/com/gk/hotwork/Domain/Enum/AssessPunishment.java | 19 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMapQueryRespDTO.java | 138 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkTemporaryPowerInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskEventQueryRespDTO.java | 169 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskAnaUnitDTO.java | 146 src/main/java/com/gk/hotwork/Service/SafetyInspectionItemService.java | 39 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitRespDTO.java | 30 src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorMap2Mapper.xml | 14 src/main/java/com/gk/hotwork/Domain/Utils/QRCode.java | 29 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStepListDbQuery.java | 52 src/main/java/com/gk/hotwork/Domain/Vo/RiskControlMeasureExportVo.java | 136 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleRepository.java | 35 src/main/java/com/gk/hotwork/doublePrevention/service/StatisticsService.java | 25 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStepRespDTO.java | 232 src/main/java/com/gk/hotwork/Mapper/TaskWorkerMapper.java | 14 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentMapper.xml | 22 src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStatusEnum.java | 41 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandRespDTO.java | 176 src/main/java/com/gk/hotwork/Domain/dto/UserRPCRespDTO.java | 87 src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyApplyingPageQuery.java | 53 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandReqDTO.java | 111 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java | 205 src/main/java/com/gk/hotwork/Mapper/AppFileInfoMapper.java | 25 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBlindPlatePluggingReqDTO.java | 125 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHoistingInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureDataRespDTO.java | 277 src/main/java/com/gk/hotwork/specialWork/service/WorkConfinedSpacePrintService.java | 11 src/main/java/com/gk/hotwork/Domain/Enum/AssessApplyStatus.java | 28 src/main/java/com/gk/hotwork/Mapper/AuthorizationInfoMapper.java | 13 src/main/java/com/gk/hotwork/Domain/dto/FourColorMapDto.java | 120 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessWarningInfoMapper.xml | 156 src/main/java/com/gk/hotwork/Service/AppFileService.java | 12 src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePressKeyServiceImpl.java | 12 src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMapServiceImpl.java | 196 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerReportRectifyReqDTO.java | 118 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportDangerInfo.java | 383 src/main/resources/docxTemplate/workGroundBreaking.docx | 0 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskAnaUnitMapper.xml | 122 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportControlMeasureController.java | 34 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyUpdateReqDTO.java | 107 src/main/java/com/gk/hotwork/Mapper/RoleInfoMapper.java | 34 src/main/java/com/gk/hotwork/Service/HiddenDangerService.java | 80 src/main/java/com/gk/hotwork/Service/SubTaskService.java | 19 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskAnaUnitRepository.java | 68 src/main/java/com/gk/hotwork/Service/SmsLogService.java | 8 src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemDeductionMapper.java | 19 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitUpdateReqDTO.java | 78 src/main/java/com/gk/hotwork/Mapper/TaskInvolveDepartmentMapper.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/WarningServiceImpl.java | 80 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalRuleInfoRepository.java | 9 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskUnitAndMeasureRepository.java | 25 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitRespDTO.java | 146 src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportSource.java | 24 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitMapper.xml | 189 src/main/java/com/gk/hotwork/Mapper/TaskSecurityMapper.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/SubTaskServiceImpl.java | 119 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceDeviceController.java | 106 src/main/java/com/gk/hotwork/Mapper/mybatis/DistrictInfoMapper.xml | 80 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerImageRepository.java | 11 src/main/java/com/gk/hotwork/specialWork/enums/RuleUnitStatusEnum.java | 31 src/main/java/com/gk/hotwork/Mapper/mybatis/WorkCertInfoMapper.xml | 33 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyRecordInfoServiceImpl.java | 42 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItem.java | 187 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleItemStandPageRespDTO.java | 198 src/main/java/com/gk/hotwork/Service/GasWarnService.java | 14 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureModReqDTO.java | 64 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleRespDTO.java | 161 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionMapper.xml | 53 src/main/java/com/gk/hotwork/specialWork/enums/WorkBlindPlatePluggingStatusEnum.java | 41 src/main/java/com/gk/hotwork/Service/FourColorMap2Service.java | 18 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskAnaUnitRepository.java | 44 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskSecurityServiceImpl.java | 44 src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentImpl.java | 136 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemStandRespDTO.java | 153 src/main/java/com/gk/hotwork/specialWork/model/query/WorkBrokenCircuitQuery.java | 36 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerRectifyRepository.java | 71 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskAnaUintMapper.xml | 75 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventFileHandlerController.java | 70 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckRecordFromTaskService.java | 33 src/main/java/com/gk/hotwork/Domain/Vo/specTask/TaskLocation.java | 54 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportDangerInfoServiceImpl.java | 71 src/main/java/com/gk/hotwork/Domain/SelfCheckInfo.java | 198 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkQueryReqDTO.java | 85 src/main/java/com/gk/hotwork/Mapper/DeviceLocationMapper.java | 24 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventQueryReqDTO.java | 49 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandModReqDTO.java | 105 src/main/resources/docxTemplate/workTemporaryPower.docx | 0 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasureRespDTO.java | 134 src/main/java/com/gk/hotwork/specialWork/controller/RuleController.java | 65 src/main/resources/docxTemplate/workHoisting.docx | 0 src/main/java/com/gk/hotwork/Mapper/TaskLogMapper.java | 10 src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureStatusEnum.java | 31 src/main/java/com/gk/hotwork/Domain/Vo/TaskVo.java | 111 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceUpdateParams.java | 126 src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyReportableDO.java | 116 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlMeasureMapper.xml | 114 src/main/java/com/gk/hotwork/Domain/dto/DepInfoRPCRespDTO.java | 66 src/main/java/com/gk/hotwork/Service/MajorEquipmentDataService.java | 37 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitUpdateReqDTO.java | 56 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitFilledItemRespDTO.java | 204 src/main/java/com/gk/hotwork/Mapper/RiskSourceMapper.java | 19 src/main/java/com/gk/hotwork/Service/RoleService.java | 36 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskAnaUnitServiceImpl.java | 130 src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsLogServiceImpl.java | 11 src/main/java/com/gk/hotwork/Service/TaskInvolveDepService.java | 14 src/main/java/com/gk/hotwork/Controller/RegisterController.java | 41 src/main/java/com/gk/hotwork/Controller/EmergencyPlanController.java | 158 src/main/java/com/gk/hotwork/Service/AuthorizationService.java | 21 src/main/java/com/gk/hotwork/Domain/Utils/ExcelProperty.java | 100 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRectifyOverQueryReqDTO.java | 82 src/main/java/com/gk/hotwork/Domain/RiskControlMeasure.java | 302 src/main/java/com/gk/hotwork/Domain/RiskEvent.java | 134 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlMeasure.java | 352 src/main/java/com/gk/hotwork/Domain/HiddenDanger.java | 311 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkAtHeightInfoService.java | 52 src/main/java/com/gk/hotwork/Config/Cors/CorsConfig.java | 17 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifySaveReqDTO.java | 70 src/main/java/com/gk/hotwork/Config/Oauth2/OAuth2Config.java | 70 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalFilledItemInfoMapper.xml | 78 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlClassifyServiceImpl.java | 176 src/main/java/com/gk/hotwork/specialWork/repository/WorkHoistingInfoRepository.java | 28 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceDeleteReqDTO.java | 19 src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessDetectionPageQuery.java | 39 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWorkApplyDBQuery.java | 50 src/main/java/com/gk/hotwork/Service/MajorEquipmentService.java | 37 src/main/java/com/gk/hotwork/Domain/TaskInfo.java | 825 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBlindPlatePluggingPrintServiceImpl.java | 279 src/main/resources/docxTemplate/workhot.docx | 0 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitItemRepository.java | 122 src/main/java/com/gk/hotwork/Mapper/DevicePresskeyMapper.java | 9 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskEventController.java | 103 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalUnitInfoService.java | 28 src/main/java/com/gk/hotwork/Service/TaskGasService.java | 22 src/main/java/com/gk/hotwork/doublePrevention/controller/StatisticsController.java | 70 src/main/java/com/gk/hotwork/Domain/Exception/AusinessException.java | 37 src/main/java/com/gk/hotwork/Service/ServiceImpl/SelfCheckServiceImpl.java | 52 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskInvolveDepServiceImpl.java | 26 src/main/java/com/gk/hotwork/Domain/Reserve.java | 238 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyRecordInfoService.java | 12 src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionResultEnum.java | 31 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHotReqDTO.java | 32 src/main/java/com/gk/hotwork/Config/Oauth2/UserServiceDetail.java | 76 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigLogController.java | 33 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskMapUpdateParams.java | 56 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerRectifyServiceImpl.java | 151 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkProcessDetectionReqDTO.java | 79 src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventSearchWorkStatusSchedule.java | 50 src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketServer.java | 122 src/main/java/com/gk/hotwork/specialWork/enums/ApprovalFilledItemType.java | 33 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalStepInfoServiceImpl.java | 83 src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskStatusEnum.java | 33 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfig.java | 94 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleStepRepository.java | 69 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskAndMeasure.java | 82 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitDeleteReqDTO.java | 16 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLocationInfoMapper.xml | 19 src/main/java/com/gk/hotwork/Service/DevicePressKeyService.java | 7 src/main/java/com/gk/hotwork/Domain/Vo/WorkShowTaskVo.java | 144 src/main/java/com/gk/hotwork/Domain/Utils/UploadUtil.java | 49 src/main/java/com/gk/hotwork/Controller/TaskController.java | 1803 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventUpdateParams.java | 127 src/main/java/com/gk/hotwork/Domain/Vo/RiskMapVO.java | 113 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitDeleteParams.java | 55 src/main/java/com/gk/hotwork/Domain/Vo/ExamScoreVo.java | 16 src/main/java/com/gk/hotwork/Config/Oauth2/OauthUser.java | 158 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitUpdateParams.java | 67 src/main/java/com/gk/hotwork/specialWork/service/RuleMeasureService.java | 42 src/main/java/com/gk/hotwork/Mapper/WarningInfoMapper.java | 16 src/main/java/com/gk/hotwork/Domain/Enum/AssessType.java | 23 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventListRiskUnitsRespDTO.java | 53 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventCheckResultParams.java | 40 src/main/java/com/gk/hotwork/Service/DictionaryTypeService.java | 18 src/main/java/com/gk/hotwork/specialWork/enums/WorkStatusEnum.java | 58 src/main/java/com/gk/hotwork/Domain/TaskEquipment.java | 149 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitItemServiceImpl.java | 236 src/main/java/com/gk/hotwork/Domain/Vo/AssessApplyAppealVo.java | 169 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigLogService.java | 19 src/main/java/com/gk/hotwork/Mapper/mybatis/RoleInfoMapper.xml | 151 src/main/java/com/gk/hotwork/Service/FourColorPointCoordService.java | 11 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlMeasureRepository.java | 125 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepModReqDTO.java | 144 src/main/java/com/gk/hotwork/Service/ServiceImpl/RolePermissionsServiceImpl.java | 28 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalFilledItemInfoServiceImpl.java | 48 src/main/java/com/gk/hotwork/Service/ReserveService.java | 45 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultObjDTO.java | 14 src/main/java/com/gk/hotwork/Domain/SafetyInspectionItem.java | 200 src/main/java/com/gk/hotwork/Domain/TaskAnalysis.java | 189 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureAddReqDTO.java | 54 src/main/java/com/gk/hotwork/Mapper/HiddenDangerLogMapper.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryItemServiceImpl.java | 64 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskAnaUnitDO.java | 29 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyQueryReqDTO.java | 102 src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerAppVo.java | 99 src/main/java/com/gk/hotwork/specialWork/service/WorkGroundBreakingPrintService.java | 11 src/main/java/com/gk/hotwork/specialWork/service/WorkHotPrintService.java | 10 src/main/java/com/gk/hotwork/doublePrevention/service/RectifyService.java | 107 src/main/java/com/gk/hotwork/Service/FourColorPointService.java | 11 src/main/java/com/gk/hotwork/doublePrevention/scheduls/ExecReportDateSchedule.java | 663 src/main/java/com/gk/hotwork/Domain/TaskLog.java | 121 src/main/java/com/gk/hotwork/Domain/Enum/CertificatePersonType.java | 39 src/main/java/com/gk/hotwork/Domain/TaskReview.java | 219 src/main/java/com/gk/hotwork/Mapper/UserInfoMapper.java | 61 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleServiceImpl.java | 109 src/main/java/com/gk/hotwork/Domain/dto/UserDTO.java | 151 src/main/java/com/gk/hotwork/Domain/Utils/WebSocketClientManager.java | 53 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigLogQueryRespDTO.java | 116 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigRepository.java | 23 src/main/java/com/gk/hotwork/doublePrevention/enums/DataConvertEnum.java | 28 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkTypeStatisticRespDTO.java | 31 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnit.java | 175 src/main/java/com/gk/hotwork/Domain/Utils/BooleanReason.java | 48 src/main/java/com/gk/hotwork/Domain/dto/FourColorPointLocateDto.java | 41 src/main/java/com/gk/hotwork/Service/EmergencyPlanService.java | 34 src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryTypeInfoMapper.xml | 176 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyInfoServiceImpl.java | 139 src/main/java/com/gk/hotwork/Mapper/TaskLocationInfoMapper.java | 10 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventWorkAndMeasure.java | 67 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItemDO.java | 97 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskEventService.java | 39 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerRectifyQueryRespDTO.java | 460 src/main/java/com/gk/hotwork/Domain/Utils/MatrixToImageWriter.java | 82 src/main/java/com/gk/hotwork/Service/ServiceImpl/CompanyServiceImpl.java | 74 src/main/java/com/gk/hotwork/Controller/TaskEquipmentController.java | 254 src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogMapper.xml | 17 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerManageController.java | 135 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandListDBQuery.java | 42 src/main/java/com/gk/hotwork/Domain/Vo/HelpDocVo.java | 20 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBlindPlatePluggingInfoService.java | 52 src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerVo.java | 102 src/main/java/com/gk/hotwork/Domain/Vo/EquipmentVo.java | 16 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBlindPlatePluggingInfo.xml | 57 src/main/java/com/gk/hotwork/Domain/RolePermissionsInfo.java | 54 src/main/java/com/gk/hotwork/Controller/ReserveController.java | 81 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandAddReqDTO.java | 94 src/main/java/com/gk/hotwork/Mapper/InvolveDepInfoMapper.java | 14 src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalStepInfoBO.java | 28 src/main/java/com/gk/hotwork/Service/TaskWorkerService.java | 22 src/main/java/com/gk/hotwork/doublePrevention/service/impl/StatisticsServiceImpl.java | 211 src/main/java/com/gk/hotwork/specialWork/service/WorkProcessService.java | 32 src/main/java/com/gk/hotwork/Mapper/DepartmentInfoMapper.java | 35 src/main/java/com/gk/hotwork/Controller/SafetyInspectionItemController.java | 116 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckContentRepository.java | 24 src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalUnitResultEnum.java | 54 src/main/java/com/gk/hotwork/Mapper/MajorEquipmentMapper.java | 20 src/main/java/com/gk/hotwork/Domain/Do/SafetySelfInspectionItemQualifiedCountDO.java | 28 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyDetailRespDTO.java | 94 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitQueryReqDTO.java | 48 src/main/java/com/gk/hotwork/Domain/FourColorMap2.java | 123 src/main/java/com/gk/hotwork/Domain/SubTaskInfo.java | 422 src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskResultEnum.java | 31 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskUnitAndMeasureServiceImpl.java | 56 src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java | 21 src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandListQuery.java | 30 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalStepListDbQuery.java | 89 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskAndMeasureService.java | 37 src/main/java/com/gk/hotwork/specialWork/service/impl/RuleServiceImpl.java | 884 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemDeductionMapper.xml | 30 src/main/java/com/gk/hotwork/Mapper/ExamScoreInfoMapper.java | 18 src/main/resources/application-prod.yml | 145 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalStepInfo.java | 177 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageSaveReqDTO.java | 220 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalDataRespDTO.java | 241 src/main/java/com/gk/hotwork/Domain/CompanyInfo.java | 241 src/main/java/com/gk/hotwork/Service/ServiceImpl/ElementManagementImpl.java | 166 src/main/java/com/gk/hotwork/doublePrevention/utils/SnowFlow.java | 158 src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionStatusEnum.java | 31 src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningStatusEnum.java | 31 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessDetectionInfoMapper.xml | 165 src/main/java/com/gk/hotwork/Controller/UserController.java | 1600 src/main/java/com/gk/hotwork/Domain/Enum/SourceType.java | 19 src/main/java/com/gk/hotwork/Service/ServiceImpl/UserRolesServiceImpl.java | 20 src/main/java/com/gk/hotwork/Domain/Vo/RiskEventExportVo.java | 36 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskMapServiceImpl.java | 64 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionTaskReqDTO.java | 43 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemMeasureRespDTO.java | 93 src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyRecordInfoRepository.java | 9 src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketConfig.java | 14 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskUnitRepository.java | 73 src/main/java/com/gk/hotwork/Domain/TaskRisk.java | 214 src/main/java/com/gk/hotwork/Service/RolePermissionsService.java | 14 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskRepository.java | 117 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemPageRespDTO.java | 193 src/main/java/com/gk/hotwork/Mapper/SmsLogInfoMapper.java | 20 src/main/java/com/gk/hotwork/Controller/WorkShowController.java | 78 src/main/java/com/gk/hotwork/Domain/Enum/PersonnelCategory.java | 47 src/main/java/com/gk/hotwork/Domain/Utils/JacksonObjectMapper.java | 28 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkConfinedSpaceInfoService.java | 52 src/main/java/com/gk/hotwork/specialWork/model/query/WorkAtHeightQuery.java | 36 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskSourceServiceImpl.java | 237 src/main/java/com/gk/hotwork/doublePrevention/utils/CacheUserTransfer.java | 19 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemMapper.xml | 94 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckTaskFromWorkController.java | 33 src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogInfoMapper.xml | 69 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBrokenCircuitReqDTO.java | 59 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckTaskFromWorkRespDTO.java | 195 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyTemporaryPowerReqDTO.java | 44 src/main/java/com/gk/hotwork/Service/InvolveDepService.java | 10 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWorkSchedule.java | 172 src/main/java/com/gk/hotwork/doublePrevention/enums/StatusEnum.java | 39 src/main/java/com/gk/hotwork/Domain/Vo/PageInfoExtension.java | 23 src/main/java/com/gk/hotwork/Domain/Vo/ApprovalVo.java | 28 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckWorkMapper.xml | 215 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskAndMeasureMapper.xml | 66 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskUnitAndMeasureMapper.xml | 39 src/main/java/com/gk/hotwork/specialWork/service/impl/RuleStandServiceImpl.java | 253 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkStatisticServiceImpl.java | 141 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskGasServiceImpl.java | 81 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalFilledItemInfoRepository.java | 19 src/main/java/com/gk/hotwork/Domain/Utils/LocationUtils.java | 33 src/main/java/com/gk/hotwork/Domain/Vo/TaskEnclosureVo.java | 20 src/main/java/com/gk/hotwork/Mapper/SmsLogMapper.java | 9 src/main/java/com/gk/hotwork/Api/ApiController.java | 178 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigLogMapper.xml | 31 src/main/java/com/gk/hotwork/Scheduls/TaskPdf/TaskPdfRobot.java | 49 src/main/resources/printTemplate/certificatelicenseapply.docx | 0 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskSaveReqDTO.java | 60 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlTemplateMapper.xml | 23 src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApplyPendingInfoBO.java | 468 src/main/java/com/gk/hotwork/doublePrevention/repository/param/CheckWorkAutoUpdateParams.java | 55 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventQueryRespDTO.java | 200 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventQueryParams.java | 28 src/main/java/com/gk/hotwork/Domain/Vo/DepartmentVo.java | 24 src/main/java/com/gk/hotwork/Mapper/ReserveMapper.java | 18 src/main/java/com/gk/hotwork/Service/ServiceImpl/WordServiceImpl.java | 50 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskControlMeasureDTO.java | 181 src/main/java/com/gk/hotwork/Mapper/RiskEventMapper.java | 23 src/main/java/com/gk/hotwork/doublePrevention/enums/ImageTypeEnum.java | 35 src/main/java/com/gk/hotwork/Domain/Vo/PageQuery.java | 35 src/main/java/com/gk/hotwork/Service/ServiceImpl/EmergencyPlanImpl.java | 175 src/main/java/com/gk/hotwork/Service/TaskLogService.java | 12 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskDeleteReqDTO.java | 18 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitDbQuery.java | 58 src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentMapper.xml | 66 src/main/java/com/gk/hotwork/Controller/WarningController.java | 82 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageUpdateReqDTO.java | 229 src/main/java/com/gk/hotwork/Controller/RiskAnaUintController.java | 185 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskUnitServiceImpl.java | 143 src/main/java/com/gk/hotwork/Config/Swagger/SwaggerConfig.java | 43 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalStepInfoRepository.java | 23 src/main/java/com/gk/hotwork/Mapper/CompanyInfoMapper.java | 22 src/main/java/com/gk/hotwork/specialWork/entity/WorkTemporaryPowerInfo.java | 141 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHotRespDTO.java | 48 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkConfinedSpacePrintServiceImpl.java | 290 src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSafetySupervision.java | 48 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapQueryReqDTO.java | 26 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlTemplateService.java | 13 src/main/java/com/gk/hotwork/Mapper/SelfCheckInfoMapper.java | 21 src/main/java/com/gk/hotwork/Service/RiskSourceService.java | 32 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkAtHeightPrintServiceImpl.java | 279 src/main/java/com/gk/hotwork/Domain/ElementTree.java | 60 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemStandMapper.xml | 169 generator/mysql-connector-java-5.1.26-bin.jar | 0 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerImageServiceImpl.java | 49 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyInfoService.java | 40 src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventCreateTaskMsg.java | 35 src/main/java/com/gk/hotwork/Domain/Vo/SelfCheckVo.java | 29 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalItemListDbQuery.java | 78 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyOperatorRespDTO.java | 80 src/main/resources/docxTemplate/workBrokenCircuit.docx | 0 src/main/java/com/gk/hotwork/Domain/Utils/FilterObject.java | 42 src/main/java/com/gk/hotwork/Service/ServiceImpl/ReserveServiceImpl.java | 207 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInvolveDepartmentMapper.xml | 26 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskControlMeasureService.java | 38 src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountDepartmentServiceImpl.java | 78 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepAddReqDTO.java | 133 src/main/java/com/gk/hotwork/Domain/AuthorizationInfo.java | 144 src/main/java/com/gk/hotwork/Mapper/HiddenDangerMapper.java | 25 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitSaveReqDTO.java | 66 src/main/java/com/gk/hotwork/Domain/dto/UserDepRPCRespDTO.java | 29 src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportStatus.java | 45 src/main/java/com/gk/hotwork/Config/Swagger/WebMvcConfig.java | 19 src/main/java/com/gk/hotwork/specialWork/enums/WorkHoistingStatusEnum.java | 41 src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentAlarmImpl.java | 130 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java | 120 src/main/java/com/gk/hotwork/Service/ServiceImpl/AuthorizationServiceImpl.java | 49 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckRecordFromTask.java | 203 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceSaveRespDTO.java | 107 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalUnitInfoRepository.java | 33 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportDangerInfoMapper.xml | 101 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalFilledItemInfo.java | 106 src/main/java/com/gk/hotwork/Domain/Vo/TaskCheck.java | 76 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckContent.java | 69 src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyOperatorInfoRepository.java | 17 src/main/java/com/gk/hotwork/Domain/MajorEquipmentData.java | 223 src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItem.java | 270 src/main/java/com/gk/hotwork/Mapper/mybatis/ReserveMapper.xml | 99 src/main/java/com/gk/hotwork/Mapper/mybatis/CompanyInfoMapper.xml | 87 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemStandRepository.java | 31 src/main/java/com/gk/hotwork/specialWork/mq/msg/ApprovalSpecialWorkMsg.java | 42 src/main/java/com/gk/hotwork/Domain/Utils/CommonUtil.java | 139 src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventDangerCheckWorkSchedule.java | 147 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventWorkAndMeasureServiceImpl.java | 53 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskSecurityMapper.xml | 27 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkAtHeightInfo.xml | 52 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHotInfoServiceImpl.java | 77 src/main/java/com/gk/hotwork/Service/TaskSecurityService.java | 18 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyServiceImpl.java | 2873 + src/main/java/com/gk/hotwork/Domain/Utils/StringUtils.java | 219 src/main/java/com/gk/hotwork/Mapper/FourColorMap2Mapper.java | 9 src/main/java/com/gk/hotwork/Mapper/WorkCertInfoMapper.java | 14 src/main/java/com/gk/hotwork/doublePrevention/enums/RiskLevelEnum.java | 28 src/main/java/com/gk/hotwork/specialWork/controller/WorkStatisticController.java | 23 src/main/java/com/gk/hotwork/Domain/DistrictInfo.java | 80 src/main/java/com/gk/hotwork/specialWork/entity/WorkGroundBreakingInfo.java | 170 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemMeasureInfoService.java | 13 src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyOperatorInfo.java | 82 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportBatch.java | 80 src/main/java/com/gk/hotwork/Domain/Enum/ProvinceCode.java | 69 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapUpdateReqDTO.java | 29 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskRectifyDO.java | 335 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlTemplateRepository.java | 16 src/main/java/com/gk/hotwork/Domain/Utils/BeanProperty.java | 22 src/main/java/com/gk/hotwork/Service/SmsService.java | 16 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitQueryRespDTO.java | 129 src/main/java/com/gk/hotwork/specialWork/entity/WorkBrokenCircuitInfo.java | 170 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkGroundBreakingInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigQueryRespDTO.java | 84 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckContentMapper.xml | 39 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStandDO.java | 134 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventWorkAndMeasureMapper.xml | 32 src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItemDeduction.java | 152 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerImageMapper.xml | 12 src/main/java/com/gk/hotwork/Service/HiddenDangerLogService.java | 7 src/main/java/com/gk/hotwork/Controller/RiskMapController.java | 84 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMeasureTemplatesListQueryRespDTO.java | 60 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemStandInfoRepository.java | 17 src/main/java/com/gk/hotwork/Service/HiddenDangerResourceService.java | 10 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageQueryRespDTO.java | 587 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageServiceImpl.java | 172 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHoistingRespDTO.java | 51 src/main/java/com/gk/hotwork/Domain/VideoInfo.java | 94 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitRespDTO.java | 146 src/main/java/com/gk/hotwork/specialWork/service/RuleStandService.java | 43 src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentDataMapper.xml | 43 src/main/resources/application-dev.yml | 139 src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyInfo.java | 295 src/main/java/com/gk/hotwork/Domain/EmergencyPlanFile.java | 160 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerRectifyService.java | 73 src/main/java/com/gk/hotwork/Domain/Vo/AppFileVo.java | 17 src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalItemInfoBO.java | 38 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemRespDTO.java | 141 src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerResourceServiceImpl.java | 21 src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessDetectionInfoRepository.java | 19 src/main/java/com/gk/hotwork/Domain/Vo/Menu.java | 18 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlMeasureMapper.xml | 292 src/main/java/com/gk/hotwork/Domain/Enum/Etype.java | 31 src/main/java/com/gk/hotwork/doublePrevention/service/impl/FileHandlerServiceImpl.java | 843 src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/NoticeTaskConsumer.java | 81 src/main/java/com/gk/hotwork/Domain/TaskSecurity.java | 195 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventProduceDeviceServiceImpl.java | 131 src/main/java/com/gk/hotwork/doublePrevention/repository/param/UpdateRectifyResultParams.java | 42 src/main/java/com/gk/hotwork/doublePrevention/repository/param/HandlerReportParam.java | 42 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskAndMeasureServiceImpl.java | 75 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageListQueryRespDTO.java | 29 src/main/java/com/gk/hotwork/Service/Middle/AccountDepartmentService.java | 17 src/main/java/com/gk/hotwork/Mapper/TaskAnalysisMapper.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsServiceImpl.java | 139 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventUpdateReqDTO.java | 52 src/main/java/com/gk/hotwork/Domain/Utils/Msg.java | 69 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHotPrintServiceImpl.java | 276 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkQueryRespDTO.java | 373 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java | 119 pom.xml | 387 src/main/java/com/gk/hotwork/Domain/Enum/ApplyStatus.java | 46 src/main/java/com/gk/hotwork/Config/Oauth2/ResourceServerConfig.java | 50 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportBatchService.java | 11 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitFilledItemRespDTO.java | 208 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyGroundBreakingReqDTO.java | 63 src/main/java/com/gk/hotwork/doublePrevention/repository/param/CloseDangerParams.java | 79 src/main/java/com/gk/hotwork/Domain/Utils/SignUtils.java | 69 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemMeasureRespDTO.java | 94 generator/mybatis-generator-core-1.3.2.jar | 0 src/main/java/com/gk/hotwork/Domain/RoleInfo.java | 143 src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemMapper.java | 24 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemRespDTO.java | 142 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventWorkAndMeasureRepository.java | 24 src/main/java/com/gk/hotwork/Controller/Base/BaseController.java | 121 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskAnaUnit.java | 291 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemRespDTO.java | 146 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyTemporaryPowerRespDTO.java | 62 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckRecordFromTaskRepository.java | 32 src/main/java/com/gk/hotwork/Service/TaskEquipmentService.java | 14 src/main/java/com/gk/hotwork/Domain/Vo/RegisterVo.java | 88 src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessWorkApplyQuery.java | 29 src/main/java/com/gk/hotwork/doublePrevention/repository/param/SearchReportDateParams.java | 55 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyAtHighReqDTO.java | 39 src/main/java/com/gk/hotwork/Config/DataSource/DataSourceConfig.java | 21 src/main/java/com/gk/hotwork/Domain/Utils/Result.java | 66 src/main/java/com/gk/hotwork/Domain/dto/DepartmentDTO.java | 26 src/main/java/com/gk/hotwork/Config/Oauth2/OauthRole.java | 71 src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlMeasureServiceImpl.java | 266 src/main/java/com/gk/hotwork/Service/ServiceImpl/UserServiceImpl.java | 441 src/main/java/com/gk/hotwork/Mapper/FourColorPointMapper.java | 13 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLogMapper.xml | 15 src/main/java/com/gk/hotwork/Controller/HiddenDangerController.java | 338 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageQueryReqDTO.java | 133 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskRectifyRespDTO.java | 342 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlMeasureService.java | 115 src/main/java/com/gk/hotwork/Config/ServiceContext/ApplicationContextUtil.java | 32 src/main/java/com/gk/hotwork/Scheduls/location/LocationTask.java | 82 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskUnitAndMeasureParams.java | 56 src/main/resources/application.yml | 88 src/main/java/com/gk/hotwork/Mapper/mybatis/PermissionInfoMapper.xml | 163 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckWorkRepository.java | 101 src/main/java/com/gk/hotwork/specialWork/repository/WorkTemporaryPowerInfoRepository.java | 28 src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventWaitExecTaskMsg.java | 34 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRuleInfo.java | 101 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskSourceMapper.xml | 69 src/main/java/com/gk/hotwork/Domain/Vo/SortData.java | 65 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckWorkController.java | 95 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitRespDTO.java | 147 src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningTypeEnum.java | 31 src/main/java/com/gk/hotwork/Domain/Vo/DealingRangeVo.java | 49 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskRiskMapper.xml | 33 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemStandRespDTO.java | 153 src/main/java/com/gk/hotwork/Domain/Utils/HttpUtils.java | 199 src/main/java/com/gk/hotwork/Domain/Vo/DailySaleReport.java | 80 src/main/java/com/gk/hotwork/specialWork/model/query/WorkGroundBreakingQuery.java | 24 src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerResourceMapper.xml | 25 src/main/java/com/gk/hotwork/Config/Cors/MyMvcConfigurer.java | 71 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitModReqDTO.java | 42 src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskLocationDto.java | 56 src/main/java/com/gk/hotwork/Domain/InvolveDepInfo.java | 67 src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApplySpecialWorkConsumer.java | 97 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPendingPageRespDTO.java | 521 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemMeasureMapper.xml | 99 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckTaskFromWorkService.java | 38 src/main/java/com/gk/hotwork/Domain/UserRolesInfo.java | 55 src/main/java/com/gk/hotwork/Service/WarningService.java | 22 src/main/java/com/gk/hotwork/specialWork/service/impl/SpecialWorkMinoServiceImpl.java | 134 src/main/java/com/gk/hotwork/specialWork/enums/RuleStatusEnum.java | 31 src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerMapper.xml | 145 src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyInfoRepository.java | 40 src/main/java/com/gk/hotwork/Domain/Vo/SearchResultVO.java | 80 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemReqDTO.java | 69 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasurePageRespDTO.java | 133 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalFilledItemInfoService.java | 16 src/main/java/com/gk/hotwork/Domain/FourColorPointCoord.java | 62 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInfoMapper.xml | 868 src/main/java/com/gk/hotwork/specialWork/enums/ProcessOperationEnum.java | 40 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandListRespDTO.java | 127 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureQueryReqDTO.java | 48 src/main/java/com/gk/hotwork/specialWork/common/RocketMQSpecialWorkTemplateHelper.java | 39 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalUnitInfo.java | 135 src/main/java/com/gk/hotwork/specialWork/service/WorkBrokenCircuitPrintService.java | 10 src/main/java/com/gk/hotwork/Mapper/mybatis/RolePermissionsInfoMapper.xml | 55 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventDeleteReqDTO.java | 17 src/main/java/com/gk/hotwork/Sms/Supplier/Jh.java | 66 src/main/java/com/gk/hotwork/Domain/Utils/Message.java | 31 src/main/java/com/gk/hotwork/specialWork/model/query/db/AllWorkApplyPageDBQuery.java | 72 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyConfinedSpaceReqDTO.java | 61 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasureDO.java | 75 src/main/java/com/gk/hotwork/specialWork/service/impl/ApprovalWorkRocketMQServiceImpl.java | 55 src/main/java/com/gk/hotwork/Controller/DictionaryController.java | 327 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigController.java | 43 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitFilledItemRespDTO.java | 205 src/main/java/com/gk/hotwork/Domain/Exception/E.java | 35 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskEventMapper.xml | 100 src/main/java/com/gk/hotwork/specialWork/enums/RuleStepStatusEnum.java | 31 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyReportableRespDTO.java | 152 src/main/java/com/gk/hotwork/specialWork/schedule/KeepAliveRobot.java | 27 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManage.java | 389 src/main/java/com/gk/hotwork/specialWork/model/query/WorkBlindPlatePluggingQuery.java | 28 src/main/java/com/gk/hotwork/specialWork/model/query/WorkHoistingQuery.java | 24 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskMapper.xml | 510 src/main/java/com/gk/hotwork/Service/ElementManagementService.java | 45 src/main/java/com/gk/hotwork/specialWork/service/RuleService.java | 35 src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountAuthServiceImpl.java | 90 src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyOperation.java | 19 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyApplyingPageDBQuery.java | 59 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskReviewMapper.xml | 45 src/main/java/com/gk/hotwork/Controller/RiskSourceController.java | 259 src/main/java/com/gk/hotwork/Mapper/EmergencyPlanFileMapper.java | 18 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckWorkService.java | 104 src/main/java/com/gk/hotwork/specialWork/util/WordReporter.java | 565 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemStandInfo.java | 126 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStepServiceImpl.java | 152 src/main/java/com/gk/hotwork/Controller/RoleController.java | 174 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java | 107 src/main/java/com/gk/hotwork/Domain/Enum/Element.java | 69 src/main/java/com/gk/hotwork/doublePrevention/scheduls/SearchReportDateSchedule.java | 641 src/main/java/com/gk/hotwork/Mapper/mybatis/WarningInfoMapper.xml | 45 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemInfo.java | 125 src/main/java/com/gk/hotwork/Mapper/RiskControlMeasureMapper.java | 21 src/main/java/com/gk/hotwork/Mapper/mybatis/EquipmentInfoMapper.xml | 76 src/main/java/com/gk/hotwork/Mapper/TaskEquipmentMapper.java | 10 src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseStatus.java | 42 src/main/java/com/gk/hotwork/Config/Oauth2/JwtAccessToken.java | 30 src/main/java/com/gk/hotwork/specialWork/enums/WorkRuleMeasureOptEnum.java | 59 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskServiceImpl.java | 223 src/main/java/com/gk/hotwork/specialWork/controller/RuleItemMeasureController.java | 79 src/main/java/com/gk/hotwork/specialWork/service/SpecialWorkMinoService.java | 12 src/main/java/com/gk/hotwork/Mapper/TaskInfoMapper.java | 46 src/main/java/com/gk/hotwork/Config/ThreadExecutor/ExecutorConfig.java | 80 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkUpdateParams.java | 258 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportDangerInfoRespDTO.java | 385 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskMapRepository.java | 27 src/main/java/com/gk/hotwork/specialWork/entity/WorkConfinedSpaceInfo.java | 160 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalReqDTO.java | 80 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemAbordDataReqDTO.java | 20 src/main/java/com/gk/hotwork/specialWork/repository/WorkHotInfoRepository.java | 35 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHotInfoMapper.xml | 57 src/main/java/com/gk/hotwork/Service/RiskMapService.java | 16 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBrokenCircuitInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/Domain/Utils/Base64Encrypt.java | 33 src/main/java/com/gk/hotwork/Service/CompanyService.java | 22 src/main/java/com/gk/hotwork/Mapper/TaskEquipmentBindInfoMapper.java | 10 src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceSearchVo.java | 127 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkGroundBreakingInfoService.java | 52 src/main/java/com/gk/hotwork/Controller/MajorEquipmentAlarmController.java | 85 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckRecordFromTaskDTO.java | 156 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskWorkerServiceImpl.java | 92 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageTimeoutMapper.xml | 34 src/main/java/com/gk/hotwork/Mapper/PermissionInfoMapper.java | 22 src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionMapper.java | 16 src/main/java/com/gk/hotwork/Mapper/mybatis/InvolveDepInfoMapper.xml | 26 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskUnitQueryRespDTO.java | 174 src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyStatus.java | 24 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckWorkServiceImpl.java | 189 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHotInfoService.java | 43 src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentAlarmMapper.xml | 45 src/main/java/com/gk/hotwork/Mapper/mybatis/UserRolesInfoMapper.xml | 50 src/main/java/com/gk/hotwork/specialWork/enums/WorkAtHeightStatusEnum.java | 41 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureListDO.java | 107 src/main/java/com/gk/hotwork/Domain/TaskEnclosure.java | 246 src/main/java/com/gk/hotwork/Domain/Utils/DateUtils.java | 31 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigService.java | 23 src/main/java/com/gk/hotwork/Mapper/UserRolesInfoMapper.java | 18 src/main/java/com/gk/hotwork/Domain/SmsLogInfo.java | 79 src/main/java/com/gk/hotwork/Domain/DevicePressKey.java | 93 src/main/java/com/gk/hotwork/Domain/EquipmentInfo.java | 141 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitListQueryRespDTO.java | 30 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkHotQuery.java | 26 src/main/java/com/gk/hotwork/specialWork/model/query/AllWorkApplyPageQuery.java | 74 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskUnit.java | 150 src/main/java/com/gk/hotwork/Mapper/VideoInfoMapper.java | 15 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureListQueryReqDTO.java | 75 src/main/java/com/gk/hotwork/specialWork/repository/WorkConfinedSpaceInfoRepository.java | 28 src/main/java/com/gk/hotwork/Mapper/mybatis/UserFaceMapper.xml | 12 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskReviewServiceImpl.java | 49 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportDangerInfoService.java | 33 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWarningPageDBQuery.java | 38 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskControlMeasureController.java | 103 src/main/java/com/gk/hotwork/Service/ServiceImpl/ExamScoreServiceImpl.java | 28 src/main/java/com/gk/hotwork/Config/Log/HiddenDangerLogAspect.java | 122 src/main/java/com/gk/hotwork/Service/ServiceImpl/WorkCertServiceImpl.java | 21 src/main/java/com/gk/hotwork/Controller/RiskControlClassifyController.java | 94 src/main/java/com/gk/hotwork/Service/TaskRiskService.java | 13 src/main/java/com/gk/hotwork/Controller/RiskEventController.java | 172 src/main/java/com/gk/hotwork/Mapper/mybatis/RiskEventMapper.xml | 72 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigLogQueryReqDTO.java | 53 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkDeleteParams.java | 55 src/main/java/com/gk/hotwork/Mapper/BlackListInfoMapper.java | 15 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentServiceImpl.java | 41 src/main/java/com/gk/hotwork/Mapper/SubTaskInfoMapper.java | 10 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalRuleInfoService.java | 10 src/main/java/com/gk/hotwork/Domain/Utils/PageInfo.java | 143 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskAnalysisServiceImpl.java | 37 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceMapController.java | 76 src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/TimeOutTaskConsumer.java | 99 src/main/java/com/gk/hotwork/specialWork/service/ApprovalWorkRocketMQService.java | 5 src/main/java/com/gk/hotwork/Domain/ExamScoreInfo.java | 132 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemPageDBQuery.java | 50 src/main/java/com/gk/hotwork/Domain/PermissionInfo.java | 273 src/main/java/com/gk/hotwork/Mapper/mybatis/VideoInfoMapper.xml | 22 src/main/java/com/gk/hotwork/Config/Oauth2/JwtConfig.java | 32 src/main/java/com/gk/hotwork/Domain/Enum/DocumentType.java | 46 src/main/java/com/gk/hotwork/Domain/Enum/AssessAppealStatus.java | 40 src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleStepMapper.xml | 262 src/main/java/com/gk/hotwork/Mapper/RiskControlClassifyMapper.java | 35 src/main/java/com/gk/hotwork/doublePrevention/service/impl/RectifyServiceImpl.java | 1745 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckTaskFromWorkReqDTO.java | 24 src/main/java/com/gk/hotwork/Domain/Utils/FileOptUtils.java | 26 src/main/java/com/gk/hotwork/Domain/RiskAnaUnit.java | 243 src/main/java/com/gk/hotwork/Service/ServiceImpl/DistrictServiceImpl.java | 66 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventProduceDeviceRepository.java | 69 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkTemporaryPowerInfoService.java | 52 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskEventService.java | 63 src/main/java/com/gk/hotwork/Domain/Vo/WorkCertVo.java | 18 src/main/java/com/gk/hotwork/Domain/MajorEquipment.java | 186 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyInfoMapper.xml | 471 src/main/java/com/gk/hotwork/Service/UserRolesService.java | 9 src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/CreateTaskConsumer.java | 85 src/main/java/com/gk/hotwork/Service/RiskEventService.java | 49 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkContentQueryReqDTO.java | 17 src/main/java/com/gk/hotwork/Domain/AppFileInfo.java | 119 src/main/java/com/gk/hotwork/Domain/DictionaryTypeInfo.java | 132 src/main/java/com/gk/hotwork/specialWork/entity/WorkAtHeightInfo.java | 151 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitDeleteParams.java | 43 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultDTO.java | 34 src/main/resources/log4j.properties | 17 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBlindPlatePluggingRespDTO.java | 144 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStandServiceImpl.java | 110 src/main/java/com/gk/hotwork/Service/TaskService.java | 74 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventWorkAndMeasureService.java | 26 src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureOptEnum.java | 59 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerRectifyController.java | 122 src/main/java/com/gk/hotwork/Domain/Exception/BusinessException.java | 47 src/main/java/com/gk/hotwork/Service/ServiceImpl/ExcelExportServiceImpl.java | 1105 src/main/java/com/gk/hotwork/doublePrevention/utils/JsonDateDeserializer.java | 25 src/main/java/com/gk/hotwork/Domain/Vo/CityDataVo.java | 86 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentBindInfoMapper.xml | 18 src/main/java/com/gk/hotwork/Controller/EquipmentController.java | 270 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessDetectionInfoRespDTO.java | 224 src/main/java/com/gk/hotwork/Controller/PermissionController.java | 147 src/main/java/com/gk/hotwork/Mapper/RolePermissionsInfoMapper.java | 23 src/main/java/com/gk/hotwork/Service/BlackListService.java | 15 src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceVo.java | 59 src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalStepResultEnum.java | 52 src/main/java/com/gk/hotwork/specialWork/service/WorkPrintService.java | 10 src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java | 233 src/main/java/com/gk/hotwork/Service/UserService.java | 111 src/main/java/com/gk/hotwork/Domain/TaskInvolveDepartment.java | 183 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyReqDTO.java | 120 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemMeasureInfoMapper.xml | 53 src/main/java/com/gk/hotwork/Controller/FourColorMapController.java | 126 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureListRespDTO.java | 106 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageTimeoutServiceImpl.java | 46 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentBindServiceImpl.java | 24 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceQueryReqDTO.java | 91 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerRectifyUpdateParams.java | 201 src/main/java/com/gk/hotwork/specialWork/model/bo/ApprovalRuleBO.java | 94 src/main/java/com/gk/hotwork/Domain/HelpDocInfo.java | 158 src/main/java/com/gk/hotwork/Domain/Utils/MD5Utils.java | 60 src/main/java/com/gk/hotwork/Scheduls/location/DeviceDataPersisting.java | 107 src/main/java/com/gk/hotwork/Service/ServiceImpl/DeviceLocationServiceImpl.java | 65 src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyRecordListQuery.java | 48 src/main/java/com/gk/hotwork/Mapper/mybatis/GasWarnInfoMapper.xml | 47 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitItemService.java | 96 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitServiceImpl.java | 142 src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemPageQuery.java | 52 src/main/java/com/gk/hotwork/Service/ServiceImpl/EquipmentServiceImpl.java | 66 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemModReqDTO.java | 51 src/main/java/com/gk/hotwork/Domain/HiddenDangerResource.java | 153 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceListsQueryRespDTO.java | 28 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckTaskFromWorkRepository.java | 36 src/main/java/com/gk/hotwork/specialWork/util/WorkUtil.java | 249 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkConfinedSpaceInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/Service/TaskAnalysisService.java | 16 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportDangerInfoReqDTO.java | 24 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemModReqDTO.java | 69 src/main/java/com/gk/hotwork/Domain/RiskSource.java | 183 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalStepRespDTO.java | 205 src/main/java/com/gk/hotwork/Controller/MajorEquipmentController.java | 94 src/main/java/com/gk/hotwork/Mapper/mybatis/HelpDocInfoMapper.xml | 36 src/main/java/com/gk/hotwork/Mapper/RiskAnaUintMapper.java | 23 src/main/java/com/gk/hotwork/Domain/Utils/HexUtil.java | 88 src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java | 317 src/main/java/com/gk/hotwork/Domain/Vo/GenerateCode.java | 43 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyConfinedSpaceRespDTO.java | 69 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkSaveReqDTO.java | 142 src/main/java/com/gk/hotwork/specialWork/controller/RuleItemStandController.java | 89 src/main/java/com/gk/hotwork/doublePrevention/service/FileHandlerService.java | 27 src/main/java/com/gk/hotwork/specialWork/enums/WorkHotStatusEnum.java | 40 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyOperatorInfoServiceImpl.java | 38 src/main/java/com/gk/hotwork/doublePrevention/service/RiskService.java | 162 src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventTimeOutTaskMsg.java | 43 src/main/java/com/gk/hotwork/Service/Middle/AccountAuthService.java | 15 src/main/java/com/gk/hotwork/Service/UserFaceService.java | 24 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskToUserParams.java | 91 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyOperatorRespDTO.java | 78 src/main/java/com/gk/hotwork/Domain/Enum/RedisServiceEnum.java | 23 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportDangerInfoRepository.java | 32 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessWarningInfoServiceImpl.java | 41 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemStandInfoServiceImpl.java | 40 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/OwnRectifyPageQuery.java | 6 src/main/java/com/gk/hotwork/Service/SelfCheckService.java | 17 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureQueryParams.java | 30 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRecord.java | 25 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleStep.java | 215 src/main/java/com/gk/hotwork/Controller/RiskControlMeasureController.java | 199 src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemMeasureInfo.java | 81 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyRecordRespDTO.java | 123 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBrokenCircuitInfoService.java | 52 src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApprovalSpecialWorkConsumer.java | 95 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLocationServiceImpl.java | 26 src/main/java/com/gk/hotwork/specialWork/repository/WorkAtHeightInfoRepository.java | 28 src/main/java/com/gk/hotwork/Service/RiskAnaUnitService.java | 55 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigLogServiceImpl.java | 31 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyPendingPageDBQuery.java | 69 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemInfoServiceImpl.java | 47 src/main/java/com/gk/hotwork/Controller/PatrolController.java | 296 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskAnaUnitController.java | 100 src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryTypeServiceImpl.java | 60 src/main/java/com/gk/hotwork/Domain/co/ContextCacheUser.java | 156 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyEightRespDTO.java | 5 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckContentController.java | 24 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerImage.java | 64 src/main/java/com/gk/hotwork/Service/ServiceImpl/DepartmentServiceImpl.java | 148 src/main/java/com/gk/hotwork/Domain/Vo/TaskStatistics.java | 37 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyOperatorRespDTO.java | 79 src/main/java/com/gk/hotwork/Mapper/TaskReviewMapper.java | 15 src/main/java/com/gk/hotwork/Domain/TaskEquipmentBindInfo.java | 97 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemRespDTO.java | 176 src/main/java/com/gk/hotwork/Domain/Enum/CommitStatus.java | 44 src/main/java/com/gk/hotwork/Service/WordService.java | 21 src/main/java/com/gk/hotwork/specialWork/mq/msg/ApplySpecialWorkMsg.java | 38 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskAnaUnitMapper.xml | 153 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml | 54 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureQueryRespDTO.java | 268 src/main/java/com/gk/hotwork/specialWork/enums/WorkStandTypeEnum.java | 64 src/main/java/com/gk/hotwork/specialWork/service/WorkHoistingPrintService.java | 12 src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalUnitInfoBO.java | 22 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportRiskControlMeasureRespDTO.java | 231 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStandService.java | 35 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskEventDO.java | 161 src/main/java/com/gk/hotwork/Domain/SafetyInspectionItemDeduction.java | 130 src/main/java/com/gk/hotwork/Service/ServiceImpl/VideoServiceImpl.java | 22 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemInfoService.java | 16 src/main/java/com/gk/hotwork/Domain/WorkCertInfo.java | 187 src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventExecErrorNoticeMsg.java | 9 src/main/java/com/gk/hotwork/doublePrevention/service/impl/DangerServiceImpl.java | 2105 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleService.java | 48 generator/yufei.xml | 45 src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRecordService.java | 30 src/main/java/com/gk/hotwork/specialWork/service/impl/RuleMeasureServiceImpl.java | 143 src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetTaskSchedule.java | 62 src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitItemListDbQuery.java | 8 src/main/java/com/gk/hotwork/Domain/BlackListInfo.java | 120 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskUnitController.java | 84 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerRectify.java | 382 src/main/java/com/gk/hotwork/Domain/Utils/BeanUtils.java | 193 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/vo/ReportLogVO.java | 18 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskAndMeasureRepository.java | 34 src/main/java/com/gk/hotwork/Config/Cors/CorsFilter.java | 39 src/main/java/com/gk/hotwork/Controller/SafetySelfInspectionController.java | 147 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskEventDTO.java | 120 generator/生成语句.txt | 3 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskUnitQueryReqDTO.java | 60 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleAddReqDTO.java | 91 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventHandReportConfigReqDTO.java | 29 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyRecordListDBQuery.java | 48 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionCompletedReqDTO.java | 57 src/main/java/com/gk/hotwork/Domain/Utils/WebUtils.java | 197 src/main/java/com/gk/hotwork/specialWork/enums/WorkLevelEnum.java | 68 src/main/java/com/gk/hotwork/Mapper/MajorEquipmentAlarmMapper.java | 19 src/main/java/com/gk/hotwork/Service/ServiceImpl/UserFaceServiceImpl.java | 59 src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemInfoRepository.java | 19 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskAnalysisMapper.xml | 26 src/main/java/com/gk/hotwork/Mapper/mybatis/AppFileInfoMapper.xml | 95 src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleListQuery.java | 32 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckRecordFromTaskReqDTO.java | 24 src/main/java/com/gk/hotwork/specialWork/entity/WorkHoistingInfo.java | 131 src/main/java/com/gk/hotwork/Mapper/DistrictInfoMapper.java | 23 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPageRespDTO.java | 296 src/main/java/com/gk/hotwork/specialWork/enums/AuditTypeEnum.java | 74 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureDO.java | 17 src/main/java/com/gk/hotwork/Controller/ElementManagementController.java | 101 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskWorkerMapper.xml | 41 src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStandStatusEnum.java | 41 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessWarningInfoService.java | 15 src/main/java/com/gk/hotwork/Sms/Supplier/Ali.java | 23 src/main/java/com/gk/hotwork/Domain/ElementManagement.java | 175 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitUpdateParams.java | 198 src/main/java/com/gk/hotwork/Domain/Enum/SmsSource.java | 27 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskUnitService.java | 70 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceSaveReqDTO.java | 62 src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryItemInfoMapper.xml | 217 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceUpdateReqDTO.java | 78 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckContentServiceImpl.java | 56 src/main/java/com/gk/hotwork/Config/Oauth2/AccessTokenFilter.java | 215 src/main/java/com/gk/hotwork/doublePrevention/utils/JsonUtils.java | 49 src/main/java/com/gk/hotwork/Domain/Utils/Constants.java | 139 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitService.java | 65 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceDeleteParams.java | 42 src/main/java/com/gk/hotwork/Mapper/FourColorPointCoordMapper.java | 13 src/main/java/com/gk/hotwork/doublePrevention/controller/TTst.java | 15 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckTaskFromWorkServiceImpl.java | 83 src/main/java/com/gk/hotwork/Service/ServiceImpl/SafeCheckWorkServiceImpl.java | 23 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalStepInfoMapper.xml | 114 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemMeasureRespDTO.java | 94 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitDeleteReqDTO.java | 18 src/main/java/com/gk/hotwork/Domain/Utils/CodeUtils.java | 25 src/main/java/com/gk/hotwork/Mapper/ElementManagementMapper.java | 22 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/AllWorkApplyPageRespDTO.java | 300 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/MeasureAndContentDO.java | 42 src/main/java/com/gk/hotwork/Domain/EmergencyPlan.java | 156 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalItemContentReqDTO.java | 51 src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMap2ServiceImpl.java | 70 src/main/java/com/gk/hotwork/Mapper/mybatis/DeviceLoactionMapper.xml | 114 src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointMapper.xml | 29 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportRiskControlMeasureReqDTO.java | 24 src/main/java/com/gk/hotwork/Domain/Enum/ErrorCode.java | 69 src/main/java/com/gk/hotwork/specialWork/entity/WorkBlindPlatePluggingInfo.java | 221 src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemDeductionMapper.java | 19 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageDeleteReqDTO.java | 16 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageTimeoutService.java | 25 src/main/java/com/gk/hotwork/specialWork/service/impl/RuleItemServiceImpl.java | 338 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemRespDTO.java | 142 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckTaskFromWorkDTO.java | 144 src/main/java/com/gk/hotwork/Service/ServiceImpl/InvolveDepServiceImpl.java | 19 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkAtHeightInfoServiceImpl.java | 103 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkPrintServiceImpl.java | 92 src/main/java/com/gk/hotwork/Domain/DeviceLocation.java | 240 src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanFileMapper.xml | 46 src/main/java/com/gk/hotwork/Mapper/DictionaryTypeInfoMapper.java | 29 src/main/java/com/gk/hotwork/Mapper/HelpDocInfoMapper.java | 15 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventProduceDeviceMapper.xml | 124 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigUpdateReqDTO.java | 44 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkListDbQuery.java | 116 src/main/java/com/gk/hotwork/doublePrevention/service/DangerService.java | 107 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskAnaUnitServiceImpl.java | 89 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckContentService.java | 26 src/main/java/com/gk/hotwork/specialWork/enums/WorkBrokenCircuitStatusEnum.java | 41 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleItemMeasureServiceImpl.java | 77 src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventNoticeExecTaskMsg.java | 33 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBrokenCircuitPrintServiceImpl.java | 303 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapDeleteReqDTO.java | 17 src/main/java/com/gk/hotwork/doublePrevention/utils/BeanCopyUtils.java | 55 src/main/java/com/gk/hotwork/Domain/DepartmentInfo.java | 122 src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStepService.java | 103 src/main/resources/application-test.yml | 139 src/main/java/com/gk/hotwork/Domain/Vo/RiskAnaUintExoprtVo.java | 67 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskController.java | 102 src/main/java/com/gk/hotwork/Domain/Vo/DirectionDetail.java | 70 src/main/java/com/gk/hotwork/Domain/dto/RiskSourceUpdateDto.java | 94 src/main/java/com/gk/hotwork/Domain/SmsLog.java | 135 src/main/java/com/gk/hotwork/Scheduls/updateToken/updateTokenTask.java | 83 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlTemplate.java | 94 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskControlMeasureServiceImpl.java | 84 src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerServiceImpl.java | 574 src/main/java/com/gk/hotwork/specialWork/enums/ApprovalStepTypeEnum.java | 59 src/main/java/com/gk/hotwork/Domain/Utils/Properties.java | 200 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessWarningInfoRespDTO.java | 204 src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemMeasureRepository.java | 37 src/main/java/com/gk/hotwork/Domain/Enum/ResultCodes.java | 155 src/main/java/com/gk/hotwork/Domain/Utils/JaxbUtils.java | 92 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRecordServiceImpl.java | 94 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/DeleteBatchReqDTO.java | 19 src/main/java/com/gk/hotwork/Config/Upload/UploadConfig.java | 21 src/main/java/com/gk/hotwork/Service/WorkCertService.java | 12 src/main/java/com/gk/hotwork/doublePrevention/service/impl/RiskServiceImpl.java | 2184 + src/main/java/com/gk/hotwork/Domain/DictionaryItemInfo.java | 158 src/main/java/com/gk/hotwork/specialWork/enums/MeasureTypeEnum.java | 74 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageService.java | 103 src/main/java/com/gk/hotwork/Service/DepartmentService.java | 37 src/main/java/com/gk/hotwork/Domain/dto/UserEnterpriseRPCRespDTO.java | 68 src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessWarningInfoRepository.java | 18 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRule.java | 159 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskUnitAndMeasure.java | 133 src/main/java/com/gk/hotwork/Controller/MajorEquipmentDataController.java | 107 src/main/java/com/gk/hotwork/Mapper/TaskEnclosureMapper.java | 10 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemStandInfoService.java | 13 src/main/java/com/gk/hotwork/Domain/dto/UserInfoRPCRespDTO.java | 138 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportBatchRepository.java | 9 src/main/java/com/gk/hotwork/specialWork/enums/WorkTemporaryPowerStatusEnum.java | 41 src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemQuery.java | 51 src/main/java/com/gk/hotwork/Mapper/mybatis/SelfCheckInfoMapper.xml | 63 src/main/java/com/gk/hotwork/ServletInitializer.java | 14 src/main/resources/docxTemplate/workAtHeight.docx | 0 src/main/java/com/gk/hotwork/Mapper/RiskMapRepository.java | 13 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventrCheckContentRespDTO.java | 149 src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalStepInfoService.java | 21 src/main/java/com/gk/hotwork/Service/ExamScoreService.java | 15 src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentDataImpl.java | 119 src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessDetectionPageDBQuery.java | 39 src/main/java/com/gk/hotwork/Service/DeviceLocationService.java | 20 src/main/java/com/gk/hotwork/Domain/Enum/PunishStatus.java | 36 src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerLogMapper.xml | 20 src/main/java/com/gk/hotwork/Service/EquipmentService.java | 22 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkListQueryRespDTO.java | 29 src/main/java/com/gk/hotwork/Config/Oauth2/IRedisService.java | 251 src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventProduceDeviceService.java | 67 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskMapMapper.xml | 38 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBrokenCircuitRespDTO.java | 81 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerReportRectifyUpdayeParams.java | 150 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckContentQueryReqDTO.java | 24 src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemMeasureInfoServiceImpl.java | 39 src/main/java/com/gk/hotwork/Service/ServiceImpl/PermissionServiceImpl.java | 146 src/main/java/com/gk/hotwork/Domain/Log/HiddenDangerLogAnno.java | 18 src/main/java/com/gk/hotwork/doublePrevention/utils/CalcuteDelayLevelUtils.java | 53 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyDetailRespDTO.java | 92 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleModReqDTO.java | 102 src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitAddReqDTO.java | 31 src/main/java/com/gk/hotwork/Service/RiskControlMeasureService.java | 51 src/main/java/com/gk/hotwork/Domain/Vo/AccountUserVo.java | 28 src/main/java/com/gk/hotwork/Service/ExcelExportService.java | 28 src/main/java/com/gk/hotwork/specialWork/controller/SpecialWorkMinoController.java | 59 src/main/java/com/gk/hotwork/specialWork/service/ApprovalConfigService.java | 4 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkTemporaryPowerPrintServiceImpl.java | 278 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventProduceDevice.java | 210 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyDetailRespDTO.java | 94 hazardInvestgation.iml | 238 src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessWarningInfo.java | 160 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckRecordFromTaskMapper.xml | 69 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfigLog.java | 97 src/main/java/com/gk/hotwork/Mapper/mybatis/SubTaskInfoMapper.xml | 43 src/main/java/com/gk/hotwork/specialWork/service/impl/WorkProcessServiceImpl.java | 275 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyAtHeightRespDTO.java | 63 src/main/java/com/gk/hotwork/Domain/Vo/SortTime.java | 59 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskUnitMapper.xml | 137 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigLogRepository.java | 17 src/main/java/com/gk/hotwork/doublePrevention/utils/SearchParams.java | 39 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectorReqDTO.java | 47 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUpdateReqDTO.java | 45 src/main/java/com/gk/hotwork/Config/Oauth2/RedisKeyEnum.java | 56 src/main/java/com/gk/hotwork/specialWork/model/query/WorkTemporaryPowerQuery.java | 24 src/main/java/com/gk/hotwork/Domain/Utils/IdCardUtil.java | 171 src/main/java/com/gk/hotwork/Service/ServiceImpl/AppFileServiceImpl.java | 46 src/main/java/com/gk/hotwork/specialWork/enums/WorkConfinedSpaceStatusEnum.java | 41 src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkReqDTO.java | 160 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureDeleteParams.java | 55 src/main/java/com/gk/hotwork/Domain/dto/RiskSourceDto.java | 174 src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckTaskFromWorkMapper.xml | 110 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemInfoMapper.xml | 80 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitSaveReqDTO.java | 43 src/main/java/com/gk/hotwork/Domain/Exception/Handler/CustomExceptionHandler.java | 24 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalStepRespDTO.java | 204 src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskEvent.java | 219 src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyCountDO.java | 34 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureDeleteReqDTO.java | 17 src/main/java/com/gk/hotwork/Domain/Vo/ContractStatus.java | 16 src/main/java/com/gk/hotwork/Mapper/specialWork/WorkGroundBreakingInfo.xml | 52 src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/db/OwnRectifyPageDBQuery.java | 17 src/main/java/com/gk/hotwork/Domain/TaskLocationInfo.java | 99 src/main/java/com/gk/hotwork/Domain/Utils/JsonUtils.java | 48 src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemStandRespDTO.java | 136 src/main/java/com/gk/hotwork/Domain/Utils/WordTemplate.java | 1222 src/main/java/com/gk/hotwork/Mapper/mybatis/TaskGasInfoMapper.xml | 55 src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskEventRepository.java | 65 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskServiceImpl.java | 1270 src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckRecordFromTaskController.java | 32 src/main/java/com/gk/hotwork/Mapper/TaskGasInfoMapper.java | 18 src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerLevel.java | 18 src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStand.java | 198 src/main/java/com/gk/hotwork/specialWork/enums/RuleItemSmTypeEnum.java | 59 src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUpdateParams.java | 176 src/main/java/com/gk/hotwork/doublePrevention/utils/AesGcm256Util.java | 139 src/main/java/com/gk/hotwork/doublePrevention/enums/WorkStatusEnum.java | 37 src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskRiskServiceImpl.java | 37 src/main/java/com/gk/hotwork/specialWork/enums/RuleItemTypeEnum.java | 48 src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java | 263 src/main/java/com/gk/hotwork/Mapper/mybatis/ExamSocreInfoMapper.xml | 33 1,262 files changed, 127,937 insertions(+), 0 deletions(-) diff --git a/generator/mybatis-generator-core-1.3.2.jar b/generator/mybatis-generator-core-1.3.2.jar new file mode 100644 index 0000000..3dd82fc --- /dev/null +++ b/generator/mybatis-generator-core-1.3.2.jar Binary files differ diff --git a/generator/mysql-connector-java-5.1.26-bin.jar b/generator/mysql-connector-java-5.1.26-bin.jar new file mode 100644 index 0000000..bf1e933 --- /dev/null +++ b/generator/mysql-connector-java-5.1.26-bin.jar Binary files differ diff --git a/generator/yufei.xml b/generator/yufei.xml new file mode 100644 index 0000000..d4d4f85 --- /dev/null +++ b/generator/yufei.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> +<generatorConfiguration> + <!-- 数据库驱动包位置 --> + <classPathEntry location="D:\workspace\firework\generator\mysql-connector-java-5.1.26-bin.jar" /> + <!--<classPathEntry location="C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar" />--> + <context id="DB2Tables" targetRuntime="MyBatis3"> + <property name="javaFileEncoding" value="UTF-8"/> + <commentGenerator> + <property name="suppressAllComments" value="false" /> + </commentGenerator> + <!-- 数据库链接URL、用户名、密码 --> + <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://twt.sinanoaq.com:13306/hotwork" userId="root" password="Sinanoaq#415"> + <!--<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@localhost:1521:orcl" userId="msa" password="msa">--> + </jdbcConnection> + <javaTypeResolver> + <property name="forceBigDecimals" value="false" /> + </javaTypeResolver> + <!-- 生成模型的包名和位置 --> + <javaModelGenerator targetPackage="com.gk.hotwork.Domain" targetProject="D:\workspace\zhongtai\src\main\java\"> + <property name="enableSubPackages" value="true" /> + <property name="trimStrings" value="true" /> + </javaModelGenerator> + <!-- 生成的xml映射文件包名和位置 --> + <sqlMapGenerator targetPackage="com.gk.hotwork.Mapper.mybatis" targetProject="D:\workspace\zhongtai\src\main\java\"> + <property name="enableSubPackages" value="true" /> + </sqlMapGenerator> + <!-- 生成DAO的包名和位置 --> + <javaClientGenerator type="XMLMAPPER" targetPackage="com.gk.hotwork.Mapper" targetProject="D:\zhongtai\firework\src\main\java\"> + <property name="enableSubPackages" value="true" /> + </javaClientGenerator> + <!-- 要生成那些表(更改tableName和domainObjectName就可以) --> +<!-- <table tableName="enterpsrise" domainObjectName="Enterprise" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="securitysupervisory" domainObjectName="SecuritySupervisory" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="enterpriseresource" domainObjectName="EnterpriseResource" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="enterpriseperson" domainObjectName="EnterprisePerson" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="enterpriseannual" domainObjectName="EnterpriseAnnual" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="enterprisedocument" domainObjectName="EnterpriseDocument" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="transportperson" domainObjectName="TransportPerson" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="enterprisestaff" domainObjectName="EnterpriseStaff" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="transportcertificate" domainObjectName="TransportCertificate" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> +<!-- <table tableName="transportcertificateperson" domainObjectName="TransportCertificatePerson" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />--> + <table tableName="sms_log" domainObjectName="SmsLog" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" /> + </context> +</generatorConfiguration> diff --git "a/generator/\347\224\237\346\210\220\350\257\255\345\217\245.txt" "b/generator/\347\224\237\346\210\220\350\257\255\345\217\245.txt" new file mode 100644 index 0000000..2f8c43c --- /dev/null +++ "b/generator/\347\224\237\346\210\220\350\257\255\345\217\245.txt" @@ -0,0 +1,3 @@ +java -jar mybatis-generator-core-1.3.2.jar -configfile yufei.xml -overwrite +//删除文件 +git rm --cached -r diff --git a/hazardInvestgation.iml b/hazardInvestgation.iml new file mode 100644 index 0000000..35ccdaf --- /dev/null +++ b/hazardInvestgation.iml @@ -0,0 +1,238 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="web" name="Web"> + <configuration> + <webroots> + <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" /> + </webroots> + </configuration> + </facet> + <facet type="Spring" name="Spring"> + <configuration /> + </facet> + </component> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jdbc:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.data:spring-data-jdbc:2.0.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.data:spring-data-relational:2.0.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" /> + <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" /> + <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.37" level="project" /> + <orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.37" level="project" /> + <orderEntry type="library" name="Maven: com.google.zxing:core:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" /> + <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" /> + <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" /> + <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j:1.3.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.30" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.30" level="project" /> + <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> + <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.3.2" level="project" /> + <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.3.2" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.22" level="project" /> + <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.22" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.21" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" /> + <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.14" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.14" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" /> + <orderEntry type="library" name="Maven: commons-io:commons-io:2.7" level="project" /> + <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.11" level="project" /> + <orderEntry type="library" name="Maven: org.apache.poi:poi:5.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" /> + <orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:5.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-lite:5.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:5.0.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.21" level="project" /> + <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.07" level="project" /> + <orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:5.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.java-websocket:Java-WebSocket:1.5.1" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.1.0.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-local:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-api:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-transformer:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-util-conversion:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" /> + <orderEntry type="library" name="Maven: com.google.guava:guava:28.1-jre" level="project" /> + <orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" /> + <orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" /> + <orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" /> + <orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.8.1" level="project" /> + <orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.2" level="project" /> + <orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" /> + <orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.18" level="project" /> + <orderEntry type="library" name="Maven: org.zeroturnaround:zt-exec:1.11" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-transformer-msoffice-word:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-transformer-msoffice-base:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-transformer-api:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-util-all:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: com.documents4j:documents4j-util-transformer-process:1.1.5" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.14" level="project" /> + <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.14" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" /> + <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" /> + <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.8.0" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.3.4.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.3.4.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: redis.clients:jedis:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.1" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.security.oauth:spring-security-oauth2:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" /> + <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:5.3.4.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.8.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.6" level="project" /> + <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.41" level="project" /> + <orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.0" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.security:spring-security-jwt:1.0.9.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.56" level="project" /> + <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.56" level="project" /> + <orderEntry type="library" name="Maven: com.liferay:org.apache.commons.fileupload:1.2.2.LIFERAY-PATCHED-1" level="project" /> + <orderEntry type="library" name="Maven: org.jetbrains:annotations:20.1.0" level="project" /> + <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.12" level="project" /> + <orderEntry type="library" name="Maven: com.google.zxing:javase:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: com.beust:jcommander:1.48" level="project" /> + <orderEntry type="library" name="Maven: com.github.jai-imageio:jai-imageio-core:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5" level="project" /> + <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.13" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.1.5.Final" level="project" /> + <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" /> + <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" /> + <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.1" level="project" /> + <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.1" level="project" /> + <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.1" level="project" /> + <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" /> + <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" /> + <orderEntry type="library" name="Maven: e-iceblue:spire.office.free:3.1.1" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-client:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-common:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-remoting:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-all:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: commons-validator:commons-validator:1.7" level="project" /> + <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.4" level="project" /> + <orderEntry type="library" name="Maven: commons-digester:commons-digester:2.1" level="project" /> + <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> + <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.redisson:redisson-spring-boot-starter:3.16.8" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.3.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.4" level="project" /> + <orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" /> + <orderEntry type="library" name="Maven: org.redisson:redisson:3.16.8" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-common:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.51.Final" level="project" /> + <orderEntry type="library" name="Maven: javax.cache:cache-api:1.1.1" level="project" /> + <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.9.RELEASE" level="project" /> + <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" /> + <orderEntry type="library" name="Maven: io.reactivex.rxjava3:rxjava:3.0.12" level="project" /> + <orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling:2.0.11.Final" level="project" /> + <orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling-river:2.0.11.Final" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2" level="project" /> + <orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.1.6" level="project" /> + <orderEntry type="library" name="Maven: org.jodd:jodd-core:5.1.6" level="project" /> + <orderEntry type="library" name="Maven: org.redisson:redisson-spring-data-25:3.16.8" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-spring-boot:2.2.2" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-acl:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-logging:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-srvutil:4.9.3" level="project" /> + <orderEntry type="library" name="Maven: commons-cli:commons-cli:1.2" level="project" /> + <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.2" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..db0c6d4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,387 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.3.3.RELEASE</version> + <relativePath/> <!-- lookup parent from repository --> + </parent> + <groupId>com.gk.zhongtai</groupId> + <artifactId>hazardInvestgation</artifactId> + <version>2.0.5</version> + <packaging>jar</packaging> + + <properties> + <project.build.sourceencoding>UTF-8</project.build.sourceencoding> + <project.reporting.outputencoding>UTF-8</project.reporting.outputencoding> + <java.version>1.8</java.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jdbc</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + <exclusions> + <!-- <exclusion>--> + <!-- <groupId>org.springframework.boot</groupId>--> + <!-- <artifactId>spring-boot-starter-logging</artifactId>--> + <!-- </exclusion>--> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + </exclusion> + <exclusion> + <artifactId>logback-classic</artifactId> + <groupId>ch.qos.logback</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> +<!-- <scope>provided</scope>--> + </dependency> + <dependency> + <groupId>com.google.zxing</groupId> + <artifactId>core</artifactId> + <version>3.4.1</version> + </dependency> + <dependency> + <groupId>org.mybatis.spring.boot</groupId> + <artifactId>mybatis-spring-boot-starter</artifactId> + <version>2.1.3</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-log4j --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j</artifactId> + <version>1.3.8.RELEASE</version> + </dependency> + + <!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter --> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-boot-starter</artifactId> + <version>3.3.2</version> + </dependency> + <!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter --> + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>druid-spring-boot-starter</artifactId> + <version>1.1.22</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <scope>runtime</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.7</version> + </dependency> + + <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec --> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.14</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.11</version> + </dependency> + + + <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>5.2.2</version> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + <version>5.2.2</version> + </dependency> + + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-scratchpad</artifactId> + <version>5.2.2</version> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml-schemas</artifactId> + <version>4.1.2</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>5.2.8.RELEASE</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket --> + <dependency> + <groupId>org.java-websocket</groupId> + <artifactId>Java-WebSocket</artifactId> + <version>1.5.1</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-websocket</artifactId> + <version>2.1.0.RELEASE</version> + </dependency> + + <dependency> + <groupId>com.documents4j</groupId> + <artifactId>documents4j-local</artifactId> + <version>1.1.5</version> + </dependency> + + <dependency> + <groupId>com.documents4j</groupId> + <artifactId>documents4j-transformer-msoffice-word</artifactId> + <version>1.1.5</version> + </dependency> + +<!-- 整合swagger2--> + <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger2</artifactId> + <version>2.8.0</version> + </dependency> + <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --> + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-swagger-ui</artifactId> + <version>2.8.0</version> + </dependency> + +<!-- 整合redis auth2--> + <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security</artifactId> + <version>2.3.3.RELEASE</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-redis</artifactId> + <version>2.3.3.RELEASE</version> + <exclusions> + <exclusion> + <groupId>io.lettuce</groupId> + <artifactId>lettuce-core</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- https://mvnrepository.com/artifact/redis.clients/jedis --> + <dependency> + <groupId>redis.clients</groupId> + <artifactId>jedis</artifactId> + <version>3.3.0</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2 --> + <dependency> + <groupId>org.springframework.security.oauth</groupId> + <artifactId>spring-security-oauth2</artifactId> + <version>2.3.3.RELEASE</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core --> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-core</artifactId> + <version>5.3.4.RELEASE</version> + </dependency> + <dependency> + <groupId>cn.hutool</groupId> + <artifactId>hutool-all</artifactId> + <version>5.0.6</version> + </dependency> + <!--json tools--> + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>fastjson</artifactId> + <version>1.2.41</version> + </dependency> + <!--jwt--> + <dependency> + <groupId>io.jsonwebtoken</groupId> + <artifactId>jjwt</artifactId> + <version>0.9.0</version> + </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-jwt</artifactId> + <version>1.0.9.RELEASE</version> + </dependency> + <!-- https://mvnrepository.com/artifact/com.liferay/org.apache.commons.fileupload --> + <dependency> + <groupId>com.liferay</groupId> + <artifactId>org.apache.commons.fileupload</artifactId> + <version>1.2.2.LIFERAY-PATCHED-1</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.jetbrains/annotations --> + <dependency> + <groupId>org.jetbrains</groupId> + <artifactId>annotations</artifactId> + <version>20.1.0</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.18.12</version> + <scope>provided</scope> + </dependency> + + <!--Java二维码相关依赖--> + <dependency> + <groupId>com.google.zxing</groupId> + <artifactId>core</artifactId> + <version>3.3.0</version> + </dependency> + <dependency> + <groupId>com.google.zxing</groupId> + <artifactId>javase</artifactId> + <version>3.3.0</version> + </dependency> + + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.5</version> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-validation</artifactId> + </dependency> + <dependency> + <groupId>com.baomidou</groupId> + <artifactId>mybatis-plus-extension</artifactId> + <version>3.4.1</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId > + <artifactId>aspectjweaver</artifactId > + <version>1.8.13</version > + </dependency> + <dependency> + <groupId>e-iceblue</groupId> + <artifactId>spire.office.free</artifactId> + <version>3.1.1</version> + </dependency> + <dependency> + <groupId>com.documents4j</groupId> + <artifactId>documents4j-local</artifactId> + <version>1.1.5</version> + </dependency> + + <dependency> + <groupId>com.documents4j</groupId> + <artifactId>documents4j-transformer-msoffice-word</artifactId> + <version>1.1.5</version> + </dependency> + <dependency> + <groupId>org.apache.rocketmq</groupId> + <artifactId>rocketmq-client</artifactId> + <version>4.9.3</version> + <exclusions> + <exclusion> + <artifactId>logback-classic</artifactId> + <groupId>ch.qos.logback</groupId> + </exclusion> + </exclusions> + </dependency> + <!-- https://mvnrepository.com/artifact/org.redisson/redisson-spring-boot-starter --> + <dependency> + <groupId>org.redisson</groupId> + <artifactId>redisson-spring-boot-starter</artifactId> + <version>3.16.8</version> + </dependency> + + <dependency> + <groupId>org.apache.rocketmq</groupId> + <artifactId>rocketmq-spring-boot</artifactId> + <version>2.2.2</version> + </dependency> + + </dependencies> + <repositories> + <repository> + <id>com.e-iceblue</id> + <url>http://repo.e-iceblue.cn/repository/maven-public/</url> + </repository> + </repositories> + <build> + <resources> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**/*.xml</include> + </includes> + </resource> + <!--设置自己目录下的配置文件--> + <resource> + <!--下方resources的文件夹名字要和自己项目的文件夹名确认一致才行 很多人就是忽略了名字不一致 --> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <mainClass>com.gk.hotwork.HotworkApplication</mainClass> + <fork>true</fork> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/src/main/java/com/gk/hotwork/Api/ApiController.java b/src/main/java/com/gk/hotwork/Api/ApiController.java new file mode 100644 index 0000000..86eeea0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Api/ApiController.java @@ -0,0 +1,178 @@ +package com.gk.hotwork.Api; + + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RoleInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.dto.DepartmentDTO; +import com.gk.hotwork.Domain.dto.UserDTO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.ExamScoreService; +import com.gk.hotwork.Service.RoleService; +import com.gk.hotwork.Service.UserService; +import com.sun.org.apache.bcel.internal.generic.I2F; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +@Api(tags = "Api接口数据接口") +@RestController +@RequestMapping("/api") +public class ApiController extends BaseController { + @Value("${filePath}") + private String filePath; //配置文件配置的物理保存地址 + @Value("${fileurl}") + private String fileurl; + @Autowired + ExamScoreService examscoreService; + @Autowired + UserService userService; + @Autowired + DepartmentService departmentService; + @Autowired + private RoleService roleService; + + @PostMapping("/addExam") + @ApiOperation(value = "添加合格成绩", notes = "添加合格成绩", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "realname",value = "真实姓名"), + @ApiImplicitParam(name = "mobile",value = "手机号"), + @ApiImplicitParam(name = "idcard",value = "身份证"), + @ApiImplicitParam(name = "examtype",value = "考试类型"), + @ApiImplicitParam(name = "score",value = "分数"), + @ApiImplicitParam(name = "starttime",value = "有效期开始时间"), + @ApiImplicitParam(name = "endtime",value = "有效期结束时间"), + }) + public Msg addExam(@RequestBody JSONArray jsonArray){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + ExamScoreInfo examScoreInfo = new ExamScoreInfo(); + examScoreInfo.setRealname(jsonObject.getString("realname")); + examScoreInfo.setMobile(jsonObject.getString("mobile")); + examScoreInfo.setIdcard(jsonObject.getString("idcard")); + examScoreInfo.setExamtype(jsonObject.getString("examtype")); + examScoreInfo.setScore(jsonObject.getInteger("score")); + examScoreInfo.setStarttime(jsonObject.getDate("starttime")); + examScoreInfo.setEndtime(jsonObject.getDate("endtime")); + examScoreInfo.setCreatetime(new Date()); + ExamScoreInfo examScoreExist = examscoreService.selectByMobile(jsonObject.getString("examtype"),jsonObject.getString("mobile")); + if (examScoreExist != null){ + examScoreInfo.setId(examScoreExist.getId()); + examscoreService.updateById(examScoreInfo); + }else { + examscoreService.save(examScoreInfo); + } + } + + return msg; + } + + /** + * @Description: 众泰考试api + * @date 2022/4/26 16:34 + */ + + @PostMapping("/exam/foreground/login") + public Msg examLogin(@RequestBody JSONObject loginFormData) { + //手机号 + String username = loginFormData.getString("telIdNo"); + String password = loginFormData.getString("password"); + UserInfo userInfo = userService.examForegroundLogin(username, password); + UserDTO userDTO = new UserDTO(); + BeanUtils.copyProperties(userInfo,userDTO); + if (userDTO.getId() != null) { + List<RoleInfo> roleInfos = roleService.selectRoleByUser(userDTO.getId()); + if (roleInfos.size() == 1) + userDTO.setRoleId(roleInfos.get(0).getId()); + userDTO.setRoleName(roleInfos.get(0).getName()); + } + + return success(userDTO); + } + + @PostMapping("/exam/background/login") + public Msg examBackgroundLogin(@RequestBody JSONObject loginFormData) { + + String username = loginFormData.getString("username"); + String password = loginFormData.getString("password"); + UserInfo userInfo = userService.examBackgroundLogin(username, password); + return success(userInfo); + } + + @PostMapping("/departmentPage") + public Msg departmentPage(@RequestBody JSONObject jsonObject) { + String name = jsonObject.getString("name"); + Integer first = jsonObject.getInteger("first"); + Integer pageSize = jsonObject.getInteger("pageSize"); + Map<String, Object> result = new HashMap<>(); + Integer count = departmentService.selectCountForExam(name); + List<DepartmentInfo> data = departmentService.selectPageForExam(name, first, pageSize); + result.put("count", count); + result.put("data", data); + return success(result); + } + + @PostMapping("/departmentList") + public Msg departmentList() { + List<DepartmentInfo> list = departmentService.list(new LambdaQueryWrapper<DepartmentInfo>().eq(DepartmentInfo::getIsdel,0)); + List<DepartmentDTO> res = new ArrayList<>(); + DepartmentDTO departmentDTO; + for (DepartmentInfo dep : list) { + departmentDTO = new DepartmentDTO(); + departmentDTO.setId(dep.getId()); + departmentDTO.setName(dep.getDepartment()); + res.add(departmentDTO); + } + + return success(res); + } + + @PostMapping("/personPage") + public Msg personPage(@RequestBody JSONObject jsonObject) { + String name = jsonObject.getString("name"); + String idno = jsonObject.getString("idno"); + String tel = jsonObject.getString("tel"); + String department = jsonObject.getString("department"); + String company = jsonObject.getString("company"); + Integer first = jsonObject.getInteger("first"); + Integer pageSize = jsonObject.getInteger("pageSize"); + Map<String, Object> result = new HashMap<>(); + Integer count = userService.selectCountForExam(name,idno,tel,department,company); + List<UserInfo> data = userService.selectPageForExam(name,idno,tel,department,company, first, pageSize); + result.put("count", count); + result.put("data", data); + return success(result); + } + + + @PostMapping("/rolePage") + public Msg rolePage(@RequestBody JSONObject jsonObject) { + String name = jsonObject.getString("name"); + Integer first = jsonObject.getInteger("first"); + Integer pageSize = jsonObject.getInteger("pageSize"); + Map<String, Object> result = new HashMap<>(); + Integer count = roleService.selectCountForRole(name); + List<RoleInfo> data = roleService.selectPageForRole(name, first, pageSize); + result.put("count", count); + result.put("data", data); + return success(result); + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Cors/CorsConfig.java b/src/main/java/com/gk/hotwork/Config/Cors/CorsConfig.java new file mode 100644 index 0000000..f3676be --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Cors/CorsConfig.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.Config.Cors; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +@Configuration +public class CorsConfig extends WebMvcConfigurerAdapter { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**").allowedOrigins("*") + .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS") + .allowCredentials(true).maxAge(3600); + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Cors/CorsFilter.java b/src/main/java/com/gk/hotwork/Config/Cors/CorsFilter.java new file mode 100644 index 0000000..ad6a38d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Cors/CorsFilter.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Config.Cors; + +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@Component +@WebFilter(urlPatterns = "/*", filterName = "CorsFilter") +public class CorsFilter implements Filter { + + @Override + public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { + HttpServletResponse response = (HttpServletResponse) res; + HttpServletRequest reqs = (HttpServletRequest) req; + String curOrigin = reqs.getHeader("Origin"); + response.setHeader("Access-Control-Allow-Origin", curOrigin == null ? "*" : curOrigin); +// response.setHeader("Access-Control-Allow-Origin", "*"); + response.setHeader("Access-Control-Allow-Credentials", "true"); + response.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT, OPTIONS"); + response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Auth-Token, Authorization"); +// response.setHeader("Access-Control-Allow-Headers", "*"); + response.setHeader("Access-Control-Max-Age","3600"); + chain.doFilter(req, res); + } + + + @Override + public void init(FilterConfig filterConfig) { + System.out.println("cors"); + } + + @Override + public void destroy() {} + +} diff --git a/src/main/java/com/gk/hotwork/Config/Cors/MyMvcConfigurer.java b/src/main/java/com/gk/hotwork/Config/Cors/MyMvcConfigurer.java new file mode 100644 index 0000000..8e6113b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Cors/MyMvcConfigurer.java @@ -0,0 +1,71 @@ +package com.gk.hotwork.Config.Cors; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class MyMvcConfigurer implements WebMvcConfigurer { + @Value("${filePath}") + private String filePath; //配置文件配置的物理保存地址 + @Value("${sqlPath}") + private String sqlPath; + @Value("${enterprisePath}") + private String enterprisePath; //配置文件配置的物理保存地址 + @Value("${contractPath}") + private String contractPath; //配置文件配置的物理保存地址 + @Value("${transportCertificatePath}") + private String transportCertificatePath; + @Value("${hiddenDangerPath}") + private String hiddenDangerPath; + @Value("${patrolPath}") + private String patrolPath; + @Value("${appPath}") + private String appPath; + @Value("${workCertPath}") + private String workCertPath; + @Value("${taskPath}") + private String taskPath; + @Value("${emergencyPlanPath}") + private String emergencyPlanPath; + + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "DELETE", "PUT","PATCH") + .maxAge(3600); + } + + /**服务器静态资源配置**/ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/upload/**") + .addResourceLocations("file:"+ filePath) //媒体资源 + .addResourceLocations("classpath:/META-INF/resources/"); //swagger2页面 + registry.addResourceHandler("/dbback/**") + .addResourceLocations("file:"+sqlPath); + registry.addResourceHandler("/upload/enterprise/**") + .addResourceLocations("file:"+enterprisePath); + registry.addResourceHandler("/upload/contract/**") + .addResourceLocations("file:"+contractPath); + registry.addResourceHandler("/upload/transportCertificate/**") + .addResourceLocations("file:" + transportCertificatePath); + registry.addResourceHandler("/upload/hiddenDanger/**") + .addResourceLocations("file:" + hiddenDangerPath); + registry.addResourceHandler("/upload/patrol/**") + .addResourceLocations("file:" + patrolPath); + registry.addResourceHandler("/upload/app/**") + .addResourceLocations("file:" + appPath); + registry.addResourceHandler("/upload/workCert/**") + .addResourceLocations("file:" + workCertPath); + registry.addResourceHandler("/upload/task/**") + .addResourceLocations("file:" + taskPath); + registry.addResourceHandler("/upload/emergencyPlan/**") + .addResourceLocations("file:" + emergencyPlanPath); + } +} diff --git a/src/main/java/com/gk/hotwork/Config/DataSource/DataSourceConfig.java b/src/main/java/com/gk/hotwork/Config/DataSource/DataSourceConfig.java new file mode 100644 index 0000000..0d4a008 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/DataSource/DataSourceConfig.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Config.DataSource; + +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.sql.DataSource; + +@Configuration +public class DataSourceConfig { + + @Bean + @ConfigurationProperties("spring.datasource.one") + DataSource dsOne(){ + return DruidDataSourceBuilder.create().build(); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Config/DataSource/MyBatisConfigOne.java b/src/main/java/com/gk/hotwork/Config/DataSource/MyBatisConfigOne.java new file mode 100644 index 0000000..972568a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/DataSource/MyBatisConfigOne.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.Config.DataSource; + +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.mybatis.spring.annotation.MapperScans; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.stereotype.Repository; + +import javax.sql.DataSource; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Configuration +@MapperScans({ + @MapperScan(value = "com.gk.hotwork.Mapper",sqlSessionFactoryRef = "sqlSessionFactoryBean1" ,annotationClass = Repository.class), + @MapperScan(value = "com.gk.hotwork.doublePrevention.repository",sqlSessionFactoryRef = "sqlSessionFactoryBean1" ,annotationClass = Repository.class), + @MapperScan(value = "com.gk.hotwork.specialWork.repository",sqlSessionFactoryRef = "sqlSessionFactoryBean1" ,annotationClass = Repository.class), +} +) +public class MyBatisConfigOne { + @Autowired + @Qualifier("dsOne") + DataSource dsOne; + + @Autowired + private PaginationInterceptor paginationInterceptor; + + + + @Bean + SqlSessionFactory sqlSessionFactoryBean1() throws Exception { + MybatisSqlSessionFactoryBean factoryBean = new MybatisSqlSessionFactoryBean(); + factoryBean.setDataSource(dsOne); + factoryBean.setMapperLocations(resolveMapperLocations()); + + //关键代码 设置 MyBatis-Plus 分页插件 + Interceptor[] plugins = {paginationInterceptor}; + paginationInterceptor.setLimit(100000); + factoryBean.setPlugins(plugins); + + return factoryBean.getObject(); + } + + public Resource[] resolveMapperLocations() { + ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); + List<String> mapperLocations = new ArrayList<>(); + mapperLocations.add("classpath*:com/gk/hotwork/Mapper/**/*.xml"); + List<Resource> resources = new ArrayList(); + if (mapperLocations != null) { + for (String mapperLocation : mapperLocations) { + try { + Resource[] mappers = resourceResolver.getResources(mapperLocation); + resources.addAll(Arrays.asList(mappers)); + } catch (IOException e) { + // ignore + } + } + } + return resources.toArray(new Resource[resources.size()]); + } + + @Bean + SqlSessionTemplate sqlSessionTemplate1() throws Exception{ + return new SqlSessionTemplate(sqlSessionFactoryBean1()); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Config/DataSource/MybatisAspectj.java b/src/main/java/com/gk/hotwork/Config/DataSource/MybatisAspectj.java new file mode 100644 index 0000000..9736a10 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/DataSource/MybatisAspectj.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.Config.DataSource; + +import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.stereotype.Component; + +@Aspect +@Component +public class MybatisAspectj { + // 配置织入点 + @Pointcut("execution(public * com.baomidou.mybatisplus.core.mapper.BaseMapper.selectOne(..))") + public void selectOneAspect() { + } + + @Before("selectOneAspect()") + public void beforeSelect(JoinPoint point) { + Object arg = point.getArgs()[0]; + if (arg instanceof AbstractWrapper) { + arg = (AbstractWrapper) arg; + ((AbstractWrapper) arg).last("limit 1"); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Log/HiddenDangerLogAspect.java b/src/main/java/com/gk/hotwork/Config/Log/HiddenDangerLogAspect.java new file mode 100644 index 0000000..5431db9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Log/HiddenDangerLogAspect.java @@ -0,0 +1,122 @@ +package com.gk.hotwork.Config.Log; + + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Config.Oauth2.RedisKeyEnum; +import com.gk.hotwork.Domain.Enum.SourceType; +import com.gk.hotwork.Domain.HiddenDanger; +import com.gk.hotwork.Domain.HiddenDangerLog; +import com.gk.hotwork.Domain.Log.HiddenDangerLogAnno; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.SpringBeanUtil; +import com.gk.hotwork.Service.HiddenDangerLogService; +import com.gk.hotwork.Service.UserService; +import com.google.common.net.HttpHeaders; +import io.jsonwebtoken.Claims; +import org.apache.log4j.Logger; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import javax.xml.crypto.Data; +import java.lang.reflect.Method; +import java.util.Date; + +@Aspect +@Component +public class HiddenDangerLogAspect { + + private static final Logger logger = Logger.getLogger(HiddenDangerLogAspect.class); + + @Autowired + private HiddenDangerLogService hiddenDangerLogService; + @Autowired + private IRedisService redisService; + @Autowired + private UserService userService; + + @Pointcut("@annotation(com.gk.hotwork.Domain.Log.HiddenDangerLogAnno)") + public void controllerAspect() { + } + + + @AfterReturning(returning="result",pointcut = "controllerAspect()") + public void AfterExec(JoinPoint joinPoint,Object result) + { + handleLog(joinPoint,result); + //调用日志处理类去处理我们的日志 + } + + + private void handleLog(JoinPoint joinPoint,Object result) { + try { + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + assert requestAttributes != null; + HttpServletRequest request = requestAttributes.getRequest(); + String token = request.getHeader(HttpHeaders.AUTHORIZATION); + //解析token + Claims claims = CommonUtil.parseJWT(token); + String tokenKey = StrUtil.format(RedisKeyEnum.AUTH_TOKEN.getKey(), claims.getId()); + Object o = redisService.get(tokenKey); + JSONObject user = JSONObject.parseObject(o.toString()); + Msg msg = (Msg) result; + Object hiddenDanger = msg.getResult(); + HiddenDangerLog logInfo = getLogInfo(joinPoint); + if (logInfo != null) { + Long id = user.getLong("id"); + UserInfo userInfo = userService.getById(id); + logInfo.setOperatorid(id); + logInfo.setOperator(userInfo.getRealname()); + logInfo.setDetail(logInfo.getOperator() + logInfo.getDetail()); + logInfo.setOperationtime(new Date()); + logInfo.setValidflag(true); + logInfo.setExtra(hiddenDanger instanceof HiddenDanger?((HiddenDanger) hiddenDanger).getRectifier():""); + hiddenDangerLogService.save(logInfo); + } + + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + + private HiddenDangerLog getLogInfo(JoinPoint joinPoint) throws Exception{ + //类名 + String targetName = joinPoint.getTarget().getClass().getName(); + // + String methodName = joinPoint.getSignature().getName(); + HiddenDangerLog hiddenDangerLog = null; + Object[] args = joinPoint.getArgs(); + Class<?> targetClass = Class.forName(targetName); + Method[] methods = targetClass.getMethods(); + for (Method method : methods) { + if (method.getName().equals(methodName)) { + Class<?>[] clazzs = method.getParameterTypes(); + if (clazzs.length == args.length) { + hiddenDangerLog = new HiddenDangerLog(); + String detail = method.getAnnotation(HiddenDangerLogAnno.class).detail(); + String operation = method.getAnnotation(HiddenDangerLogAnno.class).operation(); + SourceType source = method.getAnnotation(HiddenDangerLogAnno.class).source(); + hiddenDangerLog.setDetail(detail); + hiddenDangerLog.setOperation(operation); + hiddenDangerLog.setSource(source); + break; + } + } + } + return hiddenDangerLog; + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/AccessTokenFilter.java b/src/main/java/com/gk/hotwork/Config/Oauth2/AccessTokenFilter.java new file mode 100644 index 0000000..c4a0ef7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/AccessTokenFilter.java @@ -0,0 +1,215 @@ +package com.gk.hotwork.Config.Oauth2; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.gk.hotwork.Domain.AuthorizationInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.Constants; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.UserVo; +import com.gk.hotwork.Service.AuthorizationService; +import com.gk.hotwork.Service.UserService; +import io.jsonwebtoken.Claims; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.util.AntPathMatcher; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Map; + +/** + * AccessToken filter + * + * @author zhangby + * @date 2019-05-20 20:32 + */ +public class AccessTokenFilter implements Filter { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Value("${workname}") + private String workname; + + /** + * redis service + */ + IRedisService redisService = SpringContextUtil.getBean(IRedisService.class); + + UserService userService = SpringContextUtil.getBean(UserService.class); + + AuthorizationService authorizationService = SpringContextUtil.getBean(AuthorizationService.class); + + /** + * do filter + * + * @param servletRequest servletRequest + * @param servletResponse servletResponse + * @param filterChain filterChain + * @throws IOException IOException + * @throws ServletException ServletException + */ + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + HttpServletRequest request = (HttpServletRequest) servletRequest; + HttpServletResponse response = (HttpServletResponse) servletResponse; + response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); + Msg msg = new Msg(); + try { + // filter url && !request.getMethod().equals("OPTIONS") + if (urlMatcher(request.getRequestURI(), Constants.FILTER_EXCLUDE_PATH)){ + String token = request.getHeader(HttpHeaders.AUTHORIZATION); + if (null != token && !token.equals("undefined")) { + /** 解析token */ + Claims claims = CommonUtil.parseJWT(token); + if (ObjectUtil.isNotNull(claims)) { + //设置当前登录用户 + System.setProperty(Constants.CURRENT_USER_ID, claims.get("user_id").toString()); + try { + //获取redis 查询token是否有效 [jti] + String tokenKey = StrUtil.format(RedisKeyEnum.AUTH_TOKEN.getKey(), claims.getId()); + Object userInfo = redisService.get(tokenKey); + if (ObjectUtil.isNotNull(userInfo)) { + Map map = JSON.parseObject(userInfo.toString(), Map.class); + UserVo userVo = userService.selectUserVoByName(workname,map.get("username").toString()); + if (null == userVo) { + msg.setCode("100"); + msg.setMessage("用户不存在"); + returnJson(response, msg); + return; + } +// if (userVo.getIssale() == 1){ +// if (userVo.getStatus()!=null && userVo.getStatus() != 1){ +// msg.setCode("100"); +// msg.setMessage("用户已失效"); +// returnJson(response, msg); +// return; +// } +// if (userVo.getExpiredate() != null && userVo.getExpiredate().getTime() < System.currentTimeMillis()){ +// msg.setCode("100"); +// msg.setMessage("用户已超期"); +// returnJson(response, msg); +// return; +// } +// +// Object loginObj = map.get("logintime"); +// Object authObj = map.get("auth"); +// if (loginObj != null && authObj != null){ +// //通过auth查询授权码最后登录时间 +// AuthorizationInfo authInfo = authorizationService.selectByUser(userVo.getCompanynumber(),authObj.toString()); +// if (authInfo == null){ +// msg.setCode("100"); +// msg.setMessage("授权码无效"); +// returnJson(response, msg); +// return; +// } +// if (authInfo.getLasttime().getTime() > Long.parseLong(loginObj.toString())){ +// redisService.set(tokenKey, userInfo, 0L); +// msg.setCode("100"); +// msg.setMessage("登录失效,请重新登录"); +// returnJson(response, msg); +// return; +// } +// } +// } + //更新登录超时时间 + redisService.set(tokenKey, userInfo, 60L*60L*18L); + } else { + logger.info("998:登录超时,无效认证"); + msg.setCode("100"); + msg.setMessage("登录超时,无效认证"); + returnJson(response, msg); + return; + } + } catch (Exception e) { + logger.info("401:非授权访问,无效的token"); + } + } else { + logger.info("500: 账户或密码不正确,登录失败"); + } + } + else if(request.getMethod().equals("OPTIONS")) { + response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); + response.setHeader("Access-Control-Allow-Credentials", "true"); + response.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT, OPTIONS"); + response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Auth-Token, Authorization"); + response.setHeader("Access-Control-Max-Age","3600"); + response.setStatus(HttpStatus.OK.value()); + return; + } + else { + logger.info("500: token不存在"); + } + } + } catch (Exception e) { + e.printStackTrace(); + //系统异常 + msg.setCode("100"); + msg.setMessage("系统异常请稍后重试"); + returnJson(response, msg); + response.setStatus(HttpStatus.OK.value()); + } + filterChain.doFilter(servletRequest, servletResponse); + //过滤器结束之后销毁 + System.clearProperty(Constants.CURRENT_USER_ID); + } + + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } + + @Override + public void destroy() { + + } + + /** + * 认证是否需要,验证session url + * + * @param real_url + * @return + */ + private boolean urlMatcher(String real_url, String pathFilter) { + AntPathMatcher antPathMatcher = new AntPathMatcher(); + /** 验证添加项url */ + if (StrUtil.isNotBlank(pathFilter)) { + for (String path : pathFilter.split(",")) { + if (antPathMatcher.match(path.trim(), real_url.trim())) { + return false; + } + } + } + return true; + } + + /** + * 返回url + * + * @param response + * @param + */ + private void returnJson(HttpServletResponse response, Msg msg) { + PrintWriter writer = null; + response.setCharacterEncoding("UTF-8"); + response.setContentType("text/html; charset=utf-8"); + response.setHeader("Access-Control-Allow-Credentials", "true"); + response.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT, OPTIONS"); + response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Auth-Token, Authorization"); + response.setHeader("Access-Control-Max-Age","3600"); + try { + writer = response.getWriter(); + writer.print(JSON.toJSON(msg)); + } catch (IOException e) { + } finally { + if (writer != null) { + writer.close(); + } + } + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/IRedisService.java b/src/main/java/com/gk/hotwork/Config/Oauth2/IRedisService.java new file mode 100644 index 0000000..6e14893 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/IRedisService.java @@ -0,0 +1,251 @@ +package com.gk.hotwork.Config.Oauth2; + +import com.alibaba.fastjson.JSON; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.util.*; +import java.util.concurrent.TimeUnit; + +/** + * redis service + * + * @author zhangby + * @date 2019-05-15 09:34 + */ +@Service +public class IRedisService { + /** + * logger + */ + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + /** + * redis service + */ + @Autowired + protected StringRedisTemplate redisTemplate; + @Value("${spring.redis.database}") + private Integer database; + + @PostConstruct + public void initTest(){ + try { + this.set("redisConnect", "testConnection", (long) 60); + logger.info("redis-db connection测试连接成功"); + } catch (Exception e) { + logger.error("redis-db connection测试连接失败"); + } + + } + /** + * Write to redis cache + * + * @param key key + * @param value value + * @return boolean + */ + public boolean set(final String key, Object value) { + boolean result = false; + if (value != null) { + try { + ValueOperations operations = redisTemplate.opsForValue(); + if (value instanceof String) { + operations.set(key, value.toString()); + } else { + operations.set(key, JSON.toJSONString(value)); + } + result = true; + } catch (Exception e) { + logger.info("Writing redis cache failed! The error message is:" + e.getMessage()); + e.printStackTrace(); + } + } + return result; + } + + /** + * Write redis cache (set expire survival time) + * + * @param key key + * @param value value + * @param expire time + * @return boolean + */ + public boolean set(final String key, Object value, Long expire) { + boolean result = false; + try { + ValueOperations operations = redisTemplate.opsForValue(); + if (value instanceof String) { + operations.set(key, value.toString()); + } else { + operations.set(key, JSON.toJSONString(value)); + } + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + result = true; + } catch (Exception e) { + logger.info("Writing to the redis cache (setting the expire lifetime) failed! The error message is:" + e.getMessage()); + e.printStackTrace(); + } + return result; + } + + + /** + * Read redis cache + * + * @param key key + * @return object + */ + public Object get(final String key) { + Object result = null; + try { + ValueOperations operations = redisTemplate.opsForValue(); + result = operations.get(key); + } catch (Exception e) { + logger.info("Failed to read redis cache! The error message is:" + e.getMessage()); + e.printStackTrace(); + } + return result; + } + + /** + * Read redis to entity + * + * @param key redis key + * @param clazz 实体类class + * @param <T> 泛型 + * @return T + */ + public <T> T getBean(final String key, Class<T> clazz) { + return Optional.ofNullable(get(key)) + .map(o -> JSON.parseObject(o.toString(), clazz)) + .orElse(null); + } + + /** + * Read redis to List + * @param key + * @param clazz + * @param <T> + * @return + */ + public <T> List<T> getArrayBean(final String key, Class<T> clazz) { + return Optional.ofNullable(get(key)) + .map(o -> JSON.parseArray(o.toString(), clazz)) + .orElse(null); + } + + + /** + * Determine if there is a corresponding key in the redis cache + * + * @param key key + * @return boolean + */ + public boolean exists(final String key) { + boolean result = false; + try { + result = redisTemplate.hasKey(key); + } catch (Exception e) { + logger.info("Determine if there is a corresponding key in the redis cache failed! The error message is:" + e.getMessage()); + e.printStackTrace(); + } + return result; + } + + /** + * Redis deletes the corresponding value according to the key + * + * @param key key + * @return boolean + */ + public boolean remove(final String key) { + boolean result = false; + try { + if (exists(key)) { + redisTemplate.delete(key); + } + result = true; + } catch (Exception e) { + logger.info("Redis fails to delete the corresponding value according to the key! The error message is:" + e.getMessage()); + e.printStackTrace(); + } + return result; + } + + /** + * Redis deletes the corresponding value according to the keywords batch + * + * @param keys keys + */ + public void remove(final String... keys) { + for (String key : keys) { + remove(key); + } + } + + + public void setDbIndex(Integer dbIndex) { + if (dbIndex == null || dbIndex > 15 || dbIndex < 0) { + dbIndex = database; + } + JedisConnectionFactory connectionFactory = (JedisConnectionFactory) redisTemplate.getConnectionFactory(); + if (connectionFactory == null) { + return; + } + connectionFactory.setDatabase(dbIndex); + redisTemplate.setConnectionFactory(connectionFactory); + } + + public void rightPush(String key, String value) { + redisTemplate.opsForList().rightPush(key, value); + } + + public String leftPop(String key) { + return redisTemplate.opsForList().leftPop(key); + } + + public Long listSize(String key) { + return redisTemplate.opsForList().size(key); + } + + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + public void setExpiredTime(String key,long seconds) { + redisTemplate.expire(key, seconds, TimeUnit.SECONDS); + } + + + /** + * @Description: 获取以某个prefix为前缀的所有value + * @date 2022/5/16 11:13 + */ + public List<String> getListKey(Set<String> keys) { + return redisTemplate.opsForValue().multiGet(keys); + } + + public Set<String> scan(String matchKey) { + return redisTemplate.execute((RedisCallback<Set<String>>) connection -> { + Set<String> keysTmp = new HashSet<>(); + Cursor<byte[]> cursor = connection.scan(new ScanOptions.ScanOptionsBuilder().match(matchKey).count(1000).build()); + while (cursor.hasNext()) { + keysTmp.add(new String(cursor.next())); + } + return keysTmp; + }); + } + + public void expireAt(String key, Date date) { + redisTemplate.expireAt(key, date); + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/JwtAccessToken.java b/src/main/java/com/gk/hotwork/Config/Oauth2/JwtAccessToken.java new file mode 100644 index 0000000..6264cb1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/JwtAccessToken.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.Config.Oauth2; + +import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; + +/** + * 自定义token + * + * @author zhangby + * @date 2019-04-01 11:39 + */ +public class JwtAccessToken extends JwtAccessTokenConverter { + + @Override + public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { + DefaultOAuth2AccessToken defaultOAuth2AccessToken = new DefaultOAuth2AccessToken(accessToken); + // 设置额外用户信息 + OauthUser baseUser = ((OauthUser) authentication.getPrincipal()); + // 将用户信息添加到token额外信息中 + defaultOAuth2AccessToken.getAdditionalInformation().put("user_id", baseUser.getId()); + defaultOAuth2AccessToken.getAdditionalInformation().put("company", baseUser.getCompany()); + defaultOAuth2AccessToken.getAdditionalInformation().put("department", baseUser.getDepartment()); + defaultOAuth2AccessToken.getAdditionalInformation().put("userType", baseUser.getUserType()); + defaultOAuth2AccessToken.getAdditionalInformation().put("idCard", baseUser.getIdcard()); + + return super.enhance(defaultOAuth2AccessToken, authentication); + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/JwtConfig.java b/src/main/java/com/gk/hotwork/Config/Oauth2/JwtConfig.java new file mode 100644 index 0000000..cb9f29d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/JwtConfig.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.Config.Oauth2; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; + +/** + * 配置jwt + */ +@Configuration +public class JwtConfig { + + @Autowired + JwtAccessTokenConverter jwtAccessTokenConverter; + + @Bean + @Qualifier("tokenStore") + public TokenStore tokenStore() { + return new JwtTokenStore(jwtAccessTokenConverter); + } + + @Bean + protected JwtAccessTokenConverter jwtTokenEnhancer() { + JwtAccessToken converter = new JwtAccessToken(); + converter.setSigningKey("springCloud_oauth_service"); + return converter; + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/LoginAuthenticationFilter.java b/src/main/java/com/gk/hotwork/Config/Oauth2/LoginAuthenticationFilter.java new file mode 100644 index 0000000..10dcab6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/LoginAuthenticationFilter.java @@ -0,0 +1,77 @@ +package com.gk.hotwork.Config.Oauth2; + + +import com.gk.hotwork.Domain.Utils.Constants; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.security.web.util.matcher.OrRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.GenericFilterBean; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Optional; + +/** + * 添加用户授权统一过滤【对登录类型支持】 + * + * @author zhangby + * @date 2019-04-09 16:41 + */ +@Component +public class LoginAuthenticationFilter extends GenericFilterBean implements ApplicationContextAware { + + private static final String OAUTH_TOKEN_URL = "/oauth/token"; + + private RequestMatcher requestMatcher; + + public LoginAuthenticationFilter(){ + this.requestMatcher = new OrRequestMatcher( + new AntPathRequestMatcher(OAUTH_TOKEN_URL, "GET"), + new AntPathRequestMatcher(OAUTH_TOKEN_URL, "POST") + ); + } + + /** + * 过滤拦截 + * @param servletRequest + * @param servletResponse + * @param filterChain + * @throws IOException + * @throws ServletException + */ + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + + HttpServletRequest request = (HttpServletRequest) servletRequest; + HttpServletResponse response = (HttpServletResponse) servletResponse; + + if(requestMatcher.matches(request)){ + try{ + //设置集成登录信息 + String auth_type = request.getParameter("auth_type"); + System.setProperty(Constants.AUTH_TYPE, Optional.ofNullable(auth_type).orElse("")); + //预处理 + filterChain.doFilter(request,response); + //后置处理 + }finally { + System.clearProperty(Constants.AUTH_TYPE); + } + }else{ + filterChain.doFilter(request,response); + } + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/OAuth2Config.java b/src/main/java/com/gk/hotwork/Config/Oauth2/OAuth2Config.java new file mode 100644 index 0000000..fc3b2cc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/OAuth2Config.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.Config.Oauth2; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; +import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; + +/** + * 配置oauth2.0 + * + * @author zhangby + * @date 2019/2/27 11:27 AM + */ +@Configuration +@EnableAuthorizationServer +public class OAuth2Config extends AuthorizationServerConfigurerAdapter { + + @Override + public void configure(ClientDetailsServiceConfigurer clients) throws Exception { + clients.inMemory() + .withClient("uaa-service") + .secret("123456") + .scopes("service") + .autoApprove(true) + .authorizedGrantTypes("implicit", "refresh_token", "password", "authorization_code") + //18小时过期 + .refreshTokenValiditySeconds(18*60*60) + .accessTokenValiditySeconds(18*60*60); + } + + @Override + public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { + endpoints.tokenStore(tokenStore) + .tokenEnhancer(tokenConverter) + .reuseRefreshTokens(false) + .authenticationManager(authenticationManager) + .userDetailsService(userServiceDetail); + } + + @Autowired + private LoginAuthenticationFilter loginAuthenticationFilter; + + @Override + public void configure(AuthorizationServerSecurityConfigurer security) throws Exception { + security.allowFormAuthenticationForClients() + .tokenKeyAccess("isAuthenticated()") + .checkTokenAccess("permitAll()") + .addTokenEndpointAuthenticationFilter(loginAuthenticationFilter); + } + + @Autowired + private UserServiceDetail userServiceDetail; + + @Autowired + @Qualifier("authenticationManagerBean") + private AuthenticationManager authenticationManager; + + @Autowired + TokenStore tokenStore; + + @Autowired + JwtAccessTokenConverter tokenConverter; +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/OauthRole.java b/src/main/java/com/gk/hotwork/Config/Oauth2/OauthRole.java new file mode 100644 index 0000000..4aaac2e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/OauthRole.java @@ -0,0 +1,71 @@ +package com.gk.hotwork.Config.Oauth2; + + +import org.springframework.security.core.GrantedAuthority; + +/** + * oauth2.0授权 角色类 + * + * @author zhangby + * @date 2019-05-14 09:25 + */ + +public class OauthRole implements GrantedAuthority { + + /** + * 角色id + */ + private String id; + /** + * 角色名称 + */ + private String name; + + private String code; + + private String btnAccess; + + public OauthRole(String id, String name,String code,String btnAccess) { + this.name = name; + this.id = id; + this.code = code; + this.btnAccess = btnAccess; + } + + @Override + public String getAuthority() { + return name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getBtnAccess() { + return btnAccess; + } + + public void setBtnAccess(String btnAccess) { + this.btnAccess = btnAccess; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/OauthUser.java b/src/main/java/com/gk/hotwork/Config/Oauth2/OauthUser.java new file mode 100644 index 0000000..a62ff34 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/OauthUser.java @@ -0,0 +1,158 @@ +package com.gk.hotwork.Config.Oauth2; + +import com.google.common.collect.Lists; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; +import java.util.List; + +/** + * oauth2.0授权 用户类 + * + * @author zhangby + * @date 2019-05-13 16:22 + */ +@ApiModel(value = "OauthUser") +public class OauthUser implements UserDetails { + + /** + * 用户id + */ + @ApiModelProperty(hidden = true) + private String id; + /** + * 用户名 + */ + @ApiModelProperty(value = "username(登录名)", example = "admin") + private String username; + /** + * 密码 + */ + @ApiModelProperty(value = "password(密码)", example = "123") + private String password; + + + private String company; + + private Integer userType; + + private Long department; + + private String departmentName; + + private String idcard; + /** + * 用户角色 + */ + @ApiModelProperty(hidden = true) + private List<OauthRole> oauthRoles = Lists.newArrayList(); + + @Override + @ApiModelProperty(hidden = true) + public Collection<? extends GrantedAuthority> getAuthorities() { + return this.oauthRoles; + } + + @Override + @ApiModelProperty(hidden = true) + public String getPassword() { + return this.password; + } + + @Override + @ApiModelProperty(hidden = true) + public String getUsername() { + return this.username; + } + + @Override + @ApiModelProperty(hidden = true) + public boolean isAccountNonExpired() { + return true; + } + + @Override + @ApiModelProperty(hidden = true) + public boolean isAccountNonLocked() { + return true; + } + + @Override + @ApiModelProperty(hidden = true) + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + @ApiModelProperty(hidden = true) + public boolean isEnabled() { + return true; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public void setUsername(String username) { + this.username = username; + } + + public void setPassword(String password) { + this.password = password; + } + + public List<OauthRole> getOauthRoles() { + return oauthRoles; + } + + public void setOauthRoles(List<OauthRole> oauthRoles) { + this.oauthRoles = oauthRoles; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public Integer getUserType() { + return userType; + } + + public void setUserType(Integer userType) { + this.userType = userType; + } + + public Long getDepartment() { + return department; + } + + public void setDepartment(Long department) { + this.department = department; + } + + public String getDepartmentName() { + return departmentName; + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/RedisKeyEnum.java b/src/main/java/com/gk/hotwork/Config/Oauth2/RedisKeyEnum.java new file mode 100644 index 0000000..c7ddd12 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/RedisKeyEnum.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.Config.Oauth2; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.StrUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +/** + * Redis key 枚举 + * + * @author zhangby + * @date 14/10/19 2:02 pm + */ +public enum RedisKeyEnum { + /** + * redis for access_token key + */ + AUTH_TOKEN("auth:token:{}"), + /** + * app user for redis key + */ + REDIS_KEY_USER_ID("user:id:{}"), + /** + * redis for dict key + */ + REDIS_KEY_DICT_TYPE("dict:type:{}"); + + private String key; + + RedisKeyEnum(String key) { + this.key = key; + } + + public String getKey() { + return this.key; + } + + /** + * 枚举转list + * + * @return + */ + public static List<Dict> toList() { + return Stream.of(values()) + .collect( + ArrayList::new, + (li, item) -> li.add(Dict.create() + .set("label", StrUtil.format(item.getKey(), "")) + .set("value", StrUtil.format(item.getKey(), "")) + ), + List::addAll + ); + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/ResourceServerConfig.java b/src/main/java/com/gk/hotwork/Config/Oauth2/ResourceServerConfig.java new file mode 100644 index 0000000..db04319 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/ResourceServerConfig.java @@ -0,0 +1,50 @@ +package com.gk.hotwork.Config.Oauth2; + +import com.gk.hotwork.Domain.Utils.Constants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; +import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; +import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + +/** + * resource config + * + * @author zhangby + * @date 2019-05-19 12:08 + */ +@Configuration +@EnableResourceServer +public class ResourceServerConfig extends ResourceServerConfigurerAdapter { + Logger log = LoggerFactory.getLogger(ResourceServerConfig.class); + + //去除部分不需要token的url FILTER_EXCLUDE_PATH + @Override + public void configure(HttpSecurity http) throws Exception { + http + .csrf().disable() + .logout().disable() + .addFilterBefore(new AccessTokenFilter(), BasicAuthenticationFilter.class) + .authorizeRequests() + .antMatchers(Constants.FILTER_EXCLUDE_PATH.split(",")).permitAll() + .antMatchers("/**").authenticated(); + } + + + @Override + public void configure(ResourceServerSecurityConfigurer resources) throws Exception { + resources.resourceId("oauth-client").tokenStore(tokenStore); + } + + @Autowired + TokenStore tokenStore; + + @Autowired + JwtAccessTokenConverter tokenConverter; +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/SpringContextUtil.java b/src/main/java/com/gk/hotwork/Config/Oauth2/SpringContextUtil.java new file mode 100644 index 0000000..bb799f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/SpringContextUtil.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Config.Oauth2; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Static injection of spring objects + * + * @author zhangby + * @date 2019-05-15 11:45 + */ +@Component +public class SpringContextUtil implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + /** + * 设置 setApplicationContext + * @param applicationContext application + * @throws BeansException beansException + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (SpringContextUtil.applicationContext == null) { + SpringContextUtil.applicationContext = applicationContext; + } + } + + /** + * 获取applicationContext + * @return ApplicationContext + */ + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * 通过name获取 Bean. + * @param name 名称 + * @return Object + */ + public static Object getBean(String name) { + return getApplicationContext().getBean(name); + } + + /** + * 通过class获取Bean. + * @param clazz class + * @param <T> T + * @return T + */ + public static <T> T getBean(Class<T> clazz) { + return getApplicationContext().getBean(clazz); + } + + /** + * 通过name,以及Clazz返回指定的Bean + * @param name name + * @param clazz class + * @param <T> T + * @return T + */ + public static <T> T getBean(String name, Class<T> clazz) { + return getApplicationContext().getBean(name, clazz); + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/UserServiceDetail.java b/src/main/java/com/gk/hotwork/Config/Oauth2/UserServiceDetail.java new file mode 100644 index 0000000..31d6985 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/UserServiceDetail.java @@ -0,0 +1,76 @@ +package com.gk.hotwork.Config.Oauth2; + +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.Constants; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.RoleService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Optional; + +/** + * 加载用户特定数据的核心接口(Core interface which loads user-specific data.) + * + * @author zhangby + * @date 2019-05-14 09:49 + */ +@Service +public class UserServiceDetail implements UserDetailsService { + + @Autowired + UserService userService; + @Autowired + RoleService roleService; + @Autowired + DepartmentService departmentService; + + @Value("${workname}") + private String workname; + /** + * 根据用户名查询用户 + */ + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + String authType = System.getProperty(Constants.AUTH_TYPE); + OauthUser oauthUser = new OauthUser(); + //查询登录用户 + UserInfo userInfo = userService.selectUserVoByName(workname,username); + Optional.of(userInfo).ifPresent(us ->{ + //查询角色 + List<OauthRole> roleByUser = roleService.selectOauthRoleByUser(us.getId().intValue()); + //数据类型转换 + List<OauthRole> oauthRoles = CommonUtil + .convers(roleByUser, role -> new OauthRole( + role.getId(), + role.getAuthority(),null,null) + ); + //数据结果集封装 + oauthUser.setId(us.getId().toString()); + oauthUser.setPassword(us.getPassword()); + oauthUser.setUsername(us.getRealname()); + oauthUser.setOauthRoles(oauthRoles); + oauthUser.setDepartment(us.getDepartment()); + if (us.getDepartment() != null) { + DepartmentInfo dep = departmentService.getById(us.getId()); + if (dep != null) { + oauthUser.setDepartmentName(dep.getDepartment()); + } + + } + oauthUser.setCompany(us.getCompany()); + oauthUser.setUserType(us.getType()); + oauthUser.setIdcard(us.getIdcard()); + }); + //判断登录入口 + return oauthUser; + } +} diff --git a/src/main/java/com/gk/hotwork/Config/Oauth2/WebSecurityConfig.java b/src/main/java/com/gk/hotwork/Config/Oauth2/WebSecurityConfig.java new file mode 100644 index 0000000..7da792c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Oauth2/WebSecurityConfig.java @@ -0,0 +1,87 @@ +package com.gk.hotwork.Config.Oauth2; + +import com.gk.hotwork.Domain.Utils.Base64Encrypt; +import com.gk.hotwork.Domain.Utils.MD5Utils; +import org.apache.tomcat.util.security.MD5Encoder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.password.PasswordEncoder; + +import javax.servlet.http.HttpServletResponse; + +@Configuration +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class WebSecurityConfig extends WebSecurityConfigurerAdapter { + + @Autowired + private UserServiceDetail userServiceDetail; + + @Override + @Bean + public AuthenticationManager authenticationManagerBean() throws Exception { + return super.authenticationManagerBean(); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + //CSRF:因为不再依赖于Cookie,所以你就不需要考虑对CSRF(跨站请求伪造)的防范 + http + .csrf().disable() + .exceptionHandling() + .authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED)) + .and() + .logout().disable() +// .addFilter(loginAuthenticationFilter) + .authorizeRequests() + .regexMatchers("/actuator.*").permitAll() + .antMatchers("/**").authenticated() + .and() + .httpBasic(); + + } + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth + .userDetailsService(userServiceDetail) + .passwordEncoder(new PasswordEncoder() { + @Override + public String encode(CharSequence rawPassword) { + return MD5Utils.encode(rawPassword.toString()); + } + + @Override + public boolean matches(CharSequence rawPassword, String encodedPassword) { + return encodedPassword.equals(MD5Utils.encode(rawPassword.toString())); + } + }); + } + + /** + * Configuration password encryption + * @return + */ + @Bean + PasswordEncoder passwordEncoder() { + return new PasswordEncoder() { + @Override + public String encode(CharSequence charSequence) { + return charSequence.toString(); + } + + @Override + public boolean matches(CharSequence charSequence, String s) { + return s.equals(charSequence.toString()); + } + }; + } + +} + + diff --git a/src/main/java/com/gk/hotwork/Config/ServiceContext/ApplicationContextUtil.java b/src/main/java/com/gk/hotwork/Config/ServiceContext/ApplicationContextUtil.java new file mode 100644 index 0000000..eb04fd7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/ServiceContext/ApplicationContextUtil.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.Config.ServiceContext; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * 配置类,解决定时任务无法注入service的问题 + */ +@Component +public class ApplicationContextUtil implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + ApplicationContextUtil.applicationContext = applicationContext; + + } + + + public static Object getBean(String beanName) { + return applicationContext.getBean(beanName); + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Swagger/SwaggerConfig.java b/src/main/java/com/gk/hotwork/Config/Swagger/SwaggerConfig.java new file mode 100644 index 0000000..0562e1c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Swagger/SwaggerConfig.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.Config.Swagger; + + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.Contact; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.*; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket docket() { + ParameterBuilder ticketPar = new ParameterBuilder(); + List<Parameter> pars = new ArrayList<Parameter>(); + ticketPar.name("Authorization").description("token") + .modelRef(new ModelRef("string")).parameterType("header") + .required(false).build(); //header中的ticket参数非必填,传空也可以 + pars.add(ticketPar.build()); + + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("com.gk.hotwork")) + .paths(PathSelectors.any()) + .build().globalOperationParameters(pars).apiInfo(new ApiInfoBuilder() + .description("特殊作业系统接口文档").contact(new Contact("李宇", "", "986321569@qq.com")) + .version("1.0").title("API文档").license("Apache2.0") + .licenseUrl("http://www.apache.org/licnesens/LINCENSE-2.0").build()); + } + +} diff --git a/src/main/java/com/gk/hotwork/Config/Swagger/WebMvcConfig.java b/src/main/java/com/gk/hotwork/Config/Swagger/WebMvcConfig.java new file mode 100644 index 0000000..17729e4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Swagger/WebMvcConfig.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Config.Swagger; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + + + +@Configuration +public class WebMvcConfig extends WebMvcConfigurerAdapter { + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("swagger-ui.html") + .addResourceLocations("classpath:/META-INF/resources/"); + + registry.addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/"); + } +} diff --git a/src/main/java/com/gk/hotwork/Config/ThreadExecutor/ExecutorConfig.java b/src/main/java/com/gk/hotwork/Config/ThreadExecutor/ExecutorConfig.java new file mode 100644 index 0000000..40ab7e5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/ThreadExecutor/ExecutorConfig.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Config.ThreadExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + + +import java.lang.reflect.Method; +import java.util.concurrent.Executor; + +import java.util.concurrent.ThreadPoolExecutor; + +@Configuration +@EnableAsync +public class ExecutorConfig implements AsyncConfigurer { + private Logger logger = LoggerFactory.getLogger(ExecutorConfig.class); + + /** + * 最小线程数(核心线程数) + */ + @Value("${threadPool.corePoolSize}") + private int corePoolSize; + /** + * 最大线程数 + */ + @Value("${threadPool.maxPoolSize}") + private int maxPoolSize; + /** + * 等待队列(队列最大长度) + */ + @Value("${threadPool.queueCapacity}") + private int queueCapacity; + + + @Bean(name = "SocketTaskExecutor") + public Executor asyncServiceExecutor() { + logger.info("start asyncServiceExecutor"); + + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + //配置核心线程数 + executor.setCorePoolSize(corePoolSize); + //配置最大线程数 + executor.setMaxPoolSize(maxPoolSize); + //配置队列大小 + executor.setQueueCapacity(queueCapacity); + //配置线程池中的线程的名称前缀 + executor.setThreadNamePrefix("async-service-"); + // rejection-policy:当pool已经达到max size的时候,如何处理新任务 + // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + + //执行初始化 + executor.initialize(); + return executor; + } + + /** + * 异步异常处理 + * + * @return + */ + @Override + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return new SpringAsyncExceptionHandler(); + } + + class SpringAsyncExceptionHandler implements AsyncUncaughtExceptionHandler { + @Override + public void handleUncaughtException(Throwable throwable, Method method, Object... obj) { + logger.error("Exception occurs in async method", throwable.getMessage()); + } + } + + +} diff --git a/src/main/java/com/gk/hotwork/Config/Upload/UploadConfig.java b/src/main/java/com/gk/hotwork/Config/Upload/UploadConfig.java new file mode 100644 index 0000000..f6c3bd5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/Upload/UploadConfig.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Config.Upload; + +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.web.multipart.MultipartResolver; +import org.springframework.web.multipart.commons.CommonsMultipartResolver; + +@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class}) +public class UploadConfig { + @Bean(name = "multipartResolver") + public MultipartResolver multipartResolver() { + CommonsMultipartResolver resolver = new CommonsMultipartResolver(); + resolver.setDefaultEncoding("UTF-8"); + resolver.setResolveLazily(true); + resolver.setMaxInMemorySize(40960); + //上传文件大小 + resolver.setMaxUploadSize(100 * 1024 * 1024); + return resolver; + } +} diff --git a/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketConfig.java b/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketConfig.java new file mode 100644 index 0000000..19db09a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketConfig.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Config.WebSocket; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@Configuration +public class WebSocketConfig { + +// @Bean +// public ServerEndpointExporter serverEndpointExporter(){ +// return new ServerEndpointExporter(); +// } +} diff --git a/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketServer.java b/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketServer.java new file mode 100644 index 0000000..977a171 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Config/WebSocket/WebSocketServer.java @@ -0,0 +1,122 @@ +package com.gk.hotwork.Config.WebSocket; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +@Component("websocket") +@ServerEndpoint("/push/{uid}") +@Slf4j +public class WebSocketServer { + + @PostConstruct + public void init() { + System.out.println("websocket 加载"); + } + + //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 + private static final AtomicInteger onlineCount = new AtomicInteger(0); + //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 + private static Map<Long,WebSocketServer> webSocketMap = new ConcurrentHashMap<>(); + + //与某个客户端的连接会话,需要通过它来给客户端发送数据 + private Session session; + + private Long uid; + + + + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session,@PathParam("uid") Long uid) { + this.session = session; + this.uid = uid; + if(webSocketMap.containsKey(uid)){ + webSocketMap.remove(uid); + webSocketMap.put(uid,this); + }else{ + webSocketMap.put(uid,this); + onlineCount.incrementAndGet(); + } + log.info("有新窗口开始监听:当前在线人数为" + onlineCount); + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose() { + if (webSocketMap.containsKey(uid)) { + webSocketMap.remove(uid); + onlineCount.decrementAndGet(); + } + log.info("有一连接关闭!当前在线人数为" + onlineCount); + } + + + + + /** + * 收到客户端消息后调用的方法 + * @param message 客户端发送过来的消息 + */ + @OnMessage + public void onMessage(String message) throws IOException { + log.info("来自客户端的消息:{}",message); + sendMessage("收到消息,消息内容:"+message); + } + + @OnError + public void onError(Session session, Throwable error) { + log.error("发生错误:{},Session ID: {}",error.getMessage(),session.getId()); + } + + public void sendMessage(String message) throws IOException { + synchronized(session) { + this.session.getBasicRemote().sendText(message); + } + } + + + /** + * @param uid + * @param message + */ + public static void sendMessage(@PathParam("uid") Long uid, String message) { + try { + if (webSocketMap.containsKey(uid)) webSocketMap.get(uid).sendMessage(message); + } catch (IOException e) { + log.error("发送消息出错:{}", e.getMessage()); + e.printStackTrace(); + } + } + + /** + * 群发消息 + * @param message + * @throws IOException + */ + public static void broadcast(String message) throws IOException { + + } + + + public Session getSession() { + return session; + } + + public void setSession(Session session) { + this.session = session; + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/AppFileController.java b/src/main/java/com/gk/hotwork/Controller/AppFileController.java new file mode 100644 index 0000000..9d4c662 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/AppFileController.java @@ -0,0 +1,210 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.*; +import com.gk.hotwork.Service.AppFileService; +import com.gk.hotwork.Service.HelpDocService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.HashMap; + + +@Api(tags = "APP版本信息接口") +@RestController +public class AppFileController extends BaseController { + @Value("${appPath}") + private String appPath; + @Value("${app}") + private String app; + @Value("${appUrl}") + private String appUrl; + @Autowired + AppFileService appFileService; + @Autowired + HelpDocService helpDocService; + + @GetMapping("/appFile") + @ApiOperation(value = "获取App文件数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "filetype",value = "文件类型"), + }) + public Msg getAppFileInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + @RequestParam(required = false) String filetype){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(filetype)){ + condition.put("filetype",filetype.trim()); + } + + pageInfo.setCondition(condition); + appFileService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @GetMapping("/newAppFile") + @ApiOperation(value = "获取最新App文件数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "filetype",value = "文件类型"), + }) + public Msg getNewAppFile(String filetype){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + AppFileInfo appFileInfo = appFileService.selectNew(filetype); + if (appFileInfo != null){ + msg.setResult(appFileInfo); + return msg; + }else { + msg.setCode("999"); + msg.setMessage("未找到文件"); + return msg; + } + } + + @ApiOperation(value = "添加文件",response = Msg.class) + @PostMapping("/addAppFile") + public Msg addAppFile(AppFileVo appFileVo) throws Exception { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + AppFileInfo appFileInfo = BeanUtils.copy(appFileVo, AppFileInfo.class); + + if (appFileVo.getFile() != null){ + String filePath = UploadUtil.uploadFile(appFileVo.getFile(),appPath); + appFileInfo.setFileurl(app + filePath); + } + appFileInfo.setCreated(new Date()); + appFileInfo.setUpdated(new Date()); + appFileService.save(appFileInfo); + return msg; + } + + @ApiOperation(value = "修改文件",response = Msg.class) + @PostMapping("/editAppFile") + public Msg editAppFile(AppFileVo appFileVo) throws Exception { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + AppFileInfo appFileInfo = BeanUtils.copy(appFileVo, AppFileInfo.class); + + if (appFileVo.getFile() != null){ + String filePath = UploadUtil.uploadFile(appFileVo.getFile(),appPath); + appFileInfo.setFileurl(app+filePath); + } + appFileInfo.setUpdated(new Date()); + appFileService.updateById(appFileInfo); + return msg; + } + + @ApiOperation(value = "删除文件",response = Msg.class) + @PostMapping("/delAppFile") + public Msg delAppFile(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + + AppFileInfo appFileInfo = appFileService.getById(id); + if (appFileInfo != null){ + appFileService.removeById(appFileInfo); + }else { + msg.setCode("999"); + msg.setMessage("未找到记录"); + } + return msg; + } + + @GetMapping("/helpDoc") + @ApiOperation(value = "获取帮助文档数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "name",value = "文件名称"), + }) + public Msg getHelpDocInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + String name){ + Msg msg = new Msg(true); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<>(4); + + if (StringUtils.isNotBlank(name)){ + condition.put("name",name.trim()); + } + + pageInfo.setCondition(condition); + helpDocService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @ApiOperation(value = "添加帮助文档",response = Msg.class) + @PostMapping("/addHelpDoc") + public Msg addHelpDoc(HelpDocVo helpDocVo) throws Exception { + Msg msg = new Msg(true); + HelpDocInfo helpDocInfo = BeanUtils.copy(helpDocVo, HelpDocInfo.class); + + if (helpDocVo.getFile() != null){ + String filePath = UploadUtil.uploadFile(helpDocVo.getFile(),appPath); + helpDocInfo.setFileurl(appUrl+filePath); + } + helpDocInfo.setCreated(new Date()); + helpDocInfo.setUpdated(new Date()); + helpDocService.save(helpDocInfo); + return msg; + } + + @ApiOperation(value = "修改帮助文档",response = Msg.class) + @PostMapping("/editHelpDoc") + public Msg editHelpDoc(HelpDocVo helpDocVo) throws Exception { + Msg msg = new Msg(true); + + HelpDocInfo helpDocInfo = BeanUtils.copy(helpDocVo, HelpDocInfo.class); + if (helpDocVo.getFile() != null){ + String filePath = UploadUtil.uploadFile(helpDocVo.getFile(),appPath); + helpDocInfo.setFileurl(appUrl+filePath); + } + helpDocInfo.setUpdated(new Date()); + + helpDocService.updateById(helpDocInfo); + return msg; + } + + @ApiOperation(value = "删除帮助文档(假删)",response = Msg.class) + @PostMapping("/delHelpDoc") + public Msg delHelpDoc(@RequestBody JSONObject jsonObject) { + Msg msg = new Msg(true); + Long id = jsonObject.getLong("id"); + HelpDocInfo helpDocInfo = helpDocService.getById(id); + if (helpDocInfo != null) { + helpDocInfo.setIsdel((byte) 1); + helpDocService.updateById(helpDocInfo); + } else { + msg.setCode("999"); + msg.setMessage("未找到记录"); + } + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/Base/BaseController.java b/src/main/java/com/gk/hotwork/Controller/Base/BaseController.java new file mode 100644 index 0000000..498a9ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/Base/BaseController.java @@ -0,0 +1,121 @@ +package com.gk.hotwork.Controller.Base; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Config.Oauth2.RedisKeyEnum; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.Msg; +import com.google.common.net.HttpHeaders; +import io.jsonwebtoken.Claims; +import org.apache.log4j.Logger; +import org.springframework.web.bind.annotation.ModelAttribute; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; + +public class BaseController { + + protected static final Logger logger = Logger.getLogger(BaseController.class); + protected HttpServletRequest request; + protected HttpServletResponse response; + protected HttpSession session; + + @Resource + IRedisService redisService; + + @ModelAttribute + public void setReqAndResp(HttpServletRequest request, HttpServletResponse response){ + this.request = request; + this.response = response; + this.session = request.getSession(); + } + + /** + * 输出信息到页面 + * @param msg:要输出的信息(可以是js脚本等) + */ + public void printOutMsg(String msg){ + try { + this.response.setCharacterEncoding("UTF-8"); + this.response.setContentType("text/html;charset=utf-8"); + PrintWriter out = null; + out = this.response.getWriter(); + out.print(msg); + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 获取请求完整路径 + * @param request + * @return + */ + public String getUrl(HttpServletRequest request){ + String url = request.getRequestURI(); + String params = ""; + if(request.getQueryString()!=null){ + params = request.getQueryString().toString(); + } + if(!"".equals(params)){ + url = url+"?"+params; + } + return url; + } + + /** + * @Description: 获取用户 + * @param + * @date 2021/3/23 14:36 + */ + public UserInfo getUser() { + String token = this.request.getHeader(HttpHeaders.AUTHORIZATION); + //解析token + + Claims claims = CommonUtil.parseJWT(token); + if (null != claims){ + String tokenKey = StrUtil.format(RedisKeyEnum.AUTH_TOKEN.getKey(), claims.getId()); + Object o = redisService.get(tokenKey); + if (o == null) { + return null; + }else{ + JSONObject jo = JSONObject.parseObject(o.toString()); + UserInfo user = new UserInfo(); + user.setId(jo.getLong("id")); + user.setUsername(jo.getString("username")); + user.setRealname(jo.getString("realname")); + user.setType(jo.getInteger("type")); + user.setCompanyid(jo.getLong("companyid")); + user.setDepartment(jo.getLong("department")); + user.setDepartmentname(jo.getString("departmentname")); + return user; + } + }else{ + return null; + } + + } + + public Msg success() { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + return msg; + } + + public Msg success(Object object) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + msg.setResult(object); + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/DictionaryController.java b/src/main/java/com/gk/hotwork/Controller/DictionaryController.java new file mode 100644 index 0000000..2139a1c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/DictionaryController.java @@ -0,0 +1,327 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Service.*; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +@Api(tags = "数据字典接口") +@RestController +public class DictionaryController { + @Autowired + DictionaryTypeService dictionaryTypeService; + @Autowired + DictionaryItemService dictionaryItemService; + + + @Autowired + UserService userService; + @Autowired + RoleService roleService; + @Autowired + UserRolesService userRolesService; + @Autowired + RolePermissionsService rolePermissionsService; + @Autowired + ExcelExportService excelExportService; + @Autowired + DistrictService districtService; + @Autowired + UserRolesService userRolesInfoService; + + @GetMapping("/dictionary-types") + @ApiOperation(value = "获取数据字典类型",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "name",value = "名称"), + }) + public Msg getDictionaryTypeInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String name){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(name)) { + condition.put("name", name.trim()); + } + + pageInfo.setCondition(condition); + dictionaryTypeService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @PostMapping("/adddictionary-types") + @ApiOperation(value = "添加数据字典类型",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "编码",required = true), + @ApiImplicitParam(name = "text",value = "名称",required = true), + @ApiImplicitParam(name = "description",value = "备注"), + @ApiImplicitParam(name = "operator",value = "操作人"), + }) + public Msg addDiactionaryTypeInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + String code = jsonObject.getString("code"); + String text = jsonObject.getString("text"); + String operator = jsonObject.getString("operator"); + DictionaryTypeInfo dictionaryExistCode = dictionaryTypeService.selctByCode(code); + if (dictionaryExistCode != null){ + msg.setCode("999"); + msg.setMessage("编码已存在"); + return msg; + } + DictionaryTypeInfo dictionaryExistText = dictionaryTypeService.selctByText(text); + if (dictionaryExistText != null){ + msg.setCode("999"); + msg.setMessage("名称已存在"); + return msg; + } + DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo(); + dictionaryTypeInfo.setCode(code); + dictionaryTypeInfo.setStatus((byte)1); + dictionaryTypeInfo.setText(text); + dictionaryTypeInfo.setCreatedby(operator); + dictionaryTypeInfo.setCreateddate(new Date()); + dictionaryTypeInfo.setModifiedby(operator); + dictionaryTypeInfo.setModifieddate(new Date()); + dictionaryTypeInfo.setDescription(jsonObject.getString("description")); + dictionaryTypeService.save(dictionaryTypeInfo); + return msg; + } + + @PostMapping("/putdictionary-types") + @ApiOperation(value = "修改字典类型",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id",required = true), + @ApiImplicitParam(name = "code",value = "编码",required = true), + @ApiImplicitParam(name = "text",value = "名称",required = true), + @ApiImplicitParam(name = "description",value = "备注"), + @ApiImplicitParam(name = "operator",value = "操作人"), + }) + public Msg putDiactionaryTypefo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + String code = jsonObject.getString("code"); + String text = jsonObject.getString("text"); + String operator = jsonObject.getString("operator"); + List<DictionaryTypeInfo> dictionaryTypes = dictionaryTypeService.selectExistInfo(id,code,null); + if (dictionaryTypes.size() > 0){ + msg.setCode("999"); + msg.setMessage("编码重复"); + return msg; + } + List<DictionaryTypeInfo> dictionaryTypeInfoList = dictionaryTypeService.selectExistInfo(id,null,text); + if (dictionaryTypeInfoList.size() > 0){ + msg.setCode("999"); + msg.setMessage("名称重复"); + return msg; + } + DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo(); + dictionaryTypeInfo.setId(jsonObject.getLong("id")); + dictionaryTypeInfo.setCode(code); + dictionaryTypeInfo.setText(text); + dictionaryTypeInfo.setModifiedby(operator); + dictionaryTypeInfo.setModifieddate(new Date()); + dictionaryTypeInfo.setDescription(jsonObject.getString("description")); + dictionaryTypeService.updateById(dictionaryTypeInfo); + return msg; + + } + + @PostMapping("/deldictionary-types") + @ApiOperation(value = "删除字典类型", notes = "删除字典类型", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "lastmodifiedby",value = "更新人"), + + }) + public Msg delDiactionaryTypeInfo(@ApiParam(value = "id,lastmodifiedby") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo(); + dictionaryTypeInfo.setId(jsonObject.getLong("id")); + dictionaryTypeInfo.setModifiedby(jsonObject.getString("lastmodifiedby")); + dictionaryTypeInfo.setModifieddate(new Date()); + dictionaryTypeInfo.setStatus((byte)0); + dictionaryTypeService.updateById(dictionaryTypeInfo); + return msg; + } + + @GetMapping("/dictionary-items") + @ApiOperation(value = "获取数据字典详情",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "name",value = "名称"), + @ApiImplicitParam(name = "dictionaryTypeId",value = "字典类型id"), + }) + public Msg getDiactionaryItemInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, + String name,Long dictionaryTypeId){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(name)) { + condition.put("name", name.trim()); + } + + if (dictionaryTypeId != null){ + condition.put("dictionaryTypeId",dictionaryTypeId); + } + + pageInfo.setCondition(condition); + dictionaryItemService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @GetMapping("/dictionaryAllItems") + @ApiOperation(value = "获取数据字典详情",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryType",value = "字典类型名称"), + }) + public Msg getDiactionaryItemInfo(String dictionaryType){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<DictionaryItemInfo> dictionaryItems = dictionaryItemService.selectByType(dictionaryType); + msg.setResult(dictionaryItems); + return msg; + } + + @PostMapping("/adddictionary-items") + @ApiOperation(value = "添加数据字典详情",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "text",value = "字典标签",required = true), + @ApiImplicitParam(name = "value",value = "字典值",required = true), + @ApiImplicitParam(name = "description",value = "备注"), + @ApiImplicitParam(name = "dictionaryTypeId",value = "类型id"), + @ApiImplicitParam(name = "operator",value = "操作人"), + @ApiImplicitParam(name = "sort",value = "序号"), + @ApiImplicitParam(name = "status",value = "状态"), + }) + public Msg addDiactionaryItemInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + String value = jsonObject.getString("value"); + String text = jsonObject.getString("text"); + String operator = jsonObject.getString("operator"); + Long typeid = jsonObject.getLong("dictionaryTypeId"); + if (typeid == null){ + msg.setCode("999"); + msg.setMessage("未选择字典类型"); + return msg; + } + DictionaryItemInfo dictionaryExistCode = dictionaryItemService.selctByText(text); + if (dictionaryExistCode != null){ + msg.setCode("999"); + msg.setMessage("字典标签已存在"); + return msg; + } + DictionaryItemInfo dictionaryExistText = dictionaryItemService.selctByValue(value); + if (dictionaryExistText != null){ + msg.setCode("999"); + msg.setMessage("字典值已存在"); + return msg; + } + DictionaryItemInfo dictionaryItemInfo = new DictionaryItemInfo(); + dictionaryItemInfo.setTypeid(typeid); + dictionaryItemInfo.setValue(value); + dictionaryItemInfo.setStatus(jsonObject.getByte("status")); + dictionaryItemInfo.setText(text); + dictionaryItemInfo.setSort(jsonObject.getInteger("sort")); + dictionaryItemInfo.setCreatedby(operator); + dictionaryItemInfo.setCreateddate(new Date()); + dictionaryItemInfo.setModifiedby(operator); + dictionaryItemInfo.setModifieddate(new Date()); + dictionaryItemInfo.setDescription(jsonObject.getString("description")); + dictionaryItemService.save(dictionaryItemInfo); + return msg; + } + + @PostMapping("/putdictionary-items") + @ApiOperation(value = "修改字典详情",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id",required = true), + @ApiImplicitParam(name = "text",value = "字典标签",required = true), + @ApiImplicitParam(name = "value",value = "字典值",required = true), + @ApiImplicitParam(name = "description",value = "备注"), + @ApiImplicitParam(name = "operator",value = "操作人"), + @ApiImplicitParam(name = "sort",value = "序号"), + @ApiImplicitParam(name = "status",value = "状态"), + }) + public Msg putDiactionaryItemfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + + String value = jsonObject.getString("value"); + String text = jsonObject.getString("text"); + String operator = jsonObject.getString("operator"); + + List<DictionaryTypeInfo> dictionaryTypes = dictionaryItemService.selectExistInfo(id,value,null); + if (dictionaryTypes.size() > 0){ + msg.setCode("999"); + msg.setMessage("字典值重复"); + return msg; + } + List<DictionaryTypeInfo> dictionaryTypeInfoList = dictionaryItemService.selectExistInfo(id,null,text); + if (dictionaryTypeInfoList.size() > 0){ + msg.setCode("999"); + msg.setMessage("字典标签重复"); + return msg; + } + + DictionaryItemInfo dictionaryItemInfo = new DictionaryItemInfo(); + dictionaryItemInfo.setId(id); + dictionaryItemInfo.setValue(value); + dictionaryItemInfo.setStatus(jsonObject.getByte("status")); + dictionaryItemInfo.setText(text); + dictionaryItemInfo.setSort(jsonObject.getInteger("sort")); + dictionaryItemInfo.setModifiedby(operator); + dictionaryItemInfo.setModifieddate(new Date()); + dictionaryItemInfo.setDescription(jsonObject.getString("description")); + dictionaryItemService.updateById(dictionaryItemInfo); + return msg; + } + + @PostMapping("/deldictionary-items") + @ApiOperation(value = "删除字典详情", notes = "删除字典详情", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "lastmodifiedby",value = "更新人"), + + }) + public Msg delDiactionaryItemInfo(@ApiParam(value = "id,lastmodifiedby") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + DictionaryItemInfo dictionaryTypeInfo = new DictionaryItemInfo(); + dictionaryTypeInfo.setId(jsonObject.getLong("id")); + dictionaryItemService.removeById(dictionaryTypeInfo); + return msg; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/ElementManagementController.java b/src/main/java/com/gk/hotwork/Controller/ElementManagementController.java new file mode 100644 index 0000000..17937c9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/ElementManagementController.java @@ -0,0 +1,101 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.ElementManagement; +import com.gk.hotwork.Domain.ElementTree; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.ElementManagementService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +@Api(tags = "安全生产标准化_要素管理") +@RestController +@RequestMapping("/elementManagement") +public class ElementManagementController extends BaseController { + + @Autowired + private ElementManagementService elementManagementService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.name",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = elementManagementService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("获取父要素列表") + @PostMapping("/getParentElement") + public Msg getParentElement() { + List<ElementManagement> list = elementManagementService.getParentElement(); + return success(list); + } + + @ApiOperation("获取要素树") + @PostMapping("/getElementTree") + public Msg getElementTree() { + List<ElementTree> elementTreeList = elementManagementService.getElementTree(); + return success(elementTreeList); + } + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "要素名称"), + @ApiImplicitParam(name = "type",value = "要素级别"), + @ApiImplicitParam(name = "parentId",value = "父级要素"), + @ApiImplicitParam(name = "remark",value = "要素备注"), + + }) + public Msg add(@RequestBody ElementManagement param) { + elementManagementService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "name",value = "应急预案名称"), + @ApiImplicitParam(name = "fileType",value = "应急预案文件类型"), + @ApiImplicitParam(name = "fileList",value = "应急预案文件"), + @ApiImplicitParam(name = "remark",value = "应急预案备注"), + }) + public Msg mod(@RequestBody ElementManagement param) { + elementManagementService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + elementManagementService.delOne(id, getUser()); + return success(); + } + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/EmergencyPlanController.java b/src/main/java/com/gk/hotwork/Controller/EmergencyPlanController.java new file mode 100644 index 0000000..3f5e001 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/EmergencyPlanController.java @@ -0,0 +1,158 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.EmergencyPlan; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.UploadUtil; +import com.gk.hotwork.Service.EmergencyPlanService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Map; + + +@Api(tags = "应急预案") +@RestController +@RequestMapping("/emergencyPlan") +public class EmergencyPlanController extends BaseController { + + @Autowired + private EmergencyPlanService emergencyPlanService; + + @Value("${emergencyPlanPath}") + private String emergencyPlanPath; + @Value("${emergencyPlanUrl}") + private String emergencyPlanUrl; + @Value("${emergencyPlan}") + private String emergencyPlan; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.name",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = emergencyPlanService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/图片+文件上传") + @PostMapping("/upload") + @ApiImplicitParams({ + @ApiImplicitParam(name = "file",value = "文件"), + }) + public Msg upload(@RequestParam(required = false) MultipartFile file) throws Exception { + String name= UploadUtil.uploadFile(file,emergencyPlanPath); + String url= emergencyPlan+name; + Map<String,String> map=new HashMap<>(); + map.put("fileName",name); + map.put("fileUrl",url); + return success(map); + } + + @ApiOperation("/下载") + @PostMapping("/download") + @ApiImplicitParams({ + @ApiImplicitParam(name = "path",value = "文件路径"), + }) + public Msg upload(HttpServletRequest request, HttpServletResponse response, String path) throws Exception { + try { + response.setContentType("text/html;charset=UTF-8"); + request.setCharacterEncoding("UTF-8"); + + BufferedInputStream bis = null; + BufferedOutputStream bos = null; + File file = new File(emergencyPlanPath,path); + String fileName = file.getName(); + long fileLength = file.length(); + + response.setContentType("application/octet-stream"); + + String header = request.getHeader("User-Agent").toUpperCase(); + if (header.contains("MSIE") || header.contains("TRIDENT") || header.contains("EDGE")) { + fileName = URLEncoder.encode(fileName, "utf-8"); + fileName = fileName.replace("+", "%20"); //IE下载文件名空格变+号问题 + } else { + fileName = new String(fileName.getBytes(), "ISO8859-1"); + } + + response.setHeader("Content-disposition", "attachment; filename=\"" + fileName + "\""); + response.setHeader("Content-Length", String.valueOf(fileLength)); + + bis = new BufferedInputStream(new FileInputStream(file)); + bos = new BufferedOutputStream(response.getOutputStream()); + + byte[] buff = new byte[2048]; + int bytesRead; + + while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { + bos.write(buff, 0, bytesRead); + } + bis.close(); + bos.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return success(); + } + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "应急预案名称"), + @ApiImplicitParam(name = "fileType",value = "应急预案文件类型"), + @ApiImplicitParam(name = "fileList",value = "应急预案文件"), + @ApiImplicitParam(name = "remark",value = "应急预案备注"), + + }) + public Msg add(@RequestBody EmergencyPlan param) { + emergencyPlanService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "name",value = "应急预案名称"), + @ApiImplicitParam(name = "fileType",value = "应急预案文件类型"), + @ApiImplicitParam(name = "fileList",value = "应急预案文件"), + @ApiImplicitParam(name = "remark",value = "应急预案备注"), + }) + public Msg mod(@RequestBody EmergencyPlan param) { + emergencyPlanService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + emergencyPlanService.delOne(id, getUser()); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/EquipmentController.java b/src/main/java/com/gk/hotwork/Controller/EquipmentController.java new file mode 100644 index 0000000..37ebee0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/EquipmentController.java @@ -0,0 +1,270 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.GasWarnInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Service.EquipmentService; +import com.gk.hotwork.Service.GasWarnService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.HashMap; + +@Api(tags = "设备数据接口") +@RestController +public class EquipmentController extends BaseController { + @Autowired + EquipmentService equipmentService; + @Autowired + GasWarnService gasWarnService; + + @GetMapping("/gasWarn") + @ApiOperation(value = "获取气体阈值信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "gastype",value = "气体类型"), + @ApiImplicitParam(name = "warntype",value = "报警类型") + }) + public Msg getGasWarn(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + String gastype, String warntype){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(gastype)) { + condition.put("gastype", gastype.trim()); + } + + if (StringUtils.isNotBlank(warntype)) { + condition.put("warntype", warntype.trim()); + } + + pageInfo.setCondition(condition); + gasWarnService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @PostMapping("/addGasWarn") + @ApiOperation(value = "添加气体阈值信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "gastype",value = "气体类型"), + @ApiImplicitParam(name = "warntype",value = "报警类型"), + @ApiImplicitParam(name = "max",value = "最大值"), + @ApiImplicitParam(name = "min",value = "最小值"), + @ApiImplicitParam(name = "gasunit",value = "气体单位"), + }) + public Msg addGasWarn(@RequestBody GasWarnInfo gasWarnInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (StringUtils.isBlank(gasWarnInfo.getGastype())||StringUtils.isBlank(gasWarnInfo.getWarntype())){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("气体类型、报警类型不能为空"); + return msg; + } + GasWarnInfo gasWarnInfoExist = gasWarnService.selectExistByType(null,gasWarnInfo.getWarntype(),gasWarnInfo.getGastype()); + if (gasWarnInfoExist != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("存在相同气体类型、报警类型的配置"); + return msg; + } + gasWarnInfo.setUpdateby(getUser().getRealname()); + gasWarnInfo.setUpdatetime(new Date()); + gasWarnService.save(gasWarnInfo); + return msg; + } + + @PostMapping("/putGasWarn") + @ApiOperation(value = "修改气体阈值信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "gastype",value = "气体类型"), + @ApiImplicitParam(name = "warntype",value = "报警类型"), + @ApiImplicitParam(name = "max",value = "最大值"), + @ApiImplicitParam(name = "min",value = "最小值"), + @ApiImplicitParam(name = "gasunit",value = "气体单位"), + }) + public Msg putGasWarn(@RequestBody GasWarnInfo gasWarnInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (StringUtils.isBlank(gasWarnInfo.getGastype())||StringUtils.isBlank(gasWarnInfo.getWarntype())){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("气体类型、报警类型不能为空"); + return msg; + } + GasWarnInfo gasWarnInfoExist = gasWarnService.selectExistByType(gasWarnInfo.getId(),gasWarnInfo.getWarntype(),gasWarnInfo.getGastype()); + if (gasWarnInfoExist != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("存在相同气体类型、报警类型的配置"); + return msg; + } + gasWarnInfo.setUpdateby(getUser().getRealname()); + gasWarnInfo.setUpdatetime(new Date()); + gasWarnService.updateById(gasWarnInfo); + return msg; + } + + @PostMapping("/delGasWarn") + @ApiOperation(value = "删除气体阈值信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg delGasWarn(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + + if (id == null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("id不能为空"); + return msg; + } + gasWarnService.removeById(id); + return msg; + } + + @GetMapping("/equipment") + @ApiOperation(value = "获取设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "name",value = "设备名称"), + @ApiImplicitParam(name = "number",value = "设备条码") + }) + public Msg equipmentService(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + String name, String number){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(name)) { + condition.put("name", name.trim()); + } + + if (StringUtils.isNotBlank(number)) { + condition.put("number", number.trim()); + } + + pageInfo.setCondition(condition); + equipmentService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @PostMapping("/addEquipment") + @ApiOperation(value = "添加设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "设备名称"), + @ApiImplicitParam(name = "number",value = "设备条码"), + @ApiImplicitParam(name = "isphoto",value = "是否有摄像头 1是 0否"), + @ApiImplicitParam(name = "photoname",value = "摄像头名称"), + @ApiImplicitParam(name = "photoaddress",value = "摄像头地址"), + }) + public Msg addEquipment(@RequestBody EquipmentInfo equipmentInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (StringUtils.isBlank(equipmentInfo.getName())||StringUtils.isBlank(equipmentInfo.getNumber())){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("设备名称、设备条码不能为空"); + return msg; + } + EquipmentInfo equipmentInfoExist = equipmentService.selectExistByNumber(null,equipmentInfo.getNumber()); + if (equipmentInfoExist != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("存在相同设备条码"); + return msg; + } + if (equipmentInfo.getIsphoto() == 1 && (StringUtils.isBlank(equipmentInfo.getPhotoname()) + || StringUtils.isBlank(equipmentInfo.getPhotoaddress()))){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("摄像头名称、地址不能为空"); + return msg; + } + equipmentInfo.setUpdateby(getUser().getRealname()); + equipmentInfo.setUpdatetime(new Date()); + equipmentService.save(equipmentInfo); + return msg; + } + + @PostMapping("/putEquipment") + @ApiOperation(value = "修改设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "name",value = "设备名称"), + @ApiImplicitParam(name = "number",value = "设备条码"), + @ApiImplicitParam(name = "isphoto",value = "是否有摄像头 1是 0否"), + @ApiImplicitParam(name = "photoname",value = "摄像头名称"), + @ApiImplicitParam(name = "photoaddress",value = "摄像头地址"), + }) + public Msg putEquipment(@RequestBody EquipmentInfo equipmentInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (StringUtils.isBlank(equipmentInfo.getName())||StringUtils.isBlank(equipmentInfo.getNumber())){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("设备名称、设备条码不能为空"); + return msg; + } + EquipmentInfo equipmentInfoExist = equipmentService.selectExistByNumber(equipmentInfo.getId(),equipmentInfo.getNumber()); + if (equipmentInfoExist != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("存在相同设备条码"); + return msg; + } + if (equipmentInfo.getIsphoto() == 1 && (StringUtils.isBlank(equipmentInfo.getPhotoname()) + || StringUtils.isBlank(equipmentInfo.getPhotoaddress()))){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("摄像头名称、地址不能为空"); + return msg; + } + equipmentInfo.setUpdateby(getUser().getRealname()); + equipmentInfo.setUpdatetime(new Date()); + equipmentService.updateById(equipmentInfo); + return msg; + } + + @PostMapping("/delEquipment") + @ApiOperation(value = "删除设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg delEquipment(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + + if (id == null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("id不能为空"); + return msg; + } + equipmentService.removeById(id); + return msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/FourColorMapController.java b/src/main/java/com/gk/hotwork/Controller/FourColorMapController.java new file mode 100644 index 0000000..01f2166 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/FourColorMapController.java @@ -0,0 +1,126 @@ +package com.gk.hotwork.Controller; + +import cn.hutool.json.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.FourColorMap2; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.dto.FourColorMapDto; +import com.gk.hotwork.Service.FourColorMap2Service; +import com.gk.hotwork.Service.FourColorMapService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@Api(tags = "四色图") +@RestController +@RequestMapping("fourColorMap") +public class FourColorMapController extends BaseController { + + @Autowired + private FourColorMapService fourColorMapService; + @Autowired + private FourColorMap2Service fourColorMap2Service; + + + @ApiOperation("新增四色图") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "四色图ID"), + @ApiImplicitParam(name = "etype",value = "企业类型 1 - 60万吨 , 2 - 130万吨"), + @ApiImplicitParam(name = "type",value = "四色图类型"), + @ApiImplicitParam(name = "name",value = "四色图名称"), + @ApiImplicitParam(name = "shapeType",value = "四色图形状"), + @ApiImplicitParam(name = "text",value = "四色图样式 - 显示文字"), + @ApiImplicitParam(name = "clampToGround",value = "四色图样式 - clampToGround"), + @ApiImplicitParam(name = "color",value = "四色图样式 - 颜色"), + @ApiImplicitParam(name = "geoType",value = "绘图形状"), + @ApiImplicitParam(name = "locations",value = "坐标数组数组") + }) + @RequestMapping(value = "/add",method = RequestMethod.POST) + public Msg insertOneMap(@RequestBody FourColorMapDto mapDto){ + Msg msg = new Msg(); + String result = fourColorMapService.insertOneMapPoint(mapDto); + if(result == null){ + msg.setCode("200"); + }else { + msg.setCode("400"); + msg.setMessage(result); + } + return msg; + } + + @RequestMapping(value = "/add2",method = RequestMethod.POST) + public Msg insertOneMap2(@RequestBody com.alibaba.fastjson.JSONObject mapJson){ + fourColorMap2Service.addOne(mapJson,getUser()); + return success(); + } + + @RequestMapping(value = "/get/list2",method = RequestMethod.POST) + public Msg getList2(Integer eType){ + List<FourColorMap2> list = fourColorMap2Service.getList2(eType); + return success(list); + } + + + @RequestMapping(value = "/del2", method = RequestMethod.POST) + public Msg del2(@RequestBody JSONObject delBody){ + Long id = delBody.getLong("id"); + fourColorMap2Service.delOne(id); + return success(); + } + + @ApiOperation("删除四色图") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "四色图ID") + }) + @RequestMapping(value = "/del",method = RequestMethod.GET) + public Msg deleteMap(@RequestParam String id){ + Msg msg = new Msg(); + if(fourColorMapService.deleteMap(id) == true){ + msg.setCode("200"); + }else { + msg.setCode("400"); + msg.setMessage("删除失败"); + } + return msg; + } + + @ApiOperation("ID查找四色图") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "四色图ID") + }) + @RequestMapping(value = "/get/id",method = RequestMethod.GET) + public Msg findById(@RequestParam String id){ + Msg msg = new Msg(); + JSONObject mapJson = fourColorMapService.getOnePointJsonById(id); + if(mapJson!=null && !mapJson.isEmpty()){ + msg.setCode("200"); + msg.setResult(mapJson); + }else { + msg.setCode("201"); + msg.setMessage("未找到数据"); + } + return msg; + } + + + @ApiOperation("查找全部四色图") + @RequestMapping(value = "/get/list",method = RequestMethod.GET) + public Msg findList(@RequestParam int etype){ + Msg msg = new Msg(); + List<JSONObject> mapDtoList = fourColorMapService.getPointListJson(etype); + if(mapDtoList!=null && mapDtoList.size() > 0){ + msg.setCode("200"); + msg.setResult(mapDtoList); + }else { + msg.setCode("201"); + msg.setMessage("未找到数据"); + } + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/HiddenDangerController.java b/src/main/java/com/gk/hotwork/Controller/HiddenDangerController.java new file mode 100644 index 0000000..e4668a5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/HiddenDangerController.java @@ -0,0 +1,338 @@ +package com.gk.hotwork.Controller; + + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.HiddenDangerApplyStatus; +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; +import com.gk.hotwork.Domain.Enum.HiddenDangerReportSource; +import com.gk.hotwork.Domain.Enum.SourceType; +import com.gk.hotwork.Domain.HiddenDanger; +import com.gk.hotwork.Domain.Log.HiddenDangerLogAnno; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.HiddenDangerAppVo; +import com.gk.hotwork.Domain.Vo.HiddenDangerVo; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.Service.CompanyService; +import com.gk.hotwork.Service.HiddenDangerService; +import com.gk.hotwork.Service.TaskService; +import com.gk.hotwork.Service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Api(tags = "隐患") +@RestController +@RequestMapping("hiddenDanger") +public class HiddenDangerController extends BaseController { + + + @Autowired + private HiddenDangerService hiddenDangerService; + @Autowired + private TaskService taskService; + @Autowired + private UserService userService; + @Autowired + private CompanyService companyService; + + /** + * @Description: 通用查询 + * @date 2021/10/9 15:47 + */ + @ApiOperation(value = "查询分页",notes = "上报页") + @ResponseBody + @PostMapping(value = "/reportPage") + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "隐患等级"), + @ApiImplicitParam(name = "status",value = "应还状态"), + @ApiImplicitParam(name = "rectifymeasure",value = "整改措施"), + @ApiImplicitParam(name = "rectifier",value = "整改人"), + @ApiImplicitParam(name = "rectifierid",value = "整改人id"), + @ApiImplicitParam(name = "note",value = "上报说明"), + @ApiImplicitParam(name = "files",value = "文件"), + }) + public Object hiddenDangerReportPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = hiddenDangerService.selectReportPages(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + + @ApiOperation(value = "查询分页",notes = "整改页") + @ResponseBody + @PostMapping("/rectifyPage") + public Object hiddenDangerRectifyPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = hiddenDangerService.selectRectifyPages(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation(value = "查询分页",notes = "验收页") + @ResponseBody + @PostMapping("/acceptPage") + public Object hiddenDangerAcceptPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = hiddenDangerService.selectAcceptPages(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + + @ApiOperation(value = "整改统计") + @ResponseBody + @PostMapping("/rectifyStatisticsPage") + public Object hiddenDangerRectifyStatistics(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + PageInfoExtension<Map> page = hiddenDangerService.selectRectifyStatisticsPages(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + /** + * @Description: 最近一周的作业 + * @date 2021/10/11 15:07 + */ + @ApiOperation(value = "查询最近的作业") + @ResponseBody + @PostMapping("/taskInfo") + public Object hiddenDangerPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = taskService.selectTaskInPeriod(new Page<>(pageIndex,pageSize),filterObject.getFilter(),getUser()); + return success(page); + } + + /** + * @Description: web + */ + + + @ApiOperation(value = "web新增隐患") + @ResponseBody + @PostMapping("/report") + @HiddenDangerLogAnno(operation = "上报", detail = "上报隐患") + @ApiImplicitParams({ + @ApiImplicitParam(name = "level",value = "隐患等级"), + @ApiImplicitParam(name = "rectifydeadline",value = "整改截止时间(yyyy-MM-dd HH:mm)"), + @ApiImplicitParam(name = "rectifymeasure",value = "整改措施"), + @ApiImplicitParam(name = "rectifier",value = "整改人"), + @ApiImplicitParam(name = "rectifierid",value = "整改人id"), + @ApiImplicitParam(name = "note",value = "上报说明"), + @ApiImplicitParam(name = "files",value = "文件"), + }) + public Object hiddenDangerReport(HiddenDangerVo hiddenDangerVo) { + HiddenDanger hiddenDanger = hiddenDangerService.addReport(hiddenDangerVo, getUser(), HiddenDangerReportSource.NORMAL); + return success(hiddenDanger); + } + + + + @ApiOperation(value = "web隐患整改") + @ResponseBody + @PostMapping("/rectify") + @HiddenDangerLogAnno(operation = "整改", detail = "整改隐患") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "note",value = "整改说明"), + @ApiImplicitParam(name = "files",value = "文件"), + }) + public Object hiddenDangerRectify(HiddenDangerVo hiddenDangerVo) { + HiddenDanger hiddenDanger = hiddenDangerService.hiddenDangerRectify(hiddenDangerVo); + return success(hiddenDanger); + } + + + + @ApiOperation(value = "web/app验收整改") + @ResponseBody + @PostMapping("/accept") + @HiddenDangerLogAnno(operation = "验收", detail = "验收整改") + @ApiImplicitParam(name = "id",value = "id") + public Object hiddenDangerAccept(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + HiddenDanger hiddenDanger = hiddenDangerService.acceptHiddenDanger(id, getUser()); + return success(hiddenDanger); + } + + + + @ApiOperation(value = "web/app驳回整改") + @ResponseBody + @PostMapping("/reject") + @HiddenDangerLogAnno(operation = "驳回整改", detail = "驳回整改") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "rejectnote",value = "驳回说明"), + }) + public Object hiddenDangerReject(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + String rejectNote = jsonObject.getString("rejectnote"); + HiddenDanger hiddenDanger = hiddenDangerService.rejectHiddenDanger(id, rejectNote,getUser()); + return success(hiddenDanger); + } + + + + + /** + * @Description: app + */ + + + @ApiOperation(value = "上传图片",notes = "上传图片") + @PostMapping("/uploadPic") + @ResponseBody + public Msg uploadPic(StandardMultipartHttpServletRequest req){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + MultiValueMap<String, MultipartFile> multipartFiles = req.getMultiFileMap(); + MultipartFile picFile = multipartFiles.get("files").get(0); + if (null == picFile){ + msg.setCode("404"); + msg.setMessage("上传文件为空"); + }else { + try { + String picmame = UploadUtil.uploadFile(picFile, Properties.hiddenDangerPath); + msg.setResult(Properties.hiddenDanger+picmame); + }catch (Exception e){ + e.printStackTrace(); + msg.setCode("500"); + msg.setMessage("上传失败"); + } + } + return msg; + } + + + @ApiOperation(value = "app隐患上报") + @ResponseBody + @PostMapping("/app/report") + @HiddenDangerLogAnno(operation = "上报", detail = "上报隐患",source = SourceType.APP) + @ApiImplicitParams({ + @ApiImplicitParam(name = "level",value = "隐患等级"), + @ApiImplicitParam(name = "rectifydeadline",value = "整改截止时间(yyyy-MM-dd HH:mm)"), + @ApiImplicitParam(name = "rectifymeasure",value = "整改措施"), + @ApiImplicitParam(name = "rectifier",value = "整改人"), + @ApiImplicitParam(name = "rectifierid",value = "整改人id"), + @ApiImplicitParam(name = "note",value = "上报说明"), + @ApiImplicitParam(name = "urls",value = "文件"), + }) + public Object hiddenDangerAppReport(@RequestBody HiddenDangerAppVo hiddenDangerAppVo) { + HiddenDanger hiddenDanger = hiddenDangerService.addReportByApp(hiddenDangerAppVo, getUser()); + return success(hiddenDanger); + } + + + + @ApiOperation(value = "app隐患整改") + @ResponseBody + @PostMapping("/app/rectify") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "note",value = "整改说明"), + @ApiImplicitParam(name = "files",value = "文件"), + }) + @HiddenDangerLogAnno(operation = "整改", detail = "整改隐患",source = SourceType.APP) + public Object hiddenDangerAppRectify(@RequestBody HiddenDangerAppVo hiddenDangerAppVo) { + HiddenDanger hiddenDanger = hiddenDangerService.rectifyHiddenDangerByApp(hiddenDangerAppVo, getUser()); + return success(hiddenDanger); + } + + + @GetMapping("/statistics") + @ApiOperation(value = "统计隐患数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间"), + @ApiImplicitParam(name = "company",value = "单位"), + }) + public Msg getStatisticsInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String company, String starttime,String endtime){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<>(); + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime.trim()); + } + + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime.trim()); + } + + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + + if (!companyService.isMain(userInfo.getCompany())){ + condition.put("company", userInfo.getCompany()); + } + + pageInfo.setCondition(condition); + hiddenDangerService.selectStatisticsData(pageInfo); + return success(pageInfo); + } + + @GetMapping("/info") + @ApiOperation(value = "隐患数据详情",response = Msg.class) + public Msg getHiddenDangerData(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String company, String starttime,String endtime){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<>(); + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime.trim()); + } + + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime.trim()); + } + + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + + if (!companyService.isMain(userInfo.getCompany())){ + condition.put("company", userInfo.getCompany()); + } + + pageInfo.setCondition(condition); + hiddenDangerService.selectDataGrid(pageInfo); + return success(pageInfo); + } + + + @GetMapping("/app/analysis") + public Msg getAnalysis() { + Map result = hiddenDangerService.getAppAnalysis(getUser()); + return success(result); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/LoginController.java b/src/main/java/com/gk/hotwork/Controller/LoginController.java new file mode 100644 index 0000000..bb66f16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/LoginController.java @@ -0,0 +1,226 @@ +package com.gk.hotwork.Controller; + +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Config.Oauth2.OauthRole; +import com.gk.hotwork.Config.Oauth2.RedisKeyEnum; +import com.gk.hotwork.Domain.AuthorizationInfo; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.UserFace; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.ExamScoreVo; +import com.gk.hotwork.Domain.Vo.UserVo; +import com.gk.hotwork.Service.*; +import com.google.common.net.HttpHeaders; +import io.jsonwebtoken.Claims; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Api(tags = "登录登出接口") +@RequestMapping("/auth") +@RestController +public class LoginController { + @Autowired + IRedisService redisService; + @Autowired + UserService userService; + @Autowired + AuthorizationService authorizationService; + @Autowired + RoleService roleService; + @Autowired + ExamScoreService examScoreService; + @Autowired + UserFaceService userFaceService; + @Value("${host}") + private String host; + @Value("${workname}") + private String workname; + /** + * login produces = "application/json" + * + * @param jsonParam {"username":"用户名","password":"密码"} + * @return User + */ + @PostMapping("/login") + @ApiOperation(value = "管理端登录授权", notes = "登录授权接口,获取token") + public Msg login(@ApiParam(value = "username,password") @RequestBody JSONObject jsonParam) { + String username = jsonParam.getString("username"); + String password = jsonParam.getString("password"); + + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + try { + //query user + UserVo user = userService.selectUserVoByName(workname,username); + if (null == user) { + msg.setCode("100"); + msg.setMessage("用户不存在"); + return msg; + } + + //Call login interface + String rs = HttpRequest.post( host + "/oauth/token") + .setConnectionTimeout(10000) + .setReadTimeout(10000) + .header("Authorization", "Basic dWFhLXNlcnZpY2U6MTIzNDU2") + .form(Dict.create() + .set("username", username) + .set("password", password) + .set("grant_type", "password") + .set("auth_type", "") + ).execute().body(); + Map map = JSON.parseObject(rs, Map.class); + Object access_token = map.get("access_token"); + //Verify that the access_token is empty + if (ObjectUtil.isNull(access_token)) { + msg.setCode("103"); + msg.setMessage("密码不正确"); + return msg; + } + user.setToken("Bearer "+access_token); + //add redis + String token_key = StrUtil.format(RedisKeyEnum.AUTH_TOKEN.getKey(), map.get("jti")); + redisService.set(token_key, user, 60L*60L*18L); + + user.setTokenexpired(60L*60L*18L); + /** 登录成功刷新用户 */ + List<OauthRole> roleByUser = roleService.selectOauthRoleByUser(1); + if (null != user.getType()&& user.getType() == 1){ + OauthRole oauthRole = new OauthRole("","超级管理员","super_admin",""); + roleByUser.add(oauthRole); + user.setRoles(roleByUser); + }else { + roleByUser = roleService.selectOauthRoleByUser(user.getId().intValue()); + user.setRoles(roleByUser); + } + + List<ExamScoreVo> exam = examScoreService.selectByAll(user.getUsername()); + user.setExam(exam); + user.setPassword(null); + UserFace userFace = userFaceService.selectByUserId(user.getId()); + if (userFace != null) + user.setCode(userFace.getCode()); + msg.setResult(user); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("102"); + msg.setMessage("登录失败请稍后重试"); + } + return msg; + } + + + @GetMapping("/verify") + @ApiOperation(value = "登录验证", notes = "登录验证:flag【true 成功】,【false 失败】", response = Msg.class) + public Msg verifyLogin(@ApiIgnore HttpServletRequest request) { + Msg msg = new Msg(); + msg.setCode("200"); + UserVo userVo = new UserVo(); + String token = request.getHeader(HttpHeaders.AUTHORIZATION); + //解析token + Claims claims = CommonUtil.parseJWT(token); + if (null != claims){ + String tokenKey = StrUtil.format(RedisKeyEnum.AUTH_TOKEN.getKey(), claims.getId()); + Object userInfo = redisService.get(tokenKey); + if (null != userInfo){ + Map map = JSON.parseObject(userInfo.toString(), Map.class); + + userVo = userService.selectUserVoByName(workname,map.get("username").toString()); + if (null == userVo) { + msg.setCode("100"); + msg.setMessage("用户不存在"); + return msg; + } + + /** 登录成功刷新用户 */ + List<OauthRole> roleByUser = roleService.selectOauthRoleByUser(1); + if (null != userVo.getType()&& userVo.getType() == 1){ + OauthRole oauthRole = new OauthRole("","超级管理员","super_admin",""); + roleByUser.add(oauthRole); + userVo.setRoles(roleByUser); + }else { + roleByUser = roleService.selectOauthRoleByUser(userVo.getId().intValue()); + userVo.setRoles(roleByUser); + } + List<ExamScoreVo> exam = examScoreService.selectByAll(userVo.getUsername()); + userVo.setExam(exam); + + userVo.setToken(map.get("token").toString()); + userVo.setTokenexpired(60L*60L*18L); + userVo.setPassword(null); + //更新登录超时时间 + redisService.set(tokenKey, userInfo, 60L*60L*18L); + }else { + msg.setCode("100"); + msg.setMessage("登录失效,请重新登录"); + return msg; + } + } + msg.setResult(userVo); + return msg; + } + + /** + * logout + * + * @return + */ + @PostMapping("/logout") + @ApiOperation(value = "退出登录", notes = "退出登录接口", produces = "application/json", response = Msg.class) + public Msg logout(@ApiIgnore HttpServletRequest request) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + /** 解析token */ + String header = request.getHeader(HttpHeaders.AUTHORIZATION); + if (header != null && !header.equals("undefined")) { + Claims claims = CommonUtil.parseJWT(header); + Optional.ofNullable(claims).ifPresent(cl -> { + String token_key = "auth:token:" + cl.getId(); + redisService.remove(token_key); + }); + } + return msg; + } + + @PostMapping("/user-face") + Msg userInfo(@RequestBody JSONObject userInfo) { + Msg msg = new Msg(); + msg.setCode("200"); + try { + Long userId = userInfo.getLong("userId"); + String code = userInfo.getString("code"); + userFaceService.copeWith(userId, code); + } catch (BusinessException e) { + msg.setCode("102"); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + msg.setCode("102"); + msg.setMessage("操作失败"); + } + return msg; + + + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/MajorEquipmentAlarmController.java b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentAlarmController.java new file mode 100644 index 0000000..f63be5a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentAlarmController.java @@ -0,0 +1,85 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.MajorEquipmentAlarm; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.MajorEquipmentAlarmService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Api(tags = "重大危险源检测_设备报警信息") +@RestController +@RequestMapping("/majorEquipmentAlarm") +public class MajorEquipmentAlarmController extends BaseController { + + @Autowired + private MajorEquipmentAlarmService majorEquipmentAlarmService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.equipmentName",value = "{}"), + @ApiImplicitParam(name = "filter.status",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = majorEquipmentAlarmService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "equipmentId",value = "设备id"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "alarmTime",value = "报警时间"), + @ApiImplicitParam(name = "alarmInfo",value = "报警信息"), + @ApiImplicitParam(name = "remark",value = "备注"), + }) + public Msg add(@RequestBody MajorEquipmentAlarm param) { + majorEquipmentAlarmService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "equipmentId",value = "设备id"), + @ApiImplicitParam(name = "equipmentId",value = "设备id"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "alarmTime",value = "报警时间"), + @ApiImplicitParam(name = "alarmInfo",value = "报警信息"), + @ApiImplicitParam(name = "remark",value = "备注"), + }) + public Msg mod(@RequestBody MajorEquipmentAlarm param) { + majorEquipmentAlarmService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + majorEquipmentAlarmService.delOne(id, getUser()); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/MajorEquipmentController.java b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentController.java new file mode 100644 index 0000000..d93fd72 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentController.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.MajorEquipment; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.MajorEquipmentService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +@Api(tags = "重大危险源检测_生产设备管理") +@RestController +@RequestMapping("/majorEquipment") +public class MajorEquipmentController extends BaseController { + + @Autowired + private MajorEquipmentService majorEquipmentService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.name",value = "{}"), + @ApiImplicitParam(name = "filter.status",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = majorEquipmentService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("获取所有的设备") + @PostMapping("/getMajorEquipment") + public Msg getParentElement() { + List<MajorEquipment> list = majorEquipmentService.getMajorEquipment(); + return success(list); + } + + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "serialNumber",value = "设备编号"), + @ApiImplicitParam(name = "name",value = "设备名称"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "volume",value = "容积"), + @ApiImplicitParam(name = "userId",value = "负责人"), + }) + public Msg add(@RequestBody MajorEquipment param) { + majorEquipmentService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "serialNumber",value = "设备编号"), + @ApiImplicitParam(name = "name",value = "设备名称"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "volume",value = "容积"), + @ApiImplicitParam(name = "userId",value = "负责人"), + }) + public Msg mod(@RequestBody MajorEquipment param) { + majorEquipmentService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + majorEquipmentService.delOne(id, getUser()); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/MajorEquipmentDataController.java b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentDataController.java new file mode 100644 index 0000000..aa3284d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/MajorEquipmentDataController.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.MajorEquipmentData; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.MajorEquipmentDataService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +@Api(tags = "重大危险源检测_仪表实时数据") +@RestController +@RequestMapping("/majorEquipmentData") +public class MajorEquipmentDataController extends BaseController { + + @Autowired + private MajorEquipmentDataService majorEquipmentDataService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.equipmentName",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = majorEquipmentDataService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "equipmentId",value = "设备id"), + @ApiImplicitParam(name = "rangeLowerLimit",value = "仪表量程下限"), + @ApiImplicitParam(name = "rangeUpperLimit",value = "仪表量程上限"), + @ApiImplicitParam(name = "highHighLiquidAlarm",value = "高高液位报警值"), + @ApiImplicitParam(name = "highLiquidAlarm",value = "高液位报警值"), + @ApiImplicitParam(name = "lowLiquidAlarm",value = "低液位报警值"), + @ApiImplicitParam(name = "lowLowLiquidAlarm",value = "低低液位报警值"), + }) + public Msg add(@RequestBody MajorEquipmentData param) { + majorEquipmentDataService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/导入") + @PostMapping("/import") + @ApiImplicitParams({ + @ApiImplicitParam(name = "equipmentName",value = "设备名称"), + @ApiImplicitParam(name = "equipmentSerialNumber",value = "设备编号"), + @ApiImplicitParam(name = "monitoringTime",value = "监测时间"), + @ApiImplicitParam(name = "rangeLowerLimit",value = "仪表量程下限"), + @ApiImplicitParam(name = "rangeUpperLimit",value = "仪表量程上限"), + @ApiImplicitParam(name = "highHighLiquidAlarm",value = "高高液位报警值"), + @ApiImplicitParam(name = "highLiquidAlarm",value = "高液位报警值"), + @ApiImplicitParam(name = "lowLiquidAlarm",value = "低液位报警值"), + @ApiImplicitParam(name = "lowLowLiquidAlarm",value = "低低液位报警值"), + }) + public Msg importData(@RequestBody List<MajorEquipmentData> param) { + majorEquipmentDataService.importData(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "equipmentId",value = "设备id"), + @ApiImplicitParam(name = "rangeLowerLimit",value = "仪表量程下限"), + @ApiImplicitParam(name = "rangeUpperLimit",value = "仪表量程上限"), + @ApiImplicitParam(name = "highHighLiquidAlarm",value = "高高液位报警值"), + @ApiImplicitParam(name = "highLiquidAlarm",value = "高液位报警值"), + @ApiImplicitParam(name = "lowLiquidAlarm",value = "低液位报警值"), + @ApiImplicitParam(name = "lowLowLiquidAlarm",value = "低低液位报警值"), + }) + public Msg mod(@RequestBody MajorEquipmentData param) { + majorEquipmentDataService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + majorEquipmentDataService.delOne(id, getUser()); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/PatrolController.java b/src/main/java/com/gk/hotwork/Controller/PatrolController.java new file mode 100644 index 0000000..7ad804d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/PatrolController.java @@ -0,0 +1,296 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.SelfCheckVo; +import com.gk.hotwork.Service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + + +@Api(tags = "巡检接口") +@RestController +public class PatrolController extends BaseController{ + @Value("${patrolPath}") + private String patrolPath; //配置文件配置的物理保存地址 + @Value("${patrolUrl}") + private String patrolUrl; //配置文件配置的url + + @Autowired + SelfCheckService selfCheckService; + @Autowired + UserService userService; + @Autowired + ExcelExportService excelExportService; + + @GetMapping("/getSelfCheck") + @ApiOperation(value = "根据类型获取检查内容",response = Msg.class) + public Msg getSelfCheck(SelfCheckInfo selfCheck){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<SelfCheckVo> selfChecks = selfCheckService.selectByType(selfCheck.getType()); + if (selfChecks.size() > 0) { + msg.setResult(selfChecks); + return msg; + }else { + msg.setCode("999"); + msg.setMessage("未找到该检查内容"); + return msg; + } + } + + @ApiOperation(value = "上传图片",notes = "上传图片") + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "files",value = "文件"), + }) + @PostMapping("/uploadPic") + @ResponseBody + public Msg uploadPic(StandardMultipartHttpServletRequest req){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + MultiValueMap<String, MultipartFile> multipartFiles = req.getMultiFileMap(); + MultipartFile picFile = multipartFiles.get("files").get(0); + if (null == picFile){ + msg.setCode("404"); + msg.setMessage("上传文件为空"); + }else { + try { + String picmame = UploadUtil.uploadFile(picFile,patrolPath); + msg.setResult(patrolUrl+picmame); + }catch (Exception e){ + e.printStackTrace(); + msg.setCode("500"); + msg.setMessage("上传失败"); + } + } + return msg; + } + + @GetMapping("/selfCheck") + @ApiOperation(value = "获取自定义检查内容",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "type",value = "检查类型"), + @ApiImplicitParam(name = "tasktype",value = "作业类型"), + @ApiImplicitParam(name = "content",value = "检查内容"), + }) + public Msg getSelfCheckList(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + String tasktype, String type,String content){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(tasktype)) { + condition.put("tasktype", tasktype.trim()); + } + + if (StringUtils.isNotBlank(type)) { + condition.put("type", type.trim()); + } + + if (StringUtils.isNotBlank(content)) { + condition.put("content", content.trim()); + } + + pageInfo.setCondition(condition); + selfCheckService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @PostMapping("/addselfCheck") + @ApiOperation(value = "添加自定义检查内容",response = Msg.class) + public Msg addSelfCheckList(@RequestBody SelfCheckInfo selfCheckInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + if (StringUtils.isBlank(selfCheckInfo.getTasktype())){ + msg.setCode("999"); + msg.setMessage("作业类型不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getType())){ + msg.setCode("999"); + msg.setMessage("检查类型不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getContent())){ + msg.setCode("999"); + msg.setMessage("检查内容不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getStandard())){ + msg.setCode("999"); + msg.setMessage("参考判断不能为空"); + return msg; + } + selfCheckInfo.setCreatedby(getUser().getRealname()); + selfCheckInfo.setModifiedby(getUser().getRealname()); + selfCheckInfo.setCreateddate(new Date()); + selfCheckInfo.setModifieddate(new Date()); + selfCheckInfo.setIsdel((byte)0); + selfCheckService.save(selfCheckInfo); + return msg; + } + + @PostMapping("/putselfCheck") + @ApiOperation(value = "修改自定义检查内容",response = Msg.class) + public Msg editSelfCheckList(@RequestBody SelfCheckInfo selfCheckInfo){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + if (StringUtils.isBlank(selfCheckInfo.getTasktype())){ + msg.setCode("999"); + msg.setMessage("作业类型不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getType())){ + msg.setCode("999"); + msg.setMessage("检查类型不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getContent())){ + msg.setCode("999"); + msg.setMessage("检查内容不能为空"); + return msg; + }else if (StringUtils.isBlank(selfCheckInfo.getStandard())){ + msg.setCode("999"); + msg.setMessage("参考判断不能为空"); + return msg; + } + selfCheckInfo.setModifiedby(getUser().getRealname()); + selfCheckInfo.setModifieddate(new Date()); + selfCheckService.updateById(selfCheckInfo); + return msg; + } + + @PostMapping("/delselfCheck") + @ApiOperation(value = "删除自定义检查内容",response = Msg.class) + public Msg delSelfCheckList(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + SelfCheckInfo selfCheckInfo = selfCheckService.getById(id); + if (selfCheckInfo != null){ + selfCheckInfo.setIsdel((byte)1); + selfCheckInfo.setModifiedby(getUser().getRealname()); + selfCheckInfo.setModifieddate(new Date()); + selfCheckService.updateById(selfCheckInfo); + return msg; + }else { + msg.setCode("999"); + msg.setMessage("未找到检查内容"); + return msg; + } + } + + @PostMapping("/selfChecks") + @ApiOperation(value = "删除自定义检查内容",response = Msg.class) + public Msg bashDelSelfCheckList(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + JSONArray ids = jsonObject.getJSONArray("ids"); + List<Long> idList = ids.toJavaList(Long.class); + List<SelfCheckInfo> selfCheckInfoList = selfCheckService.selectByIds(idList); + if (selfCheckInfoList != null && selfCheckInfoList.size() > 0){ + for (SelfCheckInfo selfCheckInfo : selfCheckInfoList) { + selfCheckInfo.setIsdel((byte)1); + selfCheckInfo.setModifiedby(getUser().getRealname()); + selfCheckInfo.setModifieddate(new Date()); + selfCheckService.updateById(selfCheckInfo); + } + return msg; + }else { + msg.setCode("999"); + msg.setMessage("未找到检查内容"); + return msg; + } + } + + @PostMapping("/importSelfCheck") + @ApiOperation(value = "导入自定义检查内容",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "file",value = "文件",required = true), + }) + public Msg addSelfCheckList(MultipartFile file){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmssSSS" ); + if (file == null) + { + msg.setCode("404"); + msg.setMessage("未找到上传文件"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if(!FileOptUtils.isDirExists(patrolPath)){ + msg.setCode("500"); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = patrolPath + getUser().getRealname() + "_" + sdf.format(new Date()) +".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx")? true:false; + BooleanReason blret = excelExportService.imporSelfCheckExcel(in,getUser().getRealname(),isExcel2007); + if(blret.getValue().equals(false)) + { + msg.setCode("500"); + msg.setMessage(blret.getResultmsg()); + return msg; + } + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("500"); + msg.setMessage("导入发生错误"); + return msg; + } + + return msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/PermissionController.java b/src/main/java/com/gk/hotwork/Controller/PermissionController.java new file mode 100644 index 0000000..bb0d0c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/PermissionController.java @@ -0,0 +1,147 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.PermissionInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.Menu; +import com.gk.hotwork.Service.PermissionService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; + +@Api(tags = "菜单接口") +@RestController +public class PermissionController { + @Autowired + PermissionService permissionService; + + @GetMapping("/permissions") + @ApiOperation(value = "获取菜单数据", notes = "获取菜单数据", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "userId",value = "用户id",required = true)}) + public Msg getPermission(@RequestParam String userId){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + List<Menu> menus = permissionService.selectByUserId(userId); + msg.setResult(menus); + + return msg; + } + + @PostMapping("/addpermissions") + @ApiOperation(value = "添加菜单", notes = "添加菜单", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "component",value = "接口路径"), + @ApiImplicitParam(paramType="query",name = "icon",value = "图标"), + @ApiImplicitParam(paramType="query",name = "level",value = "第几级菜单",required = true), + @ApiImplicitParam(paramType="query",name = "name",value = "名称",required = true), + @ApiImplicitParam(paramType="query",name = "parentidId",value = "父级id"), + @ApiImplicitParam(paramType="query",name = "path",value = "路径"), + @ApiImplicitParam(paramType="query",name = "sortorder",value = "排序",required = true), + @ApiImplicitParam(paramType="query",name = "status",value = "状态",required = true), + @ApiImplicitParam(paramType="query",name = "title",value = "标题"), + @ApiImplicitParam(paramType="query",name = "type",value = "类型",required = true), + @ApiImplicitParam(paramType="query",name = "operator",value = "操作人"), + + }) + public Msg addPermission(@ApiParam(value = "component,icon,level,name,parentidId,path,sortorder,status,title,type,operator") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + PermissionInfo permissionInfo = new PermissionInfo(); + permissionInfo.setName(jsonObject.getString("name")); + permissionInfo.setLevel(jsonObject.getInteger("level")); + permissionInfo.setTitle(jsonObject.getString("title")); + permissionInfo.setPath(jsonObject.getString("path")); + permissionInfo.setComponent(jsonObject.getString("component")); + permissionInfo.setIcon(jsonObject.getString("icon")); + permissionInfo.setStatus(jsonObject.getInteger("status")); + permissionInfo.setSortorder(jsonObject.getDouble("sortorder")); + permissionInfo.setType(jsonObject.getInteger("type")); + permissionInfo.setExpand(true); + permissionInfo.setChecked(false); + permissionInfo.setSelected(false); + permissionInfo.setCreatedby(jsonObject.getString("operator")); + permissionInfo.setCreateddate(new Date()); + permissionInfo.setLastmodifiedby(jsonObject.getString("operator")); + permissionInfo.setLastmodifieddate(new Date()); + permissionInfo.setParentid(jsonObject.getInteger("parentid")); + + if (permissionInfo.getParentid() != null) { + PermissionInfo parentPermission = permissionService.getById(permissionInfo.getParentid()); + permissionInfo.setLevel(parentPermission.getLevel()+1); + } + + permissionService.save(permissionInfo); + return msg; + } + + @PostMapping("/putpermissions") + @ApiOperation(value = "修改菜单", notes = "修改菜单", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "component",value = "接口路径"), + @ApiImplicitParam(paramType="body",name = "icon",value = "图标"), + @ApiImplicitParam(paramType="body",name = "level",value = "第几级菜单",required = true), + @ApiImplicitParam(paramType="body",name = "name",value = "名称",required = true), + @ApiImplicitParam(paramType="body",name = "parentidId",value = "父级id"), + @ApiImplicitParam(paramType="body",name = "path",value = "路径"), + @ApiImplicitParam(paramType="body",name = "sortorder",value = "排序",required = true), + @ApiImplicitParam(paramType="body",name = "status",value = "状态",required = true), + @ApiImplicitParam(paramType="body",name = "title",value = "标题"), + @ApiImplicitParam(paramType="body",name = "type",value = "类型",required = true), + @ApiImplicitParam(paramType="body",name = "operator",value = "操作人"), + + }) + public Msg editPermission(@ApiParam(value = "component,icon,level,name,parentidId,path,sortorder,status,title,type,operator") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + PermissionInfo permissionInfo = new PermissionInfo(); + permissionInfo.setId(jsonObject.getInteger("id")); + permissionInfo.setName(jsonObject.getString("name")); + permissionInfo.setLevel(jsonObject.getInteger("level")); + permissionInfo.setTitle(jsonObject.getString("title")); + permissionInfo.setPath(jsonObject.getString("path")); + permissionInfo.setComponent(jsonObject.getString("component")); + permissionInfo.setIcon(jsonObject.getString("icon")); + permissionInfo.setStatus(jsonObject.getInteger("status")); + permissionInfo.setSortorder(jsonObject.getDouble("sortorder")); + permissionInfo.setType(jsonObject.getInteger("type")); + permissionInfo.setExpand(true); + permissionInfo.setChecked(false); + permissionInfo.setSelected(false); + permissionInfo.setCreatedby(jsonObject.getString("operator")); + permissionInfo.setLastmodifiedby(jsonObject.getString("operator")); + permissionInfo.setLastmodifieddate(new Date()); + permissionInfo.setParentid(jsonObject.getInteger("parentid")); + permissionService.updateById(permissionInfo); + return msg; + } + + @PostMapping("/delpermissions") + @ApiOperation(value = "删除菜单", notes = "删除菜单", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "operator",value = "操作人"), + + }) + public Msg delPermission(@ApiParam(value = "id,operator") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + PermissionInfo permissionInfo = permissionService.getById(jsonObject.getInteger("id")); + permissionInfo.setStatus(0); + permissionService.updateById(permissionInfo); + return msg; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RegisterController.java b/src/main/java/com/gk/hotwork/Controller/RegisterController.java new file mode 100644 index 0000000..977953b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RegisterController.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RegisterVo; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/register") +public class RegisterController extends BaseController { + + @Autowired + private UserService userService; + + + @RequestMapping("/add") + public Msg add(@RequestBody RegisterVo registerVo) { + Msg msg = new Msg(); + msg.setCode("200"); + try { + userService.register(registerVo); + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode("400"); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("401"); + msg.setMessage("系统错误,请联系管理员"); + } + return msg; + + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/ReserveController.java b/src/main/java/com/gk/hotwork/Controller/ReserveController.java new file mode 100644 index 0000000..a0e99bf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/ReserveController.java @@ -0,0 +1,81 @@ +package com.gk.hotwork.Controller; + + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Reserve; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.Service.ReserveService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; +import java.util.Map; + + +@RestController +@RequestMapping("reserve") +@Api(tags = "预约") +public class ReserveController extends BaseController { + + @Autowired + private ReserveService reserveService; + + + @PostMapping("pageList") + Msg reservePageList(@RequestBody FilterObject filter) { + Integer pageIndex = filter.getPageIndex(); + Integer pageSize = filter.getPageSize(); + IPage page = reserveService.selectPage(new Page<>(pageIndex, pageSize), filter.getFilter(), getUser()); + return success(page); + } + + + @PostMapping("add") + @ApiOperation("新增预约") + Msg makeAAppointment(@RequestBody Reserve reserve) { + reserveService.addOne(reserve,getUser()); + return success(); + } + + + + @PostMapping("mod") + @ApiOperation("修改预约") + Msg modAppointment(@RequestBody Reserve reserve) { + reserveService.modOne(reserve,getUser()); + return success(); + } + + + @PostMapping("statistics") + @ApiOperation("根据部门统计") + Msg statistics(@RequestBody FilterObject filter) { + Integer pageIndex = filter.getPageIndex(); + Integer pageSize = filter.getPageSize(); + PageInfoExtension<Map> extension = reserveService.statistics(new Page<>(pageIndex,pageSize),filter.getFilter(),getUser()); + return success(extension); + } + + + + + + + + + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskAnaUintController.java b/src/main/java/com/gk/hotwork/Controller/RiskAnaUintController.java new file mode 100644 index 0000000..bd9fdf2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskAnaUintController.java @@ -0,0 +1,185 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.Utils.FileOptUtils; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RiskAnaUintExoprtVo; +import com.gk.hotwork.Service.ExcelExportService; +import com.gk.hotwork.Service.RiskAnaUnitService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.Map; +import java.util.List; + +import static com.gk.hotwork.Domain.Utils.Properties.filePath; + +/** + * @author celin + * @date 2022/3/16 14:39 + */ +@Api(tags = "风险分析单元") +@RestController +@RequestMapping("/riskAnaUnit") +public class RiskAnaUintController extends BaseController { + + @Autowired + private RiskAnaUnitService riskAnaUnitService; + @Autowired + private ExcelExportService excelExportService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex", value = "当前页码"), + @ApiImplicitParam(name = "pageSize", value = "每页行数"), + @ApiImplicitParam(name = "filter.riskUnitName", value = "{}"), + @ApiImplicitParam(name = "filter.hazardDep", value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName", value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage<RiskAnaUnit> page = riskAnaUnitService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "hazardDepId", value = "部门id"), + @ApiImplicitParam(name = "hazardLiablePersonId", value = "负责人"), + @ApiImplicitParam(name = "riskUnitName", value = "风险单元名称"), + }) + public Msg add(@RequestBody RiskAnaUnit riskAnaUnitVo) { + riskAnaUnitService.addOne(riskAnaUnitVo, getUser()); + return success(); + } + + + @ApiOperation("修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "id"), + @ApiImplicitParam(name = "hazardDepId", value = "部门id"), + @ApiImplicitParam(name = "hazardLiablePerson", value = "负责人"), + @ApiImplicitParam(name = "hazardLiablePersonId", value = "负责人"), + @ApiImplicitParam(name = "riskUnitName", value = "风险单元名称"), + }) + public Msg mod(@RequestBody RiskAnaUnit riskAnaUnit) { + riskAnaUnitService.modOne(riskAnaUnit, getUser()); + return success(); + } + + @ApiOperation("删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "id"), + }) + public Msg del(@RequestBody JSONObject jsonObj) { + Long id = jsonObj.getLong("id"); + riskAnaUnitService.delOne(id, getUser()); + return success(); + } + + + @ApiOperation("风险分析个数部门分布") + @PostMapping("/department-analysis") + public Msg analysis(){ + List<Map> list = riskAnaUnitService.selectDepartmentAnalysis(); + return success(list); + } + + @ApiOperation("风险分析单元数据导出") + @GetMapping("/export") + @ApiImplicitParams({ + @ApiImplicitParam(name = "filter.riskUnitName", value = "{}"), + @ApiImplicitParam(name = "filter.hazardDep", value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName", value = "{}"), + }) + public Msg infoExport(HttpServletRequest request, HttpServletResponse response) throws Exception { + + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<RiskAnaUintExoprtVo> listVo = riskAnaUnitService.getInfo(request, response); + msg.setResult(listVo); + return msg; + } + + @ApiOperation("风险分析单元数据导入") + @PostMapping("/import") + public Msg infoImport(MultipartFile file) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + if (file == null) + { + msg.setCode("404"); + msg.setMessage("上传文件未找到"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + getUser().getRealname() + "_" + ".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + //riskEventService.importRiskEventData(param, getUser()); + excelExportService.importRiskAnaUnitExcel(in, getUser().getRealname(), isExcel2007); + + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + } + + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskControlClassifyController.java b/src/main/java/com/gk/hotwork/Controller/RiskControlClassifyController.java new file mode 100644 index 0000000..ec90b2c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskControlClassifyController.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.Controller; + + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.RiskControlClassifyService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author celin + * @date 2022/3/16 15:06 + */ + +@Api(tags = "风险管控分类") +@RestController +@RequestMapping("/riskControlClassify") +public class RiskControlClassifyController extends BaseController { + + @Autowired + private RiskControlClassifyService riskControlClassifyService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObj) { + Integer pageIndex = filterObj.getPageIndex(); + Integer pageSize = filterObj.getPageSize(); + IPage page = riskControlClassifyService.selectPage(new Page<>(pageIndex, pageSize), filterObj.getFilter(), getUser()); + return success(page); + } + + + @ApiOperation(value = "普通查询", notes = "级联") + @GetMapping("/all") + public Msg selectAll() { + List<RiskControlClassify> list = riskControlClassifyService.selectAll(getUser()); + return success(list); + } + + @ApiOperation(value = "新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "措施分类"), + @ApiImplicitParam(name = "note",value = "备注"), + @ApiImplicitParam(name = "orderIndex",value = "排序"), + @ApiImplicitParam(name = "parentId",value = "父分类"), + }) + public Msg add(@RequestBody RiskControlClassify riskControlClassifyVo) { + riskControlClassifyService.addOne(riskControlClassifyVo, getUser()); + return success(); + } + + @ApiOperation(value = "修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "name",value = "措施分类"), + @ApiImplicitParam(name = "note",value = "备注"), + @ApiImplicitParam(name = "orderIndex",value = "排序"), + @ApiImplicitParam(name = "parentId",value = "父分类"), + }) + public Msg mod(@RequestBody RiskControlClassify riskControlClassifyVo) { + riskControlClassifyService.modOne(riskControlClassifyVo, getUser()); + return success(); + } + + @ApiOperation(value = "删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg del(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + riskControlClassifyService.delOne(id, getUser()); + return success(); + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskControlMeasureController.java b/src/main/java/com/gk/hotwork/Controller/RiskControlMeasureController.java new file mode 100644 index 0000000..a9dd97b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskControlMeasureController.java @@ -0,0 +1,199 @@ +package com.gk.hotwork.Controller; + + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskControlMeasure; +import com.gk.hotwork.Domain.Utils.FileOptUtils; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RiskControlMeasureExportVo; +import com.gk.hotwork.Service.ExcelExportService; +import com.gk.hotwork.Service.RiskControlMeasureService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.util.List; + +import static com.gk.hotwork.Domain.Utils.Properties.filePath; + + +@Api(tags = "安全风险管控措施") +@RestController +@RequestMapping("/riskControlMeasure") +public class RiskControlMeasureController extends BaseController { + + @Autowired + private RiskControlMeasureService riskControlMeasureService; + @Autowired + private ExcelExportService excelExportService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.riskEventName",value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName",value = "{}"), + @ApiImplicitParam(name = "filter.dataSrc",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = riskControlMeasureService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("ID查找管控措施") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "管控措施ID") + }) + @GetMapping("/get/id") + public Msg selectById(Long id){ + Msg msg = new Msg(); + RiskControlMeasure measure = riskControlMeasureService.getById(id); + if(measure != null && measure.getId() > 0){ + msg.setCode("200"); + msg.setResult(measure); + }else { + msg.setCode(ErrorCode.ERROR_50001.getCode()); + msg.setMessage(ErrorCode.ERROR_50001.getMsg()); + } + return msg; + } + + + @ApiOperation("新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "riskEventId",value = "所属安全事件id"), + @ApiImplicitParam(name = "dataSrc",value = "自动化监控:1;隐患排查2 (数据字典)"), + @ApiImplicitParam(name = "riskMeasureDesc",value = "管控措施描述"), + @ApiImplicitParam(name = "classify1",value = "分类1"), + @ApiImplicitParam(name = "classify2",value = "分类2"), + @ApiImplicitParam(name = "classify3",value = "企业自定义分类"), + @ApiImplicitParam(name = "troubleshootContent",value = "隐患排查内容"), + }) + public Msg add(@RequestBody RiskControlMeasure riskControlMeasureVo) { + riskControlMeasureService.addOne(riskControlMeasureVo, getUser()); + return success(); + } + + @ApiOperation("修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "riskEventId",value = "所属安全事件id"), + @ApiImplicitParam(name = "dataSrc",value = "自动化监控:1;隐患排查2 (数据字典)"), + @ApiImplicitParam(name = "riskMeasureDesc",value = "管控措施描述"), + @ApiImplicitParam(name = "classify1",value = "分类1"), + @ApiImplicitParam(name = "classify3",value = "企业自定义分类"), + @ApiImplicitParam(name = "troubleshootContent",value = "隐患排查内容"), + }) + public Msg mod(@RequestBody RiskControlMeasure riskControlMeasureVo) { + riskControlMeasureService.modOne(riskControlMeasureVo, getUser()); + return success(); + } + + @ApiOperation("删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg del(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + riskControlMeasureService.delOne(id, getUser()); + return success(); + } + + @ApiOperation("安全风险管控措施数据导出") + @GetMapping("/export") + @ApiImplicitParams({ + @ApiImplicitParam(name = "filter.riskEventName",value = "{}"), + @ApiImplicitParam(name = "filter.dataSrc",value = "{}"), + }) + public Msg infoExport(HttpServletRequest request, HttpServletResponse response) throws Exception { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<RiskControlMeasureExportVo> list = riskControlMeasureService.getRiskControlMeasureList(request, response); + + msg.setResult(list); + + return msg; + } +//List<RiskControlMeasureExportVo> list = riskControlMeasureService.getRiskControlMeasureList(); + + + @ApiOperation("安全风险管控措施数据导入") + @PostMapping("/import") + public Msg infoImport(MultipartFile file) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + if (file == null) + { + msg.setCode("404"); + msg.setMessage("上传文件未找到"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + getUser().getRealname() + "_" + ".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + //riskEventService.importRiskEventData(param, getUser()); + excelExportService.importRiskControlMeasureExcel(in, getUser().getRealname(), isExcel2007); + + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + } + + return msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskEventController.java b/src/main/java/com/gk/hotwork/Controller/RiskEventController.java new file mode 100644 index 0000000..3b461e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskEventController.java @@ -0,0 +1,172 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.Utils.FileOptUtils; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; +import com.gk.hotwork.Service.ExcelExportService; +import com.gk.hotwork.Service.RiskEventService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import static com.gk.hotwork.Domain.Utils.Properties.filePath; + + +@Api(tags = "安全风险事件") +@RestController +@RequestMapping("/riskEvent") +public class RiskEventController extends BaseController { + + @Autowired + private RiskEventService riskEventService; + + @Autowired + private ExcelExportService excelExportService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "filter.riskEventName",value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName",value = "{}"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = riskEventService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "riskUnitId",value = "所属安全风险单元id"), + @ApiImplicitParam(name = "riskEventName",value = "安全风险事件名称"), + }) + public Msg add(@RequestBody RiskEvent riskEventVo) { + riskEventService.addOne(riskEventVo, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "riskUnitId",value = "所属安全风险单元id"), + @ApiImplicitParam(name = "riskEventName",value = "安全风险事件名称"), + }) + public Msg mod(@RequestBody RiskEvent riskEventVo) { + riskEventService.modOne(riskEventVo, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + riskEventService.delOne(id, getUser()); + return success(); + } + + @ApiOperation("安全风险事件导出") + @GetMapping("/export") + @ApiImplicitParams({ + @ApiImplicitParam(name = "filter.riskEventName",value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName",value = "{}"), + }) + public Msg infoExport(HttpServletRequest request, HttpServletResponse response) throws Exception { + + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<RiskEventExportVo> riskEventList = riskEventService.getRiskEventList(request, response); + msg.setResult(riskEventList); + + return msg; + } + + @ApiOperation("/安全风险事件导入") + @PostMapping("/import") + public Msg infoImport(MultipartFile file) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + if (file == null) + { + msg.setCode("404"); + msg.setMessage("上传文件未找到"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + getUser().getRealname() + "_" + ".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + //riskEventService.importRiskEventData(param, getUser()); + excelExportService.importRiskEventExcel(in, getUser().getRealname(), isExcel2007); + + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + } + + return msg; + // + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskMapController.java b/src/main/java/com/gk/hotwork/Controller/RiskMapController.java new file mode 100644 index 0000000..c34600c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskMapController.java @@ -0,0 +1,84 @@ +package com.gk.hotwork.Controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.RiskMap; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RiskMapVO; +import com.gk.hotwork.Service.RiskMapService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Api(tags = "安全风险分布图") +@RestController +@RequestMapping("/riskMap") +public class RiskMapController extends BaseController { + + @Autowired + private RiskMapService riskMapService; + + @ApiOperation("添加一张图") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "createUid",value = "创建人ID"), + @ApiImplicitParam(name = "img",value = "图片路径"), + @ApiImplicitParam(name = "descInfo",value = "描述信息") + }) + public Msg insertOne(@RequestBody RiskMapVO riskMapVO){ + Msg msg = new Msg(); + if(getUser()!=null && getUser().getId()!=null && riskMapVO.getCreateUid()!=null && getUser().getId().equals(riskMapVO.getCreateUid())){ + String rs = riskMapService.saveOne(riskMapVO); + if(rs == null){ + msg.setCode("200"); + }else { + msg.setCode("500"); + msg.setMessage(rs); + } + }else { + msg.setCode("301"); + msg.setMessage("权限错误"); + } + return msg; + } + + + @ApiOperation("查找列表") + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "status",value = "状态 0-有效 , 1-删除 ,不传查所有状态",required = false) + }) + public Msg getList(@RequestParam(required = false) Byte status){ + Msg msg = new Msg(); + msg.setCode("200"); + List<RiskMapVO> voList = riskMapService.listByStatus(status); + if(voList == null || voList.size() == 0){ + msg.setMessage("未找到数据"); + }else { + msg.setResult(voList); + } + return msg; + } + + @ApiOperation("删除图片") + @GetMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "图片ID"), + }) + public Msg delete(@RequestParam Long id){ + Msg msg = new Msg(); + boolean rs = riskMapService.deleteOne(id,getUser().getId()); + if(rs == true){ + msg.setCode("200"); + }else { + msg.setCode("300"); + msg.setMessage("删除失败"); + } + return msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RiskSourceController.java b/src/main/java/com/gk/hotwork/Controller/RiskSourceController.java new file mode 100644 index 0000000..544f3a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RiskSourceController.java @@ -0,0 +1,259 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskSource; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.FileOptUtils; +import com.gk.hotwork.Domain.Utils.JsonUtils; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; +import com.gk.hotwork.Domain.Vo.RiskSourceSearchVo; +import com.gk.hotwork.Domain.Vo.RiskSourceVo; +import com.gk.hotwork.Domain.dto.RiskSourceDto; +import com.gk.hotwork.Domain.dto.RiskSourceUpdateDto; +import com.gk.hotwork.Service.ExcelExportService; +import com.gk.hotwork.Service.RiskSourceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.gk.hotwork.Domain.Utils.Properties.filePath; + +@Api(tags = "风险源管理") +@RestController +@RequestMapping("/riskSource") +public class RiskSourceController extends BaseController { + + @Autowired + private RiskSourceService riskSourceService; + + @Autowired + private ExcelExportService excelExportService; + + @ApiOperation("新增风险源") + @PostMapping("/new") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "风险源名称"), + @ApiImplicitParam(name = "type",value = "风险源类型,1-设施设备,2-作业活动"), + @ApiImplicitParam(name = "level",value = "风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险"), + @ApiImplicitParam(name = "accidentDesc",value = "可能导致的事故描述"), + @ApiImplicitParam(name = "location",value = "区域位置"), + @ApiImplicitParam(name = "depId",value = "所属部门ID"), + + }) + public Msg createNew(@RequestBody RiskSourceDto riskSourceDto){ + Msg msg = new Msg(); + UserInfo userInfo = getUser(); + + if(userInfo!=null && userInfo.getId() > 0){ + riskSourceDto.setCreateUid(userInfo.getId()); + riskSourceDto.setCreateUname(userInfo.getRealname()); + riskSourceDto.setEditUid(userInfo.getId()); + riskSourceDto.setEditUname(userInfo.getRealname()); + + if(riskSourceService.insertOne(riskSourceDto)){ + msg.setCode("200"); + }else { + msg.setCode(ErrorCode.ERROR_60001.getCode()); + msg.setMessage("接口调用错误"); + } + }else { + msg.setMessage("权限错误"); + msg.setCode(ErrorCode.ERROR_20001.getCode()); + } + return msg; + } + + @ApiOperation("ID查找风险源") + @GetMapping("/find/id") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "风险源id"), + + }) + public Msg getOneById(@RequestParam Long id){ + Msg msg = new Msg(); + RiskSource riskSource = riskSourceService.findById(id); + if(riskSource!=null && riskSource.getId() > 0){ + RiskSourceDto dto = new RiskSourceDto(); + BeanUtils.copyProperties(riskSource,dto); + msg.setCode("200"); + msg.setResult(dto); + }else { + msg.setCode(ErrorCode.ERROR_50001.getCode()); + msg.setMessage("未找到数据"); + } + return msg; + } + + @ApiOperation("ID查找风险源") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "风险源名称"), + @ApiImplicitParam(name = "type",value = "风险源类型,1-设施设备,2-作业活动"), + @ApiImplicitParam(name = "level",value = "风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险"), + @ApiImplicitParam(name = "status",value = "状态,1-有效,2-无效,3-删除"), + @ApiImplicitParam(name = "location",value = "区域位置"), + @ApiImplicitParam(name = "depId",value = "所属部门ID"), + @ApiImplicitParam(name = "depName",value = "所属部门名称"), + @ApiImplicitParam(name = "startTime",value = "查询条件-创建时间-开始"), + @ApiImplicitParam(name = "endTime",value = "查询条件-创建时间-结束"), + @ApiImplicitParam(name = "pageIndex",value = "查询的页数"), + @ApiImplicitParam(name = "pageSize",value = "分页条目数") + }) +// @PostMapping("/find/list") + @RequestMapping(value = "/find/list",method = RequestMethod.POST) + public Msg getListByConditions(@RequestBody RiskSourceSearchVo searchVo){ + Msg msg = new Msg(); + IPage<RiskSource> page = riskSourceService.findRiskSourceListByConditions(new Page<>(searchVo.getPageIndex(),searchVo.getPageSize()),searchVo); + if(page!=null && page.getRecords()!=null && page.getRecords().size()>0){ + List<RiskSourceDto> dtoList = new ArrayList<>(); + page.getRecords().forEach(riskSource -> { + RiskSourceDto dto = new RiskSourceDto(); + BeanUtils.copyProperties(riskSource,dto); + dtoList.add(dto); + }); + msg.setCode("200"); + msg.setResult(dtoList); + Map<String,Object> pageInfo = new HashMap<>(); + pageInfo.put("page",page.getPages()); + pageInfo.put("pageSize",searchVo.getPageSize()); + pageInfo.put("totalCount",page.getTotal()); + msg.setMessage(JsonUtils.toJson(pageInfo)); + }else { + msg.setCode(ErrorCode.ERROR_50001.getCode()); + msg.setMessage("未找到数据"); + } + return msg; + } + + + @ApiOperation("更新风险源信息") + @PostMapping("/update/one") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "风险源ID",required = true), + @ApiImplicitParam(name = "name",value = "风险源名称,不超过15个字符"), + @ApiImplicitParam(name = "type",value = "风险源类型,1-设施设备,2-作业活动"), + @ApiImplicitParam(name = "level",value = "风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险"), + @ApiImplicitParam(name = "location",value = "区域位置,不超过30个字符"), + @ApiImplicitParam(name = "depId",value = "所属部门ID"), + @ApiImplicitParam(name = "accidentDesc",value = "可能导致的事故描述,不超过50个字符") + + }) + public Msg updateOne(@RequestBody RiskSourceUpdateDto riskSourceUpdateDto){ + Msg msg = new Msg(); + riskSourceUpdateDto.setEditUid(getUser().getId()); + if(riskSourceService.updateById(riskSourceUpdateDto)){ + msg.setCode("200"); + }else { + msg.setCode(ErrorCode.ERROR_50002.getCode()); + msg.setMessage("更新出错"); + } + return msg; + } + + + @ApiOperation("删除") + @PostMapping("/del/one") + public Msg delOne(@RequestBody JSONObject json) { + Long id = json.getLong("id"); + riskSourceService.delOne(id, getUser()); + return success(); + } + + @ApiOperation("风险源导出") + @GetMapping("/export") + @ApiImplicitParams({ + @ApiImplicitParam(name = "filter.riskEventName",value = "{}"), + @ApiImplicitParam(name = "filter.riskUnitName",value = "{}"), + }) + public Msg RiskSourceExport(HttpServletRequest request, HttpServletResponse response) throws Exception { + + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<RiskSourceVo> riskSourceExport = riskSourceService.getRiskSourceExport(request, response); + msg.setResult(riskSourceExport); + + return msg; + } + + @ApiOperation("/安全风险事件导入") + @PostMapping("/import") + public Msg infoImport(MultipartFile file) { + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + if (file == null) + { + msg.setCode("404"); + msg.setMessage("上传文件未找到"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + getUser().getRealname() + "_" + ".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + //riskEventService.importRiskEventData(param, getUser()); + excelExportService.importRiskSourceExcel(in, getUser().getRealname(), isExcel2007); + + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + } + + return msg; + // + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/RoleController.java b/src/main/java/com/gk/hotwork/Controller/RoleController.java new file mode 100644 index 0000000..402ec2a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/RoleController.java @@ -0,0 +1,174 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.RoleInfo; +import com.gk.hotwork.Domain.RolePermissionsInfo; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.Menu; +import com.gk.hotwork.Service.*; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +@Api(tags = "角色管理数据接口") +@RestController +public class RoleController { + + @Autowired + UserService userService; + @Autowired + RoleService roleService; + @Autowired + UserRolesService userRolesService; + @Autowired + RolePermissionsService rolePermissionsService; + @Autowired + ExcelExportService excelExportService; + + @GetMapping("/role") + @ApiOperation(value = "获取角色数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "角色名"), + }) + public Msg getRoleInfo(String name){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + List<RoleInfo> roleInfos = roleService.selectList(name); + msg.setResult(roleInfos); + return msg; + } + + @GetMapping("/rolepermissions") + @ApiOperation(value = "获取角色菜单数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "roleId",value = "角色id"), + }) + public Msg getRolePermissions(String roleId){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + List<Menu> roleInfos = rolePermissionsService.selectMenuList(roleId); + msg.setResult(roleInfos); + return msg; + } + + @PostMapping("/addrole") + @ApiOperation(value = "添加角色数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "name",value = "角色名",required = true), + @ApiImplicitParam(name = "operator",value = "操作人"), + @ApiImplicitParam(name = "btnaccess",value = "按钮权限"), + }) + public Msg addRoleInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + String name = jsonObject.getString("name"); + String operator = jsonObject.getString("operator"); + String btnaccess = jsonObject.getString("btnaccess"); + RoleInfo roleInfo = new RoleInfo(); + roleInfo.setName(name); + RoleInfo roleInfoExist = roleService.selectRoleByName(roleInfo); + if (roleInfoExist != null){ + msg.setCode("500"); + msg.setMessage("角色名重复"); + return msg; + }else { + roleInfo.setBtnaccess(btnaccess); + roleInfo.setCreatedby(operator); + roleInfo.setCreateddate(new Date()); + roleInfo.setLastmodifiedby(operator); + roleInfo.setLastmodifieddate(new Date()); + roleInfo.setIsdel((byte)0); + roleService.save(roleInfo); + return msg; + } + } + + @PostMapping("/putrole") + @ApiOperation(value = "修改角色数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "角色id",required = true), + @ApiImplicitParam(name = "name",value = "角色名",required = true), + @ApiImplicitParam(name = "btnaccess",value = "按钮权限"), + @ApiImplicitParam(name = "operator",value = "操作人"), + }) + public Msg putRoleInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + String name = jsonObject.getString("name"); + String operator = jsonObject.getString("operator"); + String btnaccess = jsonObject.getString("btnaccess"); + Long id = jsonObject.getLong("id"); + List<RoleInfo> roleInfoExist = roleService.selectExistRole(id,name); + if (roleInfoExist.size() > 0){ + msg.setCode("500"); + msg.setMessage("角色名重复"); + return msg; + }else { + RoleInfo roleInfo = new RoleInfo(); + roleInfo.setId(id); + roleInfo.setName(name); + roleInfo.setBtnaccess(btnaccess); + roleInfo.setLastmodifiedby(operator); + roleInfo.setLastmodifieddate(new Date()); + roleService.updateById(roleInfo); + return msg; + } + } + + @PostMapping("/rolepermissions") + @ApiOperation(value = "获取角色菜单数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "角色id"), + }) + public Msg putRolePermissions(@ApiParam(value = "permissionIds,id") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + JSONArray permissionId = jsonObject.getJSONArray("permissionIds"); + Long roleid = jsonObject.getLong("id"); + rolePermissionsService.delRolePermissionByRoleId(roleid); + for (int i = 0; i < permissionId.size(); i++) { + RolePermissionsInfo rolePermissionsInfo = new RolePermissionsInfo(); + rolePermissionsInfo.setRoleid(roleid); + rolePermissionsInfo.setPermissionid(Long.parseLong(permissionId.get(i).toString())); + rolePermissionsService.save(rolePermissionsInfo); + } + return msg; + } + + @PostMapping("/delrole") + @ApiOperation(value = "删除角色数据", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "operator",value = "更新人"), + + }) + public Msg delRoleInfo(@ApiParam(value = "id,operator") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long id = jsonObject.getLong("id"); + if (id == 1 || id == 2 || id == 3){ + msg.setCode("999"); + msg.setMessage("内置角色不允许删除"); + return msg; + } + RoleInfo roleInfo = new RoleInfo(); + roleInfo.setId(jsonObject.getLong("id")); + roleInfo.setLastmodifiedby(jsonObject.getString("operator")); + roleInfo.setLastmodifieddate(new Date()); + roleInfo.setIsdel((byte)1); + roleService.updateById(roleInfo); + return msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/SafetyInspectionItemController.java b/src/main/java/com/gk/hotwork/Controller/SafetyInspectionItemController.java new file mode 100644 index 0000000..80a26ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/SafetyInspectionItemController.java @@ -0,0 +1,116 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.SafetyInspectionItem; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.SafetyInspectionItemService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +@Api(tags = "安全生产标准化_检查清单检查项") +@RestController +@RequestMapping("/safetyInspectionItem") +public class SafetyInspectionItemController extends BaseController { + + @Autowired + private SafetyInspectionItemService safetyInspectionItemService; + + @ApiOperation("根据B级要素id获取分页数据") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "element_b",value = "B要素的id"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = safetyInspectionItemService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/A级要素下面的检查项") + @PostMapping("/infoElementA") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg infoElementA(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + List<SafetyInspectionItem> list = safetyInspectionItemService.infoElementA(id, getUser()); + return success(list); + } + + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "elementA",value = "A级要素id"), + @ApiImplicitParam(name = "elementB",value = "B级要素id"), + @ApiImplicitParam(name = "standardization_requirements",value = "标准化要求"), + @ApiImplicitParam(name = "enterprise_standard",value = "企业达标标准"), + @ApiImplicitParam(name = "review_method",value = "评审方法"), + @ApiImplicitParam(name = "veto",value = "否决项"), + @ApiImplicitParam(name = "deductionList",value = "扣分项集合"), + }) + public Msg add(@RequestBody SafetyInspectionItem param) { + safetyInspectionItemService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "elementA",value = "A级要素id"), + @ApiImplicitParam(name = "elementB",value = "B级要素id"), + @ApiImplicitParam(name = "standardization_requirements",value = "标准化要求"), + @ApiImplicitParam(name = "enterprise_standard",value = "企业达标标准"), + @ApiImplicitParam(name = "review_method",value = "评审方法"), + @ApiImplicitParam(name = "veto",value = "否决项"), + @ApiImplicitParam(name = "deductionList",value = "扣分项集合"), + }) + public Msg mod(@RequestBody SafetyInspectionItem param) { + safetyInspectionItemService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + safetyInspectionItemService.delOne(id, getUser()); + return success(); + } + + + @ApiOperation("/详情") + @PostMapping("/info") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg info(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + SafetyInspectionItem safetyInspectionItem = safetyInspectionItemService.info(id, getUser()); + return success(safetyInspectionItem); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/SafetySelfInspectionController.java b/src/main/java/com/gk/hotwork/Controller/SafetySelfInspectionController.java new file mode 100644 index 0000000..67f9390 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/SafetySelfInspectionController.java @@ -0,0 +1,147 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.SafetySelfInspection; +import com.gk.hotwork.Domain.SafetySelfInspectionItem; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.SafetySelfInspectionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Api(tags = "安全生产标准化_自查清单") +@RestController +@RequestMapping("/safetySelfInspection") +public class SafetySelfInspectionController extends BaseController { + + @Autowired + private SafetySelfInspectionService safetySelfInspectionService; + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"), + @ApiImplicitParam(name = "inspectorName",value = "检查人名称"), + @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"), + @ApiImplicitParam(name = "inspectionStartTime",value = "开始时间"), + @ApiImplicitParam(name = "inspectionEndTime",value = "结束时间"), + @ApiImplicitParam(name = "status",value = "状态"), + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = safetySelfInspectionService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + @ApiOperation("/自查清单详情") + @PostMapping("/info") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "自查清单id"), + @ApiImplicitParam(name = "unqualified",value = "不合格筛选"), + }) + public Msg info(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + String unqualified = jsonObject.getString("unqualified"); + SafetySelfInspection safetySelfInspection= safetySelfInspectionService.infoOne(id,unqualified,getUser()); + return success(safetySelfInspection); + } + + @ApiOperation("/自查清单结单") + @PostMapping("/finish") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "自查清单id"), + }) + public Msg finish(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + safetySelfInspectionService.finish(id, getUser()); + return success(); + } + + + + @ApiOperation("/自查清单详情_检查项详情") + @PostMapping("/itemInfo") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "自查清单检查项id"), + }) + public Msg itemInfo(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + SafetySelfInspectionItem safetySelfInspectionItem= safetySelfInspectionService.itemInfoOne(id, getUser()); + return success(safetySelfInspectionItem); + } + + + + @ApiOperation("/自查清单详情_检查项评审") + @PostMapping("/modItemInfo") + @ApiImplicitParams({ + @ApiImplicitParam(name = "safetyInspectionItemResult",value = "评审结果"), + @ApiImplicitParam(name = "selfDeductionList",value = "扣分项集合"), + }) + public Msg modItemInfo(@RequestBody SafetySelfInspectionItem param) { + safetySelfInspectionService.modItemInfo(param, getUser()); + return success(); + } + + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"), + @ApiImplicitParam(name = "inspector",value = "检查人id"), + @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"), + @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"), + @ApiImplicitParam(name = "inspectionTime",value = "检查时间"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "itemList",value = "检查项集合"), + }) + public Msg add(@RequestBody SafetySelfInspection param) { + safetySelfInspectionService.addOne(param, getUser()); + return success(); + } + + @ApiOperation("/修改") + @PostMapping("/mod") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"), + @ApiImplicitParam(name = "inspector",value = "检查人id"), + @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"), + @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"), + @ApiImplicitParam(name = "inspectionTime",value = "检查时间"), + @ApiImplicitParam(name = "status",value = "状态"), + @ApiImplicitParam(name = "itemList",value = "检查项集合"), + }) + public Msg mod(@RequestBody SafetySelfInspection param) { + safetySelfInspectionService.modOne(param, getUser()); + return success(); + } + + @ApiOperation("/删除") + @PostMapping("/del") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + }) + public Msg mod(@RequestBody JSONObject jsonObject) { + Long id = jsonObject.getLong("id"); + safetySelfInspectionService.delOne(id, getUser()); + return success(); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Controller/TaskController.java b/src/main/java/com/gk/hotwork/Controller/TaskController.java new file mode 100644 index 0000000..bd0dc22 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/TaskController.java @@ -0,0 +1,1803 @@ +package com.gk.hotwork.Controller; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Enum.Etype; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Utils.UploadUtil; +import com.gk.hotwork.Domain.Vo.TaskCheck; +import com.gk.hotwork.Domain.Vo.TaskEnclosureVo; +import com.gk.hotwork.Domain.Vo.TaskVo; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; +import com.gk.hotwork.Scheduls.warning.Warning; +import com.gk.hotwork.Service.*; +import com.spire.doc.interfaces.IField; +import io.swagger.annotations.Api; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; +import sun.security.krb5.internal.crypto.EType; + +/** + * @author : jingjy + * @date : 2021/8/19 16:50 + */ +@Api(tags = "任务流程数据接口") +@RestController +@RequestMapping("/task") +public class TaskController extends BaseController { + @Autowired + private TaskService taskService; + @Autowired + private TaskAnalysisService taskAnalysisService; + @Autowired + private TaskSecurityService taskSecurityService; + @Autowired + private TaskWorkerService taskWorkerService; + @Autowired + private TaskLogService taskLogService; + @Autowired + private UserService userService; + @Autowired + private DepartmentService departmentService; + @Autowired + private InvolveDepService involveDepService; + @Autowired + private TaskInvolveDepService taskInvolveDepService; + @Autowired + private TaskEquipmentService taskEquipmentService; + @Autowired + private TaskEnclosureService taskEnclosureService; + @Autowired + private TaskRiskService taskRiskService; + @Autowired + private EquipmentService equipmentService; + @Autowired + private TaskEquipmentBindService taskEquipmentBindService; + @Autowired + private SubTaskService subTaskService; + @Autowired + CompanyService companyService; + @Autowired + private TaskReviewService taskReviewService; + @Autowired + private WarningService warningService; + + @Value("${workCode}") + private String workCode; + @Value("${taskPath}") + private String taskPath; + @Value("${taskUrl}") + private String taskUrl; + @Value("${task}") + private String task; + + @ApiOperation(value = "获取任务信息",notes = "获取任务信息") + @GetMapping("/info") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前分页"), + @ApiImplicitParam(name = "pageSize",value = "分页每页数量"), + @ApiImplicitParam(name = "sort",value = "排序列名"), + @ApiImplicitParam(name = "order",value = "排序方式(正序反序)"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间"), + @ApiImplicitParam(name = "company",value = "单位"), + }) + public Msg getTaskInfos(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "level", required = false) String level, + @RequestParam(value = "status", required = false) Byte status, + String company, String starttime,String endtime, Byte flag, + String type, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(level)) { + condition.put("level", level); + } + if (null != status){ + condition.put("status", status); + } + if (null != flag){ + condition.put("flag", flag); + } + if (StringUtils.isNotBlank(company)) { + condition.put("company", company); + } + if (StringUtils.isNotBlank(type)) { + condition.put("type", type); + } + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime); + } + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime); + } + pageInfo.setCondition(condition); + taskService.selectDataGrid(pageInfo); + + return success(pageInfo); + } + + @ApiOperation(value = "根据任务编号获取任务信息",notes = "根据任务编号获取任务信息") + @GetMapping("/get") + @ApiImplicitParam(name = "code",value = "任务编号") + public Msg getTaskVoByCode(@RequestParam String code){ + if (StringUtils.isBlank(code)){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskVo taskVo; + TaskInfo taskInfo = taskService.getTaskByCode(code); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + taskVo = taskService.getTaskVoByCode(code); + return success(taskVo); + } + + @ApiOperation(value = "创建任务信息",notes = "创建任务信息") + @ApiImplicitParams({ + @ApiImplicitParam(paramType="TaskVo",name = "taskVo",value = "任务类"), + }) + @PostMapping("/create") + public Msg createTask(@Validated @RequestBody TaskVo taskVo){ + UserInfo userInfo = userService.getById(getUser().getId()); + if (taskVo.getIsanalysis() == 1){ + if (StringUtils.isBlank(taskVo.getAnalysisarea()) || StringUtils.isBlank(taskVo.getAnalysismedium())){ + throw new BusinessException("需要气体检测分析时必须填写分析点名称和分析介质"); + } + taskService.saveTaskForAnalysis(taskVo,userInfo); + }else { + Byte level = taskVo.getLevel(); + if (taskVo.getIsholiday().equals((byte)1)){ + level++; + } + + if (userInfo.getDepartment() == null){ + return new Msg(ErrorCode.ERROR_50001,"用户部门信息不能为空"); + } + + DepartmentInfo dep = departmentService.getById(userInfo.getDepartment()); + if (dep == null){ + return new Msg(ErrorCode.ERROR_50001,"用户部门信息不存在"); + } + taskVo.setDepartment(dep.getDepartment()); + DepartmentInfo departmentInfo = departmentService.selectSafetyDepartment(); + if (departmentInfo == null && !level.equals(TaskInfo.LEVEL_SECOND)){ + return new Msg(ErrorCode.ERROR_50001,"安全部门信息不能为空"); + } + List<InvolveDepInfo> depInfos = involveDepService.list(); + if (depInfos.size() == 0 && !level.equals(TaskInfo.LEVEL_SECOND)){ + return new Msg(ErrorCode.ERROR_50001,"相关部门信息不能为空"); + } + //判断吨位是否传 + try { + Etype.parse(taskVo.getEtype()); + } catch (BusinessException e) { + return new Msg(ErrorCode.ERROR_50001,e.getMessage()); + } + String taskCode = taskService.generateCode(userInfo,workCode); + + //任务为一级特级时,要添加相关部门审核流程 + List<TaskInvolveDepartment>departments = new ArrayList<>(); + if (!level.equals(TaskInfo.LEVEL_SECOND)){ + for (InvolveDepInfo depInfo : depInfos){ + TaskInvolveDepartment department = new TaskInvolveDepartment(); + department.setDepartment(depInfo.getDepartment()); + department.setTaskcode(taskCode); + department.setCreatedat(new Date()); + department.setCreatedby(userInfo.getRealname()); + departments.add(department); + } + taskInvolveDepService.saveBatch(departments); + } + TaskInfo taskInfo = BeanUtils.copy(taskVo,TaskInfo.class); + if (departmentInfo != null && !level.equals(TaskInfo.LEVEL_SECOND)){ + taskInfo.setSecuritydep(departmentInfo.getDepartment()); + } + taskInfo.setStatus(TaskInfo.UNCOMMITTED); + taskInfo.setCode(taskCode); + taskInfo.setCreatedat(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskVo.setCode(taskCode); + + List<TaskSecurity> taskSecurities = taskVo.getTaskSecurities(); + + //subTask存储 + + String option = "CREATE"; + subTaskService.saveSubTasks(taskVo.getSubTaskInfos(),taskCode,userInfo,option); + + taskService.save(taskInfo); + taskSecurityService.saveBatch(taskSecurities); + String content = "创建任务信息"; + TaskLog taskLog = new TaskLog(taskCode,content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + } + + return success(taskVo); + } + + @ApiOperation(value = "修改任务信息",notes = "修改任务信息") + @PostMapping("/update") + public Msg updateTask(@Validated @RequestBody TaskVo taskVo, BindingResult bindingResult){ + if (bindingResult.hasErrors()) { + StringBuilder stringBuilder = new StringBuilder(); + for (String s : bindingResult.getFieldErrors().stream() + .map(FieldError::getDefaultMessage).collect(Collectors.toList())) { + stringBuilder.append(s).append(","); + } + return new Msg(ErrorCode.ERROR_10002,stringBuilder.toString()); + } + if (taskVo.getId() == null){ + return new Msg(ErrorCode.ERROR_10004); + } + UserInfo userInfo = userService.getById(getUser().getId()); + TaskInfo taskInfoExist = taskService.getById(taskVo.getId()); + if (taskInfoExist == null){ + return new Msg(ErrorCode.ERROR_50001); + } + TaskInfo taskInfo = BeanUtils.copy(taskVo,TaskInfo.class); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + String taskCode = taskVo.getCode(); + String option = "UPDATE"; + subTaskService.saveSubTasks(taskVo.getSubTaskInfos(),taskCode,userInfo, option); + //吨位不可以改 + taskInfo.setEtype(null); + taskService.updateById(taskInfo); + + return success(); + } + + @ApiOperation(value = "第二步创建信息",notes = "第二步创建信息") + @PostMapping("/create/second") + public Msg updateTask(@RequestBody TaskVo taskVo){ + if (taskVo.getCode() == null){ + return new Msg(ErrorCode.ERROR_10004); + } + TaskInfo taskInfoExist = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfoExist == null){ + return new Msg(ErrorCode.ERROR_50001); + } + Date now = new Date(); + UserInfo userInfo = userService.getById(getUser().getId()); + List<TaskSecurity>securities = taskVo.getTaskSecurities(); + if (securities == null || securities.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"安全措施为空"); + } + securities.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + item.setConfirmedby(userInfo.getRealname()); + }); + TaskRisk risk = taskVo.getTaskRisk(); + if (risk == null) { + return new Msg(ErrorCode.ERROR_10002,"请填写安全风险"); + } + risk.setCreatedat(now); + risk.setCreatedby(userInfo.getRealname()); + List<TaskEquipment>equipments = taskVo.getTaskEquipments(); + if (equipments == null || equipments.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"请选择安全设备"); + } + equipments.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + }); + taskSecurityService.saveBatch(securities); + taskRiskService.save(risk); + taskEquipmentService.saveBatch(equipments); + return success(); + } + + @ApiOperation(value = "第二步更新信息",notes = "第二步更新信息") + @PostMapping("/update/second") + public Msg updateTaskSecond(@RequestBody TaskVo taskVo){ + if (taskVo.getCode() == null){ + return new Msg(ErrorCode.ERROR_10004); + } + TaskInfo taskInfoExist = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfoExist == null){ + return new Msg(ErrorCode.ERROR_50001); + } + + UserInfo userInfo = userService.getById(getUser().getId()); + taskSecurityService.removeByTaskCode(taskVo.getCode()); + taskEquipmentService.removeByTaskCode(taskVo.getCode()); + taskRiskService.removeByCode(taskVo.getCode()); + //更新删除原先的,重新插入 + Date now = new Date(); + List<TaskSecurity> taskSecurities = taskVo.getTaskSecurities(); + if (taskSecurities == null || taskSecurities.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"安全措施为空"); + } + taskSecurities.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + item.setConfirmedby(userInfo.getRealname()); + }); + taskSecurityService.saveBatch(taskSecurities); + + List<TaskEquipment> taskEquipments = taskVo.getTaskEquipments(); + if (taskEquipments == null || taskEquipments.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"请选择安全设备"); + } + taskEquipments.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + }); + taskEquipmentService.saveBatch(taskEquipments); + + TaskRisk risk = taskVo.getTaskRisk(); + if (risk == null) { + return new Msg(ErrorCode.ERROR_10002,"请填写安全风险"); + } + risk.setTaskcode(taskVo.getCode()); + risk.setCreatedat(now); + risk.setCreatedby(userInfo.getRealname()); + taskRiskService.save(risk); + return success(); + } + + + @ApiOperation(value = "创建任务信息", notes = "安卓端") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "TaskVo", name = "task", value = "任务类"), + }) + @PostMapping("/app/create") + public synchronized Msg appCreateTask(@RequestBody TaskVo taskVo) { + if (taskVo == null){ + return new Msg(ErrorCode.ERROR_10001); + } + try { + UserInfo userInfo = userService.getById(getUser().getId()); + if (taskVo.getIsanalysis() == 1){ + taskService.saveTaskForAnalysis(taskVo,userInfo); + }else { + taskService.saveTaskByApp(taskVo, getUser()); + } + + return success(); + } catch (BusinessException e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_10002, e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_40001, "系统内部错误"); + } + + } + + @ApiOperation(value = "删除任务信息",notes = "删除任务信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "任务id"), + }) + @PostMapping("/delete") + public Msg deleteTask(Long id){ + TaskInfo taskInfo = taskService.getById(id); + if (id == null || taskInfo == null){ + return new Msg(ErrorCode.ERROR_10001); + } + if (!taskInfo.getFlag().equals(TaskInfo.WAIT_REVIEW)){ + return new Msg(ErrorCode.ERROR_50005,"当前状态无法作废"); + } + Byte isDeleted = 1; + UserInfo userInfo = userService.getById(getUser().getId()); + taskInfo.setIsdel(isDeleted); + taskService.updateById(taskInfo); + String taskCode = taskInfo.getCode(); + taskSecurityService.deleteByTaskCode(taskCode); + taskWorkerService.deleteByTaskCode(taskCode); + taskEnclosureService.removeByTaskCode(taskCode); + taskRiskService.deleteByTaskCode(taskCode); + taskAnalysisService.deleteByTaskCode(taskCode); + taskReviewService.deleteByTaskCode(taskCode); + String content = "删除任务"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "web端上传图片",notes = "web端上传图片") + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "files",value = "文件"), + }) + @PostMapping("/web/upload") + @ResponseBody + public Msg upload(StandardMultipartHttpServletRequest req){ + MultiValueMap<String, MultipartFile> multipartFiles = req.getMultiFileMap(); + + MultipartFile picFile = null; + if (multipartFiles.get("files") == null){ + if(multipartFiles.get("file") != null){ + picFile = multipartFiles.get("file").get(0); + } + }else { + picFile = multipartFiles.get("files").get(0); + } + if (null == picFile){ + return new Msg(ErrorCode.ERROR_10001); + }else { + try { + String picName = UploadUtil.uploadFile(picFile,taskPath); + HashMap<String, String> map = new HashMap<>(4); + map.put("name",picFile.getOriginalFilename()); + map.put("path",task+picName); + return success(map); + }catch (Exception e){ + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_40001); + } + } + } + + @ApiOperation(value = "上传图片",notes = "上传图片") + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "files",value = "文件"), + }) + @PostMapping("/uploadPic") + @ResponseBody + public Msg uploadPic(StandardMultipartHttpServletRequest req){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + MultiValueMap<String, MultipartFile> multipartFiles = req.getMultiFileMap(); + MultipartFile picFile = multipartFiles.get("files").get(0); + if (null == picFile){ + msg.setCode("404"); + msg.setMessage("上传文件为空"); + }else { + try { + String picmame = UploadUtil.uploadFile(picFile,taskPath); + msg.setResult(task+picmame); + }catch (Exception e){ + e.printStackTrace(); + msg.setCode("500"); + msg.setMessage("上传失败"); + } + } + return msg; + } + + @PostMapping("/upload") + public Msg uploadFiles(TaskEnclosureVo taskEnclosureVo) throws Exception { + MultipartFile[]files = taskEnclosureVo.getFile(); + List<TaskEnclosure>enclosures = new ArrayList<>(); + UserInfo userInfo = userService.getById(getUser().getId()); + if (files != null && files.length > 0) { + for (MultipartFile file : files) { + String name = UploadUtil.uploadFile(file, taskPath); + TaskEnclosure enclosure = new TaskEnclosure(); + String fileType = file.getContentType(); + if (fileType != null && fileType.contains("image")){ + enclosure.setFiletype((byte)1); + }else if (fileType != null && fileType.contains("pdf")){ + enclosure.setFiletype((byte)2); + } + enclosure.setTaskcode(taskEnclosureVo.getTaskcode()); + enclosure.setFilename(name); + enclosure.setType(taskEnclosureVo.getType()); + enclosure.setFileurl(task + name); + enclosure.setCreatedat(new Date()); + enclosure.setCreatedby(userInfo.getRealname()); + enclosure.setOriginalname(file.getOriginalFilename()); + enclosures.add(enclosure); + } + } + taskEnclosureService.saveBatch(enclosures); + return success(); + } + + @PostMapping("/getFiles") + public Msg getFiles(String taskCode){ + return success(taskEnclosureService.getListByTaskCode(taskCode)); + } + + @PostMapping("/deleteFile") + public Msg deleteFile(String id){ + TaskEnclosure taskEnclosure = taskEnclosureService.getById(id); + if (taskEnclosure == null){ + return new Msg(ErrorCode.ERROR_50001); + } + taskEnclosureService.removeById(id); + return success(); + } + + @PostMapping("/analysis/add") + public Msg addAnalysis(@RequestBody TaskAnalysis analysis, BindingResult bindingResult){ + if (bindingResult.hasErrors()) { + StringBuilder stringBuilder = new StringBuilder(); + for (String s : bindingResult.getFieldErrors().stream() + .map(FieldError::getDefaultMessage).collect(Collectors.toList())) { + stringBuilder.append(s).append(","); + } + return new Msg(ErrorCode.ERROR_10002,stringBuilder.toString()); + } + + UserInfo userInfo = userService.getById(getUser().getId()); + analysis.setAnalysisat(new Date()); + analysis.setCreatedat(new Date()); + analysis.setCreatedby(userInfo.getRealname()); + taskAnalysisService.save(analysis); + return success(); + } + + @ApiOperation(value = "获取部门任务信息",notes = "获取部门任务信息") + @GetMapping("/info/dep") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前分页"), + @ApiImplicitParam(name = "pageSize",value = "分页每页数量"), + @ApiImplicitParam(name = "sort",value = "排序列名"), + @ApiImplicitParam(name = "order",value = "排序方式(正序反序)") + }) + public Msg getTaskInfosByDep(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "level", required = false) String level, + @RequestParam(value = "status", required = false) String status, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + UserInfo userInfo = userService.getById(getUser().getId()); + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(level)) { + condition.put("level", level); + } + if (StringUtils.isNotBlank(status)) { + condition.put("status", status); + } + condition.put("unit",userInfo.getCompany()); + condition.put("department",userInfo.getDepartment()); + pageInfo.setCondition(condition); + taskService.selectDataGridByDep(pageInfo); + + return success(pageInfo); + } + + @ApiOperation(value = "获取可查看任务信息",notes = "获取可查看任务信息") + @GetMapping("/info/viewable") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前分页"), + @ApiImplicitParam(name = "pageSize",value = "分页每页数量"), + @ApiImplicitParam(name = "sort",value = "排序列名"), + @ApiImplicitParam(name = "order",value = "排序方式(正序反序)"), + @ApiImplicitParam(name = "code",value = "作业编号"), + @ApiImplicitParam(name = "level",value = "作业级别"), + @ApiImplicitParam(name = "status",value = "审批状态"), + @ApiImplicitParam(name = "flag",value = "作业状态"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间"), + @ApiImplicitParam(name = "time",value = "查询时间"), + @ApiImplicitParam(name = "applicant",value = "申请人"), + @ApiImplicitParam(name = "tasktype",value = "作业类型"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "constructionunit",value = "施工单位"), + }) + public Msg getTaskInfosViewable(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "level", required = false) String level, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "flag", required = false) String flag, + @RequestParam(value = "applicant", required = false) String applicant, + @RequestParam(value = "starttime", required = false) String starttime, + @RequestParam(value = "endtime", required = false) String endtime, + @RequestParam(value = "tasktype", required = false) String tasktype, + @RequestParam(value = "department", required = false) String department, + @RequestParam(value = "time", required = false) String time, + @RequestParam(value = "constructionunit", required = false) String constructionunit, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + UserInfo userInfo = userService.getById(getUser().getId()); + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(level)) { + condition.put("level", level); + } + if (StringUtils.isNotBlank(status)) { + condition.put("status", status); + } + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime); + } + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime); + } + if (StringUtils.isNotBlank(tasktype)) { + condition.put("tasktype", tasktype); + } + if (StringUtils.isNotBlank(department)) { + condition.put("department", department); + } + if(time != null && time.length()>0){ + condition.put("time", time); + } + if (StringUtils.isNotBlank(constructionunit)) { + condition.put("constructionunit", constructionunit); + } + List<String>list = new ArrayList<>(); + if (StringUtils.isNotBlank(flag)) { + + list = StringUtils.toList(flag); + for (String s : list){ + for (int i = 0; i < s.length(); i++) { + System.out.println(s.charAt(i)); + if (!Character.isDigit(s.charAt(i))) { + return new Msg(ErrorCode.ERROR_10003,"flag参数错误"); + } + } + + } + } + condition.put("list", list); + if (StringUtils.isNotBlank(applicant)) { + condition.put("applicant", applicant); + } + condition.put("unit",userInfo.getCompany()); + condition.put("department",userInfo.getDepartment()); + condition.put("userType",userInfo.getType()); + pageInfo.setCondition(condition); + taskService.selectDataGridViewable(pageInfo); + + return success(pageInfo); + } + + + @ApiOperation(value = "获取进行中的任务") + @ApiImplicitParams({ + @ApiImplicitParam(name = "time",value = "查询时间,不传则用当前时间",example = "2022-05-12 14:00:00"), + @ApiImplicitParam(name = "type",value = "项目标识 1 - 60万吨 ,2 - 130万吨 ,不传则查全部") + }) + @RequestMapping(value = "/get/active",method = RequestMethod.GET) + public Msg getInProgressTask(@RequestParam(required = false) String time,@RequestParam(required = false) Byte type){ + Msg msg = new Msg(); + Date queryTime = null; + if(time != null && !time.isEmpty()){ + try { + queryTime = DateUtil.parseDateTime(time); + } catch (Exception e) { + e.printStackTrace(); + } + } + msg.setResult(taskService.selectActiveTaskLocation(queryTime,type)); + if(msg.getResult() != null){ + msg.setCode("200"); + }else { + msg.setCode("300"); + msg.setMessage("无作业数据"); + } + return msg; + } + + @ApiOperation(value = "气体检测中心可操作任务信息",notes = "气体检测中心可操作任务信息") + @GetMapping("/info/testing") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前分页"), + @ApiImplicitParam(name = "pageSize",value = "分页每页数量"), + @ApiImplicitParam(name = "sort",value = "排序列名"), + @ApiImplicitParam(name = "order",value = "排序方式(正序反序)") + }) + public Msg getTaskInfosTesting(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "level", required = false) String level, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "searchflag", required = false) String searchflag, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + UserInfo userInfo = userService.getById(getUser().getId()); + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(level)) { + condition.put("level", level); + } + if (StringUtils.isNotBlank(status)) { + condition.put("status", status); + } + if (StringUtils.isBlank(searchflag)) { + searchflag = "0"; + } + condition.put("searchflag", searchflag); + + // 当前用户的部门是分析部门 或者 当前用户的部门是作业的申请部门 且 当前用户是安全员 + if (userInfo.getDepartment() == null) { + return new Msg(ErrorCode.ERROR_50004,"用户未有部门"); + } + DepartmentInfo dep = departmentService.getById(userInfo.getDepartment()); + if (dep == null) { + return new Msg(ErrorCode.ERROR_50004,"用户部门不存在"); + } + if (departmentService.isAnalysis(dep.getDepartment())) { + pageInfo.setCondition(condition); + taskService.selectDataGridTesting(pageInfo); + }else if(userInfo.getIssecurityofficer().equals((byte)1)){ + pageInfo.setCondition(condition); + condition.put("specificDepartment", userInfo.getDepartment()); + taskService.selectDataGridTesting(pageInfo); + } + + return success(pageInfo); + } + + @ApiOperation(value = "获取待审批任务信息",notes = "获取待审批任务信息") + @GetMapping("/info/review") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前分页"), + @ApiImplicitParam(name = "pageSize",value = "分页每页数量"), + @ApiImplicitParam(name = "sort",value = "排序列名"), + @ApiImplicitParam(name = "order",value = "排序方式(正序反序)"), + @ApiImplicitParam(name = "code",value = "作业编号"), + @ApiImplicitParam(name = "level",value = "作业级别"), + @ApiImplicitParam(name = "status",value = "审批状态"), + @ApiImplicitParam(name = "flag",value = "作业状态"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间"), + @ApiImplicitParam(name = "applicant",value = "申请人"), + @ApiImplicitParam(name = "tasktype",value = "作业类型"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "constructionunit",value = "施工单位"), + }) + public Msg getWaitReviewTaskInfos(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "level", required = false) String level, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "flag", required = false) String flag, + @RequestParam(value = "applicant", required = false) String applicant, + @RequestParam(value = "starttime", required = false) String starttime, + @RequestParam(value = "endtime", required = false) String endtime, + @RequestParam(value = "tasktype", required = false) String tasktype, + @RequestParam(value = "department", required = false) String department, + @RequestParam(value = "constructionunit", required = false) String constructionunit, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + UserInfo userInfo = userService.getById(getUser().getId()); + + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(level)) { + condition.put("level", level); + } + if (StringUtils.isNotBlank(status)) { + condition.put("status", status); + } + if (StringUtils.isNotBlank(flag)) { + condition.put("flag", flag); + } + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime); + } + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime); + } + if (StringUtils.isNotBlank(tasktype)) { + condition.put("tasktype", tasktype); + } + if (StringUtils.isNotBlank(department)) { + condition.put("department", department); + } + if (StringUtils.isNotBlank(constructionunit)) { + condition.put("constructionunit", constructionunit); + } + condition.put("unit",userInfo.getCompany()); + condition.put("department",userInfo.getDepartment()); + condition.put("applicant",userInfo.getRealname()); + condition.put("isCompany",userInfo.getIscompany()); + condition.put("isDepartment",userInfo.getIsdepartment()); + pageInfo.setCondition(condition); + taskService.getWaitReviewDataGrid(pageInfo); + + return success(pageInfo); + } + + @ApiOperation(value = "获取待处理任务信息",notes = "获取待处理任务信息") + @GetMapping("/info/pending") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type",value = "类型(1.当前用户为动火人;2.监火人;3.分析人)") + }) + public Msg getPendingTask(@RequestParam(value = "type", required = false) String type){ + if (StringUtils.isBlank(type)){ + return new Msg(ErrorCode.ERROR_10002); + } + UserInfo userInfo = userService.getById(getUser().getId()); + List<TaskVo>taskVos = taskService.getPendingTask(type,userInfo.getRealname()); + return success(taskVos); + } + + @ApiOperation(value = "获取进行中任务信息",notes = "获取进行中任务信息") + @GetMapping("/info/doing") + public Msg getPendingTask(){ + List<TaskVo>taskVos = taskService.getDoingTask(); + return success(taskVos); + } + + @ApiOperation(value = "提交任务到检测中心",notes = "提交任务到检测中心") + @PostMapping("/gasCheck") + public Msg gasCheck(Long id){ + TaskInfo taskInfo = taskService.getById(id); + UserInfo userInfo = userService.getById(getUser().getId()); + if (!taskInfo.getApplicant().equals(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_50004,"只有申请人才能提交"); + } + + if (!taskInfo.getIsanalysis() .equals((byte)1)){ + return new Msg(ErrorCode.ERROR_50004,"当前任务不需要检测"); + } + + if (!(taskInfo.getStatus().equals(TaskInfo.REJECTED) || taskInfo.getStatus().equals(TaskInfo.UNCOMMITTED))){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许提交任务到检测中心"); + } + + //校验完成修改状态 + taskInfo.setStatus(TaskInfo.TEST_COMMITTED); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskService.updateById(taskInfo); + String content = "提交任务到检测中心"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @PostMapping("/submit") + public Msg submitTask(Long id){ + TaskInfo taskInfo = taskService.getById(id); + UserInfo userInfo = userService.getById(getUser().getId()); + if (!taskInfo.getApplicant().equals(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_50004,"只有申请人才能提交"); + } + + if (taskInfo.getIsanalysis() .equals((byte)1)){ + if (!taskInfo.getStatus().equals(TaskInfo.TEST_CHECKED)){ + return new Msg(ErrorCode.ERROR_50004,"当前任务未完成气体检测,不能提交施工部门审核"); + } + }else { + if (!(taskInfo.getStatus().equals(TaskInfo.REJECTED) || taskInfo.getStatus().equals(TaskInfo.UNCOMMITTED))){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许提交"); + } + } + + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskInfo.getCode()); + if (securities == null || securities.size() == 0){ + return new Msg(ErrorCode.ERROR_50004,"安全措施不能为空"); + } + List<TaskEnclosure>enclosures = taskEnclosureService.getListByTaskCode(taskInfo.getCode()); + if (enclosures == null || enclosures.size() == 0) { + return new Msg(ErrorCode.ERROR_50004,"文件不能为空"); + } + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskInfo.getCode()); + if (equipments == null || equipments.size() == 0) { + return new Msg(ErrorCode.ERROR_50004,"设备不能为空"); + } + + TaskRisk risk = taskRiskService.getTaskRiskByCode(taskInfo.getCode()); + if (risk == null){ + return new Msg(ErrorCode.ERROR_50004,"安全风险不能为空"); + } + + //校验完成修改状态 + taskInfo.setStatus(TaskInfo.COMMITTED); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskService.updateById(taskInfo); + String content = "任务提交"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "app修改提交任务信息",notes = "app修改提交任务信息") + @PostMapping("/app/update") + public Msg appUpdateTask(@RequestBody TaskVo taskVo){ + if (taskVo == null){ + return new Msg(ErrorCode.ERROR_10001); + } + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10004); + } + TaskInfo taskInfoExist = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfoExist == null){ + return new Msg(ErrorCode.ERROR_50001); + } + + UserInfo userInfo = userService.getById(getUser().getId()); + taskVo.setId(taskInfoExist.getId()); + if (taskInfoExist.getIsanalysis() == 1 && (taskInfoExist.getStatus().equals(TaskInfo.REJECTED) || taskInfoExist.getStatus().equals(TaskInfo.UNCOMMITTED))){ + taskService.updateTaskByAppForAnalysis(taskVo,userInfo); + }else { + TaskRisk risk = taskVo.getTaskRisk(); + if (risk == null) { + return new Msg(ErrorCode.ERROR_10002,"请填写安全风险"); + } + List<TaskEquipment> taskEquipments = taskVo.getTaskEquipments(); + if (taskEquipments == null || taskEquipments.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"请选择安全设备"); + } + + List<TaskSecurity> taskSecurities = taskVo.getTaskSecurities(); + if (taskSecurities == null || taskSecurities.size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"安全措施为空"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + taskService.updateTaskByApp(taskVo,userInfo); + } + + return success(); + } + + @ApiOperation(value = "检测中心检测",notes = "检测中心检测") + @PostMapping("/testingCenter/review") + public Msg testingCenterReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + String content; + UserInfo userInfo = userService.getById(getUser().getId()); + + if (taskInfo.getStatus().equals(TaskInfo.TEST_COMMITTED)){ + if (taskReview.getIsagree() == 1){ + taskInfo.setStatus(TaskInfo.TEST_CHECKED); + List<TaskAnalysis>taskAnalyses = taskVo.getTaskAnalyses(); + taskAnalyses.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedby(userInfo.getRealname()); + item.setCreatedat(new Date()); + }); + taskAnalysisService.saveBatch(taskAnalyses); + content = "检测中心确认"; + }else { + taskInfo.setStatus(TaskInfo.REJECTED); + content = "检测中心驳回"; + } + }else if (taskInfo.getStatus().equals(TaskInfo.APPROVED) && taskInfo.getFlag().equals(TaskInfo.DOING)){ + if (taskReview.getIsagree() == 1){ + List<TaskAnalysis>taskAnalyses = taskVo.getTaskAnalyses(); + taskAnalyses.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedby(userInfo.getRealname()); + item.setCreatedat(new Date()); + }); + taskAnalysisService.saveBatch(taskAnalyses); + content = "检测中心任务中提交数据"; + }else { + content = "检测中心提交检测异常"; + String warnContent = "在任务 "+taskInfo.getCode()+" 中,检测中心提交检测异常"; + WarningInfo warningInfo = new WarningInfo(); + warningInfo.setCreatedat(new Date()); + warningInfo.setTaskcode(taskInfo.getCode()); + warningInfo.setContent(warnContent); + warningInfo.setType(WarningInfo.WARNING); + warningService.save(warningInfo); + } + }else { + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskReviewService.saveReview(taskReview); + taskService.updateById(taskInfo); + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + + return success(); + } + + @ApiOperation(value = "施工单位确认",notes = "施工单位确认") + @PostMapping("/construction/review") + public Msg constructionReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getStatus().equals(TaskInfo.COMMITTED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + String content; + UserInfo userInfo = userService.getById(getUser().getId()); + if (!userInfo.getCompany().equals(taskInfo.getConstructionunit()) && !userInfo.getDepartment().equals(taskInfo.getConstructionunit())){ + return new Msg(ErrorCode.ERROR_70001); + } + if (taskReview.getIsagree() == 1){ + taskInfo.setStatus(TaskInfo.CONTRACTOR_APPROVED); + taskInfo.setConstructionopinion(taskVo.getConstructionopinion() == null?"同意":taskVo.getConstructionopinion()); + taskInfo.setConstructionname(userInfo.getRealname()); + taskInfo.setConstructiontime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + + List<TaskWorkerVo>workers = taskVo.getTaskWorkers(); + List<TaskSecurity>securities = taskVo.getTaskSecurities(); + List<TaskEnclosure>enclosures = taskVo.getResources(); + List<TaskEquipment>equipments = taskVo.getTaskEquipments(); + TaskRisk risk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + risk.setConfirmat(new Date()); + taskRiskService.updateById(risk); + taskWorkerService.saveBatch(workers, userInfo); + taskSecurityService.saveBatch(securities); + taskEquipmentService.saveBatch(equipments); + taskEnclosureService.saveBatch(enclosures); + content = "施工单位确认"; + }else { + taskInfo.setStatus(TaskInfo.REJECTED); + taskInfo.setConstructionopinion(taskVo.getConstructionopinion() == null?"驳回":taskVo.getConstructionopinion()); + taskInfo.setConstructionname(userInfo.getRealname()); + taskInfo.setConstructiontime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + content = "施工单位驳回"; + } + taskService.updateById(taskInfo); + taskReviewService.saveReview(taskReview); + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + + return success(); + } + + @ApiOperation(value = "动火部位审核",notes = "动火部位审核") + @PostMapping("/part/review") + public Msg partReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getStatus().equals(TaskInfo.CONTRACTOR_APPROVED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + UserInfo userInfo = userService.getById(getUser().getId()); + String content; + Byte level = taskInfo.getLevel(); + if (taskInfo.getIsholiday().equals((byte)1)){ + level++; + } + if (taskReview.getIsagree() == 1){ + if (StringUtils.isBlank(taskVo.getApproversupervisor())){ + return new Msg(ErrorCode.ERROR_10002,"需要指定监火人"); + } + if (StringUtils.isBlank(taskVo.getAnalyst())){ + return new Msg(ErrorCode.ERROR_10002,"需要指定分析人"); + } + if (level.equals(TaskInfo.LEVEL_SECOND)){ + taskInfo.setStatus(TaskInfo.APPROVED); + taskInfo.setFlag(TaskInfo.WAIT_CHECK); + }else { + taskInfo.setStatus(TaskInfo.PART_APPROVED); + } + taskInfo.setApplyunitopinion(taskVo.getApplyunitopinion() == null?"同意":taskVo.getApplyunitopinion()); + taskInfo.setApplyunitname(userInfo.getRealname()); + taskInfo.setApplyunittime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskInfo.setAnalyst(taskVo.getAnalyst()); + taskInfo.setApproversupervisor(taskVo.getApproversupervisor()); + content = "动火部位审核通过"; + }else { + taskInfo.setStatus(TaskInfo.REJECTED); + taskInfo.setApplyunitopinion(taskVo.getApplyunitopinion() == null?"驳回":taskVo.getApplyunitopinion()); + taskInfo.setApplyunitname(userInfo.getRealname()); + taskInfo.setApplyunittime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskEquipmentService.removeByTaskCodeByConstruction(taskInfo.getCode()); + content = "动火部位审核驳回"; + } + taskService.updateById(taskInfo); + taskReviewService.saveReview(taskReview); + + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "相关部门审核",notes = "相关部门审核") + @PostMapping("/involve/review") + public Msg involveReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getStatus().equals(TaskInfo.PART_APPROVED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + UserInfo userInfo = userService.getById(getUser().getId()); + List<TaskInvolveDepartment>departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + boolean isReviewed = false; + if (taskReview.getIsagree() == 1){ + for (TaskInvolveDepartment department : departments){ + if (department.getDepartment().equals(userInfo.getDepartment())){ + department.setStatus((byte)1); + department.setContent(taskVo.getRelevantopinion() == null?"同意":taskVo.getRelevantopinion()); + department.setReviewedby(userInfo.getRealname()); + department.setReviewedat(new Date()); + taskInvolveDepService.updateById(department); + String content = department.getDepartment()+"审核通过"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + isReviewed = true; + } + } + }else { + for (TaskInvolveDepartment department : departments){ + if (department.getDepartment().equals(userInfo.getDepartment())){ + department.setStatus((byte)2); + department.setContent(taskVo.getRelevantopinion() == null?"驳回":taskVo.getRelevantopinion()); + department.setReviewedby(userInfo.getRealname()); + department.setReviewedat(new Date()); + taskInvolveDepService.updateById(department); + String content = department.getDepartment()+"审核驳回"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + isReviewed = true; + } + } + taskInfo.setStatus(TaskInfo.REJECTED); + taskInfo.setRelevantopinion(taskVo.getRelevantopinion() == null?"驳回":taskVo.getRelevantopinion()); + taskInfo.setApplyunitname(userInfo.getRealname()); + taskInfo.setApplyunittime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + taskEquipmentService.removeByTaskCodeByConstruction(taskInfo.getCode()); + if (!isReviewed){ + return new Msg(ErrorCode.ERROR_70001); + } + return success(); + } + if (!isReviewed){ + return new Msg(ErrorCode.ERROR_70001); + } + boolean isAllAgree = true; + for (TaskInvolveDepartment department : departments){ + if (!department.getStatus().equals((byte)1)) { + isAllAgree = false; + } + } + if (isAllAgree){ + taskInfo.setStatus(TaskInfo.RELEVANT_APPROVED); + taskInfo.setRelevantopinion(departments.get(0).getContent()); + taskInfo.setRelevanttime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + } + return success(); + } + + @ApiOperation(value = "安全部门审核",notes = "安全部门审核") + @PostMapping("/security/review") + public Msg securityReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + Byte level = taskInfo.getLevel(); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + + if (taskInfo.getIsholiday().equals((byte)1)){ + level++; + } + + if (!taskInfo.getStatus().equals(TaskInfo.RELEVANT_APPROVED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + String content; + UserInfo userInfo = userService.getById(getUser().getId()); + if (taskReview.getIsagree() == 1){ + if (level.equals(TaskInfo.LEVEL_ONE)){ + taskInfo.setStatus(TaskInfo.APPROVED); + taskInfo.setFlag(TaskInfo.WAIT_CHECK); + }else { + taskInfo.setStatus(TaskInfo.SECURITY_APPROVED); + } + taskInfo.setSecurityopinion(taskVo.getSecurityopinion() == null?"同意":taskVo.getSecurityopinion()); + taskInfo.setSecurityname(userInfo.getRealname()); + taskInfo.setSecuritytime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + content = "安全部门审核通过"; + }else { + taskInfo.setStatus(TaskInfo.REJECTED); + taskInfo.setSecurityopinion(taskVo.getSecurityopinion() == null?"驳回":taskVo.getSecurityopinion()); + taskInfo.setSecurityname(userInfo.getRealname()); + taskInfo.setSecuritytime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + content = "安全部门审核驳回"; + taskEquipmentService.removeByTaskCodeByConstruction(taskInfo.getCode()); + } + taskService.updateById(taskInfo); + taskReviewService.saveReview(taskReview); + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "单位负责人审核",notes = "单位负责人审核") + @PostMapping("/leader/review") + public Msg leaderReview(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getStatus().equals(TaskInfo.SECURITY_APPROVED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许确认"); + } + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 + || taskVo.getTaskReviews().get(0).getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10002,"审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + String content; + UserInfo userInfo = userService.getById(getUser().getId()); + if (taskReview.getIsagree() == 1){ + taskInfo.setStatus(TaskInfo.APPROVED); + taskInfo.setFlag(TaskInfo.WAIT_CHECK); + taskInfo.setEnterpriseopinion(taskVo.getEnterpriseopinion() == null?"同意":taskVo.getEnterpriseopinion()); + taskInfo.setEnterprisename(userInfo.getRealname()); + taskInfo.setEnterprisetime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + content = "单位负责人审核通过"; + }else { + taskInfo.setStatus(TaskInfo.REJECTED); + taskInfo.setEnterpriseopinion(taskVo.getEnterpriseopinion() == null?"驳回":taskVo.getEnterpriseopinion()); + taskInfo.setEnterprisename(userInfo.getRealname()); + taskInfo.setEnterprisetime(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + content = "单位负责人审核驳回"; + taskEquipmentService.removeByTaskCodeByConstruction(taskInfo.getCode()); + } + taskReviewService.saveReview(taskReview); + taskService.updateById(taskInfo); + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "申请人撤销",notes = "申请人撤销") + @PostMapping("/revoke") + public Msg revoke(@RequestBody TaskVo taskVo){ + if (StringUtils.isBlank(taskVo.getCode())){ + return new Msg(ErrorCode.ERROR_10002); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskVo.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getStatus().equals(TaskInfo.COMMITTED)){ + return new Msg(ErrorCode.ERROR_50004,"当前状态不允许取消"); + } + UserInfo userInfo = userService.getById(getUser().getId()); + if (!userInfo.getRealname().equals(taskInfo.getApplicant())){ + return new Msg(ErrorCode.ERROR_50004,"只有申请人才能撤销"); + } + String content = "撤销申请"; + taskInfo.setStatus(TaskInfo.UNCOMMITTED); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @ApiOperation(value = "监火人检查",notes = "监火人检查") + @PostMapping("/supervisor/check") + public Msg supervisorCheck(@RequestBody TaskCheck taskCheck){ + if (taskCheck == null || StringUtils.isBlank(taskCheck.getCode())){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskReview taskReview = taskCheck.getTaskReview(); + if (taskReview == null || taskReview.getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10001,"审核信息不能为空"); + } + UserInfo userInfo = userService.getById(getUser().getId()); + TaskInfo taskInfo = taskService.getTaskByCode(taskCheck.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + Date now = new Date(); + if (now.getTime() < taskInfo.getStarttime().getTime() || now.getTime() > taskInfo.getEndtime().getTime()){ + return new Msg(ErrorCode.ERROR_50004,"不在预计的工作时间"); + } + byte isAgree = taskCheck.getTaskReview().getIsagree(); + byte agree = 1; + byte refuse = 0; + if (isAgree == agree){ + for (EquipmentInfo equipmentInfo:taskCheck.getEquipments()){ + EquipmentInfo equipmentInfoExist = equipmentService.selectByNumber(equipmentInfo.getNumber()); + TaskEquipmentBindInfo taskEquipmentBindInfo = new TaskEquipmentBindInfo(); + if (equipmentInfoExist == null){ + return new Msg(ErrorCode.ERROR_10004,"未找到该条码对应的设备"); + }else { + taskEquipmentBindInfo.setEquipmentname(equipmentInfoExist.getName()); + } + taskEquipmentBindInfo.setTaskcode(taskCheck.getCode()); + taskEquipmentBindInfo.setEquipmentnumber(equipmentInfo.getNumber()); + taskEquipmentBindInfo.setUpdateby(getUser().getRealname()); + taskEquipmentBindInfo.setUpdatetime(new Date()); + taskEquipmentBindService.save(taskEquipmentBindInfo); + } + taskInfo.setSupervisoropinion(taskCheck.getContent()); + taskInfo.setFlag(TaskInfo.WAIT_START); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + String content = "监火人检查任务通过"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + + }else if (isAgree == refuse){ + taskInfo.setSupervisoropinion(taskCheck.getContent()); + taskInfo.setFlag(TaskInfo.WAIT_RECTIFY); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + List<TaskEnclosure> resources = taskCheck.getResources(); + if (resources == null || resources.size() == 0){ + return new Msg(ErrorCode.ERROR_10002); + } + taskEnclosureService.removeByTaskCodeAndType(taskInfo.getCode(),"检查整改问题"); + + resources.forEach(item->{ + item.setTaskcode(taskCheck.getCode()); + item.setCreatedat(new Date()); + item.setCreatedby(userInfo.getRealname()); + }); + taskEnclosureService.saveBatch(taskCheck.getResources()); + String content = "监火人检查任务不通过"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + } + taskReviewService.saveReview(taskReview); + return success(); + } + + @PostMapping("/addEquipments") + @ApiOperation(value = "添加作业设备数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskcode",value = "作业编号"), + @ApiImplicitParam(name = "equipmentnumber",value = "设备条码"), + }) + public Msg addTaskEquipments(@RequestBody TaskCheck taskCheck){ + if (taskCheck == null || StringUtils.isBlank(taskCheck.getCode())){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskReview taskReview = taskCheck.getTaskReview(); + if (taskReview == null || taskReview.getIsagree() == null){ + return new Msg(ErrorCode.ERROR_10001,"审核信息不能为空"); + } + + UserInfo userInfo = userService.getById(getUser().getId()); + TaskInfo taskInfo = taskService.getTaskByCode(taskCheck.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!taskInfo.getFlag().equals(TaskInfo.WAIT_START)){ + return new Msg(ErrorCode.ERROR_50004); + } + + Date now = new Date(); + if (now.getTime() < taskInfo.getStarttime().getTime() || now.getTime() > taskInfo.getEndtime().getTime()){ + return new Msg(ErrorCode.ERROR_50004,"不在预计的工作时间"); + } + if (taskCheck.getEquipments() == null || taskCheck.getEquipments().size() == 0){ + return new Msg(ErrorCode.ERROR_10002,"设备信息不能为空"); + } + + List<TaskEquipmentBindInfo>equipmentBindInfos = new ArrayList<>(); + List<EquipmentInfo>equipmentInfos = new ArrayList<>(); + for (EquipmentInfo equipmentInfo:taskCheck.getEquipments()){ + EquipmentInfo equipmentInfoExist = equipmentService.selectByNumber(equipmentInfo.getNumber()); + taskEquipmentBindService.removeByTaskCode(taskCheck.getCode(),userInfo.getRealname()); + TaskEquipmentBindInfo taskEquipmentBindInfo = new TaskEquipmentBindInfo(); + if (equipmentInfoExist == null){ + return new Msg(ErrorCode.ERROR_10004,equipmentInfo.getNumber()+" 未找到该条码对应的设备"); + }else if (equipmentInfoExist.getStatus() == (byte)1){ + return new Msg(ErrorCode.ERROR_10004,equipmentInfo.getNumber()+" 该设备正在使用中"); + }else { + taskEquipmentBindInfo.setEquipmentname(equipmentInfoExist.getName()); + } + taskEquipmentBindInfo.setTaskcode(taskCheck.getCode()); + taskEquipmentBindInfo.setEquipmentnumber(equipmentInfo.getNumber()); + taskEquipmentBindInfo.setUpdateby(userInfo.getRealname()); + taskEquipmentBindInfo.setUpdatetime(new Date()); + equipmentBindInfos.add(taskEquipmentBindInfo); + byte using = 1; + equipmentInfoExist.setStatus(using); + equipmentInfos.add(equipmentInfoExist); + } + taskEquipmentBindService.saveBatch(equipmentBindInfos); + equipmentService.updateBatchById(equipmentInfos); + taskInfo.setSupervisoropinion(taskCheck.getContent()); + taskInfo.setFlag(TaskInfo.DOING); + taskInfo.setModifiedby(userInfo.getRealname()); + taskInfo.setModifiedat(new Date()); + taskService.updateById(taskInfo); + taskReviewService.saveReview(taskReview); + String content = "绑定设备,准备开始工作"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),getUser().getCompany()); + taskLogService.save(taskLog); + return success(); + } + + @PostMapping("/flag/check") + @ApiOperation(value = "将异常任务修改成待检查",response = Msg.class) + public Msg changeStatus(@RequestBody TaskCheck taskCheck){ + if (StringUtils.isBlank(taskCheck.getCode())){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskCheck.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!(taskInfo.getFlag().equals(TaskInfo.WAIT_RECTIFY) || taskInfo.getFlag().equals(TaskInfo.ABORT) )){ + return new Msg(ErrorCode.ERROR_50004); + } + + taskInfo.setFlag(TaskInfo.WAIT_CHECK); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(getUser().getRealname()); + taskService.updateById(taskInfo); + + return success(); + } + + @PostMapping("/flag/abort") + @ApiOperation(value = "将进行中的任务改为中止",response = Msg.class) + public Msg changeStatusAbort(@RequestBody TaskCheck taskCheck){ + if (StringUtils.isBlank(taskCheck.getCode())){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskCheck.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!(taskInfo.getFlag().equals(TaskInfo.DOING))){ + return new Msg(ErrorCode.ERROR_50004); + } + + UserInfo userInfo = userService.getById(getUser().getId()); + taskInfo.setFlag(TaskInfo.ABORT); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(getUser().getRealname()); + taskInfo.setContent(taskCheck.getContent()); + taskEnclosureService.removeAndSave(taskCheck,userInfo); + + List<EquipmentInfo>equipmentInfos = equipmentService.selectUsingByTask(taskCheck.getCode()); + equipmentInfos.forEach(item->{ + byte free = 0; + item.setStatus(free); + item.setUpdatetime(new Date()); + item.setUpdateby(getUser().getRealname()); + }); + equipmentService.updateBatchById(equipmentInfos); + taskService.updateById(taskInfo); + + return success(); + } + + @PostMapping("/flag/complete") + @ApiOperation(value = "将进行中的任务改为已完成",response = Msg.class) + public Msg changeStatusComplete(@RequestBody TaskCheck taskCheck){ + if (StringUtils.isBlank(taskCheck.getCode())){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskCheck.getCode()); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (!(taskInfo.getFlag().equals(TaskInfo.DOING))){ + return new Msg(ErrorCode.ERROR_50004); + } + + taskInfo.setFlag(TaskInfo.COMPLETE); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(getUser().getRealname()); + taskInfo.setOpinion(taskCheck.getContent()); + if (taskCheck.getResources() != null && taskCheck.getResources().size() != 0){ + taskEnclosureService.removeByTaskCodeAndType(taskInfo.getCode(),"检查整改问题"); + List<TaskEnclosure> resources = taskCheck.getResources(); + resources.forEach(item->{ + item.setTaskcode(taskCheck.getCode()); + item.setCreatedat(new Date()); + item.setCreatedby(getUser().getRealname()); + }); + taskEnclosureService.saveBatch(taskCheck.getResources()); + } + List<EquipmentInfo>equipmentInfos = equipmentService.selectUsingByTask(taskCheck.getCode()); + equipmentInfos.forEach(item->{ + byte free = 0; + item.setStatus(free); + item.setUpdatetime(new Date()); + item.setUpdateby(getUser().getRealname()); + }); + equipmentService.updateBatchById(equipmentInfos); + taskService.updateById(taskInfo); + + return success(); + } + + @ApiOperation(value = "变更监护人",response = Msg.class) + @PostMapping("/changeSupervisor") + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskcode",value = "任务编号"), + @ApiImplicitParam(name = "approversupervisor",value = "监护人") + }) + public Msg changeSupervisor(@RequestBody JSONObject object){ + String taskCode = object.getString("taskcode"); + if (StringUtils.isBlank(taskCode)){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskCode); + UserInfo userInfo = userService.getById(getUser().getId()); + List<Byte>statusList = Arrays.asList(TaskInfo.REJECTED,TaskInfo.UNCOMMITTED,TaskInfo.COMMITTED,TaskInfo.CONTRACTOR_APPROVED); + if(statusList.contains(taskInfo.getStatus()) || taskInfo.getFlag().equals(TaskInfo.COMPLETE)){ + return new Msg(ErrorCode.ERROR_50004,"当前任务状态不允许修改监护人"); + } + String approversupervisor = object.getString("approversupervisor"); + if (StringUtils.isBlank(approversupervisor)){ + return new Msg(ErrorCode.ERROR_10001,"监护人不能为空"); + } + UserInfo userInfo1 = userService.selectByRealName(null,approversupervisor); + if (userInfo1 == null){ + return new Msg(ErrorCode.ERROR_10001,"所选监护人未录入系统"); + } + //修改监护人 + taskInfo.setApproversupervisor(approversupervisor); + + String content = "变更监护人,由 "+taskInfo.getApproversupervisor()+" 变更为 "+approversupervisor; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),userInfo.getCompany()); + taskLogService.save(taskLog); + + taskService.updateById(taskInfo); + + return success(); + } + + @ApiOperation(value = "修改作业人",response = Msg.class) + @PostMapping("/changeWorker") + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "任务编号"), + @ApiImplicitParam(name = "status",value = "审批状态"), + @ApiImplicitParam(name = "flag",value = "任务状态"), + }) + public Msg changeWorker(@RequestBody List<TaskWorkerVo> taskWorkers){ + if (taskWorkers == null || taskWorkers.size() < 1 || StringUtils.isBlank(taskWorkers.get(0).getTaskcode())){ + return new Msg(ErrorCode.ERROR_10001); + } + String taskCode = taskWorkers.get(0).getTaskcode(); + TaskInfo taskInfo = taskService.getTaskByCode(taskCode); + UserInfo userInfo = userService.getById(getUser().getId()); + + List<TaskWorker> taskWorkerList = taskWorkerService.getListByTaskCode(taskInfo.getCode()); + + StringBuilder s = new StringBuilder(); + StringBuilder s1 = new StringBuilder(); + taskWorkerList.forEach(item-> s.append(item.getWorker()).append(",")); + taskWorkers.forEach(item-> s1.append(item.getWorker()).append(",")); + String content = "变更作业人员,由 "+s.toString()+" 变更为 "+s1.toString(); + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),userInfo.getCompany()); + taskLogService.save(taskLog); + taskWorkerService.deleteByTaskCode(taskInfo.getCode()); + taskWorkerService.saveBatch(taskWorkers,userInfo); + + return success(); + } + + + @ApiOperation(value = "修改任务状态(Status/Flag)",response = Msg.class) + @PostMapping("/changeStatusFlag") + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "任务编号"), + @ApiImplicitParam(name = "status",value = "审批状态"), + @ApiImplicitParam(name = "flag",value = "任务状态"), + }) + public Msg changeStatusFlag(@RequestBody JSONObject object){ + if (StringUtils.isBlank(object.getString("code"))){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(object.getString("code")); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + if (object.getString("status")!=null){ + taskInfo.setStatus(object.getByte("status")); + } + if (object.getString("flag")!=null){ + taskInfo.setFlag(object.getByte("flag")); + } + taskService.updateById(taskInfo); + return success(); + } + + @ApiOperation(value = "获取任务状态(Flag)",response = Msg.class) + @GetMapping("/getFlag") + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "任务编号") + }) + public Msg getFlagByTaskCode(@RequestParam String code){ + if (StringUtils.isBlank(code)){ + return new Msg(ErrorCode.ERROR_10001); + } + TaskInfo taskInfo = taskService.getTaskByCode(code); + if (taskInfo == null){ + return new Msg(ErrorCode.ERROR_50001); + } + return success(taskInfo.getFlag()); + } + + @GetMapping("/statistics") + @ApiOperation(value = "统计隐患数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间"), + @ApiImplicitParam(name = "company",value = "单位"), + }) + public Msg getUserInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String company, String type, String starttime,String endtime, Byte status, Byte flag){ + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<>(); + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + if (StringUtils.isNotBlank(starttime)) { + condition.put("starttime", starttime.trim()); + } + + if (StringUtils.isNotBlank(endtime)) { + condition.put("endtime", endtime.trim()); + } + + if (StringUtils.isNotBlank(type)) { + condition.put("type", type.trim()); + } + + if (null != status) { + condition.put("status", status); + } + + if (null != flag) { + condition.put("flag", flag); + } + + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + + if (!companyService.isMain(userInfo.getCompany())){ + condition.put("company", userInfo.getCompany()); + } + + pageInfo.setCondition(condition); + taskService.selectStatisticsData(pageInfo); + return success(pageInfo); + } + + + + + //获取在作业中的作业 包括作业类型 作业内容和作业开始事件和结束事件 + @GetMapping("/workShow/taskList") + public Msg workShowTaskList() { + List<TaskVo> taskList = taskService.getWorkShowTaskList(getUser()); + return success(taskList); + } + + + //获取在作业中的作业的人员信息,常调用; + @GetMapping("/workShow/personList") + public Msg workShowPersonList(){ + List<TaskVo> taskList = taskService.getWorkShowPersonList(getUser()); + return success(taskList); + } + + @GetMapping("/workCert-regenerate") + public Msg workShowPerson(@RequestParam String code){ + taskService.generateAllWorkCert(code); + return success(); + } + +} diff --git a/src/main/java/com/gk/hotwork/Controller/TaskEquipmentController.java b/src/main/java/com/gk/hotwork/Controller/TaskEquipmentController.java new file mode 100644 index 0000000..97dfed0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/TaskEquipmentController.java @@ -0,0 +1,254 @@ +package com.gk.hotwork.Controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.EquipmentVo; +import com.gk.hotwork.Domain.Vo.TaskCheck; +import com.gk.hotwork.Service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +@Api(tags = "作业设备数据接口") +@RestController +public class TaskEquipmentController extends BaseController { + @Autowired + TaskEquipmentBindService taskEquipmentBindService; + @Autowired + TaskGasService taskGasService; + @Autowired + TaskLocationService taskLocationService; + @Autowired + EquipmentService equipmentService; + @Autowired + GasWarnService gasWarnService; + @Autowired + VideoService videoService; + @Autowired + TaskService taskService; + + @PostMapping("/addTaskEquipment") + @ApiOperation(value = "添加作业设备数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskcode",value = "作业编号"), + @ApiImplicitParam(name = "equipmentnumber",value = "设备条码"), + }) + public Msg addTaskEquipment(@Validated @RequestBody TaskEquipmentBindInfo taskEquipmentBindInfo, BindingResult bindingResult){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + if (bindingResult.hasErrors()) { + StringBuilder stringBuilder = new StringBuilder(); + for (String s : bindingResult.getFieldErrors().stream() + .map(FieldError::getDefaultMessage).collect(Collectors.toList())) { + stringBuilder.append(s).append(","); + } + return new Msg(ErrorCode.ERROR_10002,stringBuilder.toString()); + } + + EquipmentInfo equipmentInfo = equipmentService.selectByNumber(taskEquipmentBindInfo.getEquipmentnumber()); + if (equipmentInfo == null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("未找到该条码对应的设备"); + return msg; + }else { + taskEquipmentBindInfo.setEquipmentname(equipmentInfo.getName()); + } + + taskEquipmentBindInfo.setUpdateby(getUser().getRealname()); + taskEquipmentBindInfo.setUpdatetime(new Date()); + taskEquipmentBindService.save(taskEquipmentBindInfo); + return msg; + } + + @PostMapping("/addTaskGas") + @ApiOperation(value = "添加作业气体数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskcode",value = "作业编号"), + @ApiImplicitParam(name = "gastype",value = "气体类型"), + @ApiImplicitParam(name = "gasvalue",value = "气体浓度值"), + @ApiImplicitParam(name = "gasunit",value = "气体单位"), + }) + public Msg addTaskGas(@Validated @RequestBody List<TaskGasInfo> taskGasInfoList, BindingResult bindingResult){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (bindingResult.hasErrors()) { + StringBuilder stringBuilder = new StringBuilder(); + for (String s : bindingResult.getFieldErrors().stream() + .map(FieldError::getDefaultMessage).collect(Collectors.toList())) { + stringBuilder.append(s).append(","); + } + return new Msg(ErrorCode.ERROR_10002,stringBuilder.toString()); + } + for (TaskGasInfo taskGasInfo : taskGasInfoList){ + TaskInfo taskInfo = taskService.getTaskByCode(taskGasInfo.getTaskcode()); + if (!taskInfo.getFlag().equals(TaskInfo.DOING)){ + return success(); + } + taskGasInfo.setIswarn((byte)0); + taskGasInfo.setIsyujing((byte)0); + GasWarnInfo gasWarnInfo = gasWarnService.selectByType(taskGasInfo.getGastype(),"报警"); + if (gasWarnInfo != null){ + if (taskGasInfo.getGasvalue().compareTo(gasWarnInfo.getMax()) > 0 + || taskGasInfo.getGasvalue().compareTo(gasWarnInfo.getMin()) < 0){ + taskGasInfo.setIswarn((byte)1); + } + } + + GasWarnInfo gasWarnInfo1 = gasWarnService.selectByType(taskGasInfo.getGastype(),"预警"); + if (gasWarnInfo1 != null){ + if (taskGasInfo.getGasvalue().compareTo(gasWarnInfo1.getMax()) > 0 + || taskGasInfo.getGasvalue().compareTo(gasWarnInfo1.getMin()) < 0){ + taskGasInfo.setIsyujing((byte)1); + } + } + taskGasInfo.setIssms((byte)0); + taskGasInfo.setIsmend((byte)0); + taskGasInfo.setTaskworker(getUser().getRealname()); + taskGasInfo.setUpdatetime(new Date()); + taskGasService.save(taskGasInfo); + } + return msg; + } + + @PostMapping("/addTaskLocation") + @ApiOperation(value = "添加作业人员位置数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "taskcode",value = "作业编号"), + @ApiImplicitParam(name = "gastype",value = "气体类型"), + @ApiImplicitParam(name = "gasvalue",value = "气体浓度值"), + @ApiImplicitParam(name = "gasunit",value = "气体单位"), + }) + public Msg addTaskLocation(@Validated @RequestBody TaskLocationInfo taskLocationInfo, BindingResult bindingResult){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + if (bindingResult.hasErrors()) { + StringBuilder stringBuilder = new StringBuilder(); + for (String s : bindingResult.getFieldErrors().stream() + .map(FieldError::getDefaultMessage).collect(Collectors.toList())) { + stringBuilder.append(s).append(","); + } + return new Msg(ErrorCode.ERROR_10002,stringBuilder.toString()); + } + TaskInfo taskInfo = taskService.getTaskByCode(taskLocationInfo.getTaskcode()); + if (!taskInfo.getFlag().equals(TaskInfo.DOING)){ + return success(); + } + + taskLocationInfo.setTaskworker(getUser().getRealname()); + taskLocationInfo.setUpdatetime(new Date()); + taskLocationService.save(taskLocationInfo); + return msg; + } + + @GetMapping("/getTaskGas") + @ApiOperation(value = "获取作业气体浓度",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "taskcode",value = "作业编号"), + @ApiImplicitParam(name = "gastype",value = "气体类型") + }) + public Msg getTaskGas(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort, String order, + String taskcode, String gastype){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(gastype)) { + condition.put("gastype", gastype.trim()); + } + + if (StringUtils.isNotBlank(taskcode)) { + condition.put("taskcode", taskcode.trim()); + } + + pageInfo.setCondition(condition); + taskGasService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @GetMapping("/getTaskVideo") + @ApiOperation(value = "获取视频token",response = Msg.class) + public Msg getTaskVideo(){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + VideoInfo videoInfo = videoService.getById(1); + msg.setResult(videoInfo.getToken()); + return msg; + } + + @GetMapping("getEquipment") + @ApiOperation(value = "根据Number获取设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "number",value = "设备编号"), + }) + public Msg getEquipmentByNumber(@RequestParam("number") String number){ + if (StringUtils.isBlank(number)){ + return new Msg(ErrorCode.ERROR_10001); + } + EquipmentInfo equipmentInfo = equipmentService.selectByNumber(number); + return success(equipmentInfo); + } + + @PostMapping("getEquipments") + @ApiOperation(value = "根据Number获取设备信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "number",value = "设备编号"), + }) + public Msg getEquipmentsByNumbers(@RequestBody JSONObject jsonObject){ + JSONArray array = jsonObject.getJSONArray("numbers"); + if (array == null || array.size() < 1){ + return new Msg(ErrorCode.ERROR_10001); + } + List<EquipmentInfo> equipmentInfos = new ArrayList<>(); + for (int i = 0; i < array.size(); i++){ + String number = array.getString(i); + if (StringUtils.isBlank(number)){ + return new Msg(ErrorCode.ERROR_10001); + } + EquipmentInfo equipmentInfo = equipmentService.selectByNumber(number); + equipmentInfos.add(equipmentInfo); + } + return success(equipmentInfos); + } + + @GetMapping("/lastGas") + public Msg getLastGas(@RequestParam("taskCode") String taskCode, + @RequestParam("worker") String worker){ + if (StringUtils.isBlank(taskCode)){ + return new Msg(ErrorCode.ERROR_10001); + } + List<TaskGasInfo> taskGasInfos = taskGasService.selectLastGas(taskCode,worker); + return success(taskGasInfos); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/UserController.java b/src/main/java/com/gk/hotwork/Controller/UserController.java new file mode 100644 index 0000000..8cb301f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/UserController.java @@ -0,0 +1,1600 @@ +package com.gk.hotwork.Controller; +import java.util.Date; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Utils.Properties; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import com.gk.hotwork.Domain.Vo.UserVo; +import com.gk.hotwork.Domain.Vo.WorkCertVo; +import com.gk.hotwork.Service.*; +import io.swagger.annotations.*; +import org.apache.catalina.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.*; + +@Api(tags = "用户管理数据接口") +@RestController +public class UserController extends BaseController { + + @Autowired + UserService userService; + @Autowired + RoleService roleService; + @Autowired + UserRolesService userRolesService; + @Autowired + RolePermissionsService rolePermissionsService; + @Autowired + ExcelExportService excelExportService; + @Autowired + DistrictService districtService; + @Autowired + UserRolesService userRolesInfoService; + @Autowired + CompanyService companyService; + @Autowired + DepartmentService departmentService; + @Autowired + InvolveDepService involveDepService; + @Autowired + ExamScoreService examscoreService; + @Autowired + WorkCertService workCertService; + @Autowired + private BlackListService blackListService; + @Autowired + private DeviceLocationService deviceLocationService; + @Value("${workname}") + private String workname; + @Value("${workCert}") + private String workCert; + + @Value("${filePath}") + private String filePath; //配置文件配置的物理保存地址 + @Value("${slice.size}") + private Integer sliceSize; + + @GetMapping("/user") + @ApiOperation(value = "获取用户数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "username",value = "用户名"), + @ApiImplicitParam(name = "company",value = "单位"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "realname",value = "姓名"), + @ApiImplicitParam(name = "idcard",value = "身份证号"), + @ApiImplicitParam(name = "ispass",value = "是否通过考试"), + }) + public Msg getUserInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String username,String company, String department,String realname, String idcard,Byte ispass,@RequestParam(required = false,defaultValue = "true") Boolean isMain){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(username)) { + condition.put("username", username.trim()); + } + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + if (StringUtils.isNotBlank(department)) { + condition.put("department", department.trim()); + } + + if (StringUtils.isNotBlank(realname)){ + condition.put("realname",realname.trim()); + } + + if (StringUtils.isNotBlank(idcard)){ + condition.put("idcard",idcard.trim()); + } + + if (ispass != null){ + condition.put("ispass",ispass); + } + + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + if (userInfo.getType() == 3){ + condition.put("username", userInfo.getUsername()); + } + +// if (!companyService.isMain(userInfo.getCompany())){ +// condition.put("company", userInfo.getCompany()); +// } + //是系统菜单下的就显示主体,否则非主体 +// if (isMain) { +// condition.put("isMain", 1); +// } else { +// condition.put("isMain", 0); +// } + + pageInfo.setCondition(condition); + userService.selectUserDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @ApiOperation("/获取所有未被删除的人员") + @PostMapping("/getUserList") + @ApiImplicitParams({ + }) + public Msg getUserList() { + return success(userService.getUserList()); + } + + + @GetMapping("/userList") + @ApiOperation(value = "获取对应单位、部门的人员",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "company",value = "单位"), + @ApiImplicitParam(name = "department",value = "部门"), + }) + public Msg getUserList(String company,String department){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + HashMap<String, Object> condition = new HashMap<String, Object>(); + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + if (StringUtils.isNotBlank(department)) { + condition.put("department", department.trim()); + } + condition.put("examtype",workname); + List<UserVo> userVoList = new ArrayList<>(); + List<UserVo> userInfoList = userService.selectAll(condition); +// for (UserVo userVo : userInfoList){ +// List<WorkCertInfo> workCertInfo = workCertService.selectByMobile(userVo.getUsername()); +// if (workCertInfo.size() > 0){ +// userVo.setBranch(workCertInfo.get(0).getBranch()); +// userVo.setNumber(workCertInfo.get(0).getCertname()); +// userVoList.add(userVo); +// } +// } + msg.setResult(userInfoList); + return msg; + } + + + @PostMapping("/adduser") + @ApiOperation(value = "添加用户数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "手机号",required = true), + @ApiImplicitParam(name = "password",value = "密码",required = true), + @ApiImplicitParam(name = "type",value = "用户类型",required = true), + @ApiImplicitParam(name = "email",value = "邮箱"), + @ApiImplicitParam(name = "company",value = "单位"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "job",value = "职务"), + @ApiImplicitParam(name = "realname",value = "姓名"), + @ApiImplicitParam(name = "idcard",value = "身份证"), + @ApiImplicitParam(name = "iscompany",value = "是否单位负责人"), + @ApiImplicitParam(name = "isdepartment",value = "是否部门负责人"), + @ApiImplicitParam(name = "status",value = "状态"), + }) + public Msg addUserInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + UserInfo userInfo = new UserInfo(); + UserInfo userInfoCurrent = userService.selectByUser(getUser().getUsername()); + String password = jsonObject.getString("password"); + String PW_PATTERN = "(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@#$%^&*_.]).{8,}"; + if (!password.matches(PW_PATTERN)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("密码必须8位以上,并且包含大小写字母、数字、特殊符号三种以上"); + return msg; + }else { + userInfo.setPassword(MD5Utils.encode(password)); + } + String username = jsonObject.getString("username"); + if (StringUtils.isNotBlank(username) && username.length() == 11){ + userInfo.setUsername(username); + }else{ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("手机号必须为11位数"); + return msg; + } + + try { + userInfo.setType(jsonObject.getInteger("type")); + }catch (Exception e) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("用户类型必须为数字"); + return msg; + } + + String realname = jsonObject.getString("realname"); + if (StringUtils.isBlank(realname)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("姓名不能为空"); + return msg; + } + + + String idcard = jsonObject.getString("idcard"); + if (StringUtils.isNotBlank(idcard)){ + UserInfo idCardExist = userService.selectByIdCard(null,idcard); + if (null != idCardExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("身份证重复"); + return msg; + }else{ + userInfo.setIdcard(idcard); + } + + if (!IdCardUtil.strongVerifyIdNumber(idcard)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("身份证非法"); + return msg; + } + } + Long companyid = jsonObject.getLong("companyid"); + if (companyid == null) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位参数为空"); + return msg; + } + CompanyInfo companyInfo = companyService.getById(companyid); + if (companyInfo == null) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位不存在"); + return msg; + } + if (jsonObject.getLong("department") != null) { + DepartmentInfo department = departmentService.getById(jsonObject.getLong("department")); + if (department == null) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("部门不存在"); + return msg; + } + userInfo.setDepartment(department.getId()); + } + + userInfo.setEmail(jsonObject.getString("email")); + userInfo.setCompany(companyInfo.getCompany()); + userInfo.setCompanyid(companyid); + if (!companyService.isMain(userInfoCurrent.getCompany())){ + userInfo.setCompany(userInfoCurrent.getCompany()); + } + + + + userInfo.setJob(jsonObject.getString("job")); + userInfo.setIscompany(jsonObject.getByte("iscompany")); + userInfo.setIsdepartment(jsonObject.getByte("isdepartment")); + userInfo.setStatus(jsonObject.getByte("status")); + userInfo.setCreatedby(getUser().getRealname()); + userInfo.setIssecurityofficer(jsonObject.getByte("issecurityofficer")); + userInfo.setRealname(realname); + userInfo.setCreateddate(new Date()); + userInfo.setLastmodifiedby(getUser().getRealname()); + userInfo.setLastmodifieddate(new Date()); + userInfo.setIsdel((byte)0); + userInfo.setIsupload((byte)0); + List<UserInfo> userInfoExist = userService.selectUserInfo(null,userInfo.getUsername()); + if (userInfoExist.size() > 0){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("用户名重复"); + return msg; + } + String empNo = jsonObject.getString("empNo"); + String deviceNo = jsonObject.getString("deviceNo"); + if (StringUtils.isNotBlank(empNo) + && StringUtils.isNotBlank(deviceNo)){ + try { + Msg msg1 = userService.saveEmployee(realname,empNo,deviceNo); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg1; + } + userInfo.setEmpNo(empNo); + userInfo.setDeviceNo(deviceNo); + userInfo.setCardId(msg.getResult().toString()); + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + + } + + int userSize = userService.selectUserSize(); + int sli = (userSize + 1) % sliceSize; + userInfo.setSlice(sli + ""); + if (sli == 0) + userInfo.setSlice(sliceSize + ""); + userService.save(userInfo); + return msg; + } + + @PostMapping("/importUser") + @ApiOperation(value = "导入用户数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "file",value = "文件",required = true), + }) + @ResponseBody + public Msg importUser(MultipartFile file){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmssSSS" ); + if (file == null) + { + msg.setCode("404"); + msg.setMessage("未找到上传文件"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if (!FileOptUtils.isDirExists(filePath)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + getUser().getRealname() + "_" + sdf.format(new Date()) + ".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + excelExportService.importUserExcel(in, getUser().getRealname(), isExcel2007); + + } catch (BusinessException e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + } + + return msg; + } + + @PostMapping("/importSupplierUser") + @ApiOperation(value = "导入供应商用户数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "file",value = "文件",required = true), + }) + @ResponseBody + public Msg importSupplierUser(MultipartFile file){ + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + String filesave =""; + try { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmssSSS" ); + if (file == null) + { + return new Msg(ErrorCode.ERROR_10001,"未找到上传文件"); + } + + long size = file.getSize(); + if(0 == size) + { + return new Msg(ErrorCode.ERROR_10004,"上传文件大小为空"); + } + + if(!FileOptUtils.isDirExists(filePath)){ + return new Msg(ErrorCode.ERROR_40001,"发生错误或不为目录"); + } + + filesave = filePath + getUser().getRealname() + "_" + sdf.format(new Date()) +".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx")? true:false; + BooleanReason blret = excelExportService.importSupplierUserExcel(in,userInfo.getRealname(),userInfo.getCompany(),isExcel2007); + if(blret.getValue().equals(false)) + { + return new Msg(ErrorCode.ERROR_10004,blret.getResultmsg()); + } + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_10004,"导入发生错误"); + } + + return success(); + } + + @PostMapping("/putuser") + @ApiOperation(value = "修改用户数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "用户id",required = true), + @ApiImplicitParam(name = "username",value = "手机号",required = true), + @ApiImplicitParam(name = "password",value = "密码",required = true), + @ApiImplicitParam(name = "type",value = "用户类型",required = true), + @ApiImplicitParam(name = "email",value = "邮箱"), + @ApiImplicitParam(name = "company",value = "单位"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "job",value = "职务"), + @ApiImplicitParam(name = "realname",value = "姓名"), + @ApiImplicitParam(name = "idcard",value = "身份证"), + @ApiImplicitParam(name = "iscompany",value = "是否单位负责人"), + @ApiImplicitParam(name = "isdepartment",value = "是否部门负责人"), + @ApiImplicitParam(name = "status",value = "状态"), + }) + public Msg putUserInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + UserInfo userInfo = new UserInfo(); + userInfo.setId(jsonObject.getLong("id")); + String password = jsonObject.getString("password"); + String PW_PATTERN = "(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@#$%^&*_.]).{8,}"; + + if (StringUtils.isNotBlank(password)){ + if (!password.matches(PW_PATTERN)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("密码必须8位以上,并且包含大小写字母、数字、特殊符号三种以上"); + return msg; + }else { + userInfo.setPassword(MD5Utils.encode(password)); + } + } + + String username = jsonObject.getString("username"); + if (StringUtils.isNotBlank(username) && username.length() == 11){ + userInfo.setUsername(username); + }else{ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("手机号必须为11位数"); + return msg; + } + + try { + userInfo.setType(jsonObject.getInteger("type")); + }catch (Exception e) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("用户类型必须为数字"); + return msg; + } + + String realname = jsonObject.getString("realname"); + if (StringUtils.isBlank(realname)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("姓名不能为空"); + return msg; + } + + String idcard = jsonObject.getString("idcard"); + if (StringUtils.isNotBlank(idcard)){ + UserInfo idCardExist = userService.selectByIdCard(userInfo.getId(),idcard); + if (null != idCardExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("身份证重复"); + return msg; + }else{ + userInfo.setIdcard(idcard); + } + if (!IdCardUtil.strongVerifyIdNumber(idcard)) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("身份证非法"); + return msg; + } + } + + Long companyid = jsonObject.getLong("companyid"); + if (companyid == null) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位参数为空"); + return msg; + } + CompanyInfo companyInfo = companyService.getById(companyid); + if (companyInfo == null) { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位不存在"); + return msg; + } + + userInfo.setEmail(jsonObject.getString("email")); + userInfo.setCompany(companyInfo.getCompany()); + userInfo.setCompanyid(companyInfo.getId()); + userInfo.setDepartment(jsonObject.getLong("department")); + userInfo.setJob(jsonObject.getString("job")); + userInfo.setIscompany(jsonObject.getByte("iscompany")); + userInfo.setIsdepartment(jsonObject.getByte("isdepartment")); + userInfo.setIssecurityofficer(jsonObject.getByte("issecurityofficer")); + userInfo.setStatus(jsonObject.getByte("status")); + userInfo.setLastmodifiedby(getUser().getRealname()); + userInfo.setLastmodifieddate(new Date()); + userInfo.setIsdel((byte)0); + userInfo.setRealname(realname); + List<UserInfo> userInfoExist = userService.selectUserInfo(userInfo.getId(),userInfo.getUsername()); + if (userInfoExist.size() > 0){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("用户名重复"); + return msg; + } + + userService.updateById(userInfo); + return msg; + + } + + @PostMapping("/userroles") + @ApiOperation(value = "修改用户角色",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "用户id",required = true), + @ApiImplicitParam(name = "roles",value = "用户名",required = true), + + }) + public Msg updateUserRole(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + Long userid = jsonObject.getLong("id"); + String roles = jsonObject.getString("roles"); + if (StringUtils.isNotBlank(roles)){ + userRolesInfoService.deleteByUserId(userid); + roles = roles.replace("[","").replace("]",""); + List<String> list = StringUtils.toList(roles); + for (String role : list){ + UserRolesInfo userRolesInfo = new UserRolesInfo(); + userRolesInfo.setUserid(userid); + userRolesInfo.setRoleid(Long.parseLong(role.trim())); + userRolesInfoService.save(userRolesInfo); + } + } + return msg; + + } + + @PostMapping("/deluser") + @ApiOperation(value = "删除用户数据", notes = "删除用户数据", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true), + @ApiImplicitParam(paramType="body",name = "lastmodifiedby",value = "更新人"), + + }) + public Msg delUserInfo(@ApiParam(value = "id") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + UserInfo userInfo = new UserInfo(); + userInfo.setId(jsonObject.getLong("id")); + userInfo.setLastmodifiedby(getUser().getRealname()); + userInfo.setLastmodifieddate(new Date()); + userInfo.setStatus((byte)0); + userService.updateById(userInfo); + String cardId = userInfo.getCardId(); + if (StringUtils.isNotBlank(cardId)){ + try { + String isValid = "1"; + Msg msg1 = userService.setCardValid(isValid,cardId); + if (!msg1.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg1; + } + Msg msg2 = userService.delEmployee(cardId); + if (!msg2.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg2; + } + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + userInfo.setDeviceNo(""); + userInfo.setEmpNo(""); + userInfo.setCardId(""); + } + + return msg; + } + + @PostMapping("/importDistrict") + @ApiOperation(value = "导入省市数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "file",value = "文件",required = true), + @ApiImplicitParam(name = "operator",value = "操作人",required = true), + }) + @ResponseBody + public Msg importDistrict(String operator,MultipartFile file){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + String filesave =""; + try { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmssSSS" ); + if (file == null) + { + msg.setCode("404"); + msg.setMessage("未找到上传文件"); + return msg; + } + + long size = file.getSize(); + if(0 == size) + { + msg.setCode("404"); + msg.setMessage("上传文件大小为空"); + return msg; + } + + if(!FileOptUtils.isDirExists(filePath)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("发生错误或不为目录"); + return msg; + } + + filesave = filePath + operator + "_" + sdf.format(new Date()) +".xlsx"; + + file.transferTo(new File(filesave)); + InputStream in = new FileInputStream(filesave); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx")? true:false; + BooleanReason blret = excelExportService.importDistrictExcel(in,operator,isExcel2007); + if(blret.getValue().equals(false)) + { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage(blret.getResultmsg()); + return msg; + } + } catch (Exception e) { + e.printStackTrace(); + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("导入发生错误"); + return msg; + } + + return msg; + } + + @GetMapping("/district") + @ApiOperation(value = "获取省市区数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "type",value = "类型"), + @ApiImplicitParam(name = "parentname",value = "上级名称"), + @ApiImplicitParam(name = "parenttype",value = "上级类型"), + }) + public Msg getdistrictInfo(String type,String parentname,String parenttype){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + List<DistrictInfo> districtInfoList = new ArrayList<> (); + if (parenttype.equals("0")){ + districtInfoList = districtService.selectDistrictInfo(type, parenttype); + }else { + districtInfoList = districtService.selectDistrictByName(type,parentname,parenttype); + } + msg.setResult(districtInfoList); + return msg; + } + + @GetMapping("/districtByName") + @ApiOperation(value = "获取省市区数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "province",value = "省份"), + @ApiImplicitParam(name = "city",value = "城市"), + @ApiImplicitParam(name = "area",value = "区县"), + @ApiImplicitParam(name = "town",value = "街道"), + @ApiImplicitParam(name = "community",value = "社区"), + }) + public Msg getDistrictByName(String province,String city,String area,String town,String community){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + if (StringUtils.isBlank(province)){ + List<DistrictInfo> provinceList = districtService.selectDistrictInfo("1", "0"); + Map<String,Object> map = new HashMap<> (); + map.put("provinceList",provinceList); + msg.setResult(map); + }else if (StringUtils.isBlank(city)){ + List<DistrictInfo> provinceList = districtService.selectDistrictInfo("1", "0"); + DistrictInfo provinceInfo = districtService.selectInfoByName(province,(byte)1); + List<DistrictInfo> cityList = districtService.selectDistrictInfo("2", provinceInfo.getCode()); + Map<String,Object> map = new HashMap<> (); + map.put("provinceList",provinceList); + map.put("cityList",cityList); + msg.setResult(map); + }else if (StringUtils.isBlank(area)){ + List<DistrictInfo> provinceList = districtService.selectDistrictInfo("1", "0"); + DistrictInfo provinceInfo = districtService.selectInfoByName(province,(byte)1); + List<DistrictInfo> cityList = districtService.selectDistrictInfo("2", provinceInfo.getCode()); + DistrictInfo cityInfo = districtService.selectInfoByName(city,(byte)2); + List<DistrictInfo> areaList = districtService.selectDistrictInfo("3", cityInfo.getCode()); + Map<String,Object> map = new HashMap<> (); + map.put("provinceList",provinceList); + map.put("cityList",cityList); + map.put("areaList",areaList); + msg.setResult(map); + }else if (StringUtils.isBlank(town)){ + List<DistrictInfo> provinceList = districtService.selectDistrictInfo("1", "0"); + DistrictInfo provinceInfo = districtService.selectInfoByName(province,(byte)1); + List<DistrictInfo> cityList = districtService.selectDistrictInfo("2", provinceInfo.getCode()); + DistrictInfo cityInfo = districtService.selectInfoByName(city,(byte)2); + List<DistrictInfo> areaList = districtService.selectDistrictInfo("3", cityInfo.getCode()); + DistrictInfo areaInfo = districtService.selectInfoByName(area,(byte)3); + List<DistrictInfo> townList = districtService.selectDistrictInfo("4", areaInfo.getCode()); + + Map<String,Object> map = new HashMap<> (); + map.put("provinceList",provinceList); + map.put("cityList",cityList); + map.put("areaList",areaList); + map.put("townList",townList); + msg.setResult(map); + }else{ + List<DistrictInfo> provinceList = districtService.selectDistrictInfo("1", "0"); + DistrictInfo provinceInfo = districtService.selectInfoByName(province,(byte)1); + List<DistrictInfo> cityList = districtService.selectDistrictInfo("2", provinceInfo.getCode()); + DistrictInfo cityInfo = districtService.selectInfoByName(city,(byte)2); + List<DistrictInfo> areaList = districtService.selectDistrictInfo("3", cityInfo.getCode()); + DistrictInfo areaInfo = districtService.selectInfoByName(area,(byte)3); + List<DistrictInfo> townList = districtService.selectDistrictInfo("4", areaInfo.getCode()); + DistrictInfo townInfo = districtService.selectInfoByName(town,(byte)4); + List<DistrictInfo> communityList = districtService.selectDistrictInfo("5", townInfo.getCode()); + + Map<String,Object> map = new HashMap<> (); + map.put("provinceList",provinceList); + map.put("cityList",cityList); + map.put("areaList",areaList); + map.put("townList",townList); + map.put("communityList",communityList); + msg.setResult(map); + } + return msg; + } + + @GetMapping("/company") + @ApiOperation(value = "获取单位数据",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "code",value = "单位代码"), + @ApiImplicitParam(name = "company",value = "单位名称"), + @ApiImplicitParam(name = "province",value = "省份"), + @ApiImplicitParam(name = "city",value = "城市"), + @ApiImplicitParam(name = "area",value = "区县"), + @ApiImplicitParam(name = "town",value = "街道"), + @ApiImplicitParam(name = "community",value = "社区"), + @ApiImplicitParam(name = "isMain",value = "是否是主体"), + }) + public Msg getCompanyInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String code,String company,String province,String city,String area,String town,String community,@RequestParam(defaultValue = "true") Boolean isMain){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(code)) { + condition.put("code", code.trim()); + } + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + if (StringUtils.isNotBlank(province)) { + condition.put("province", province.trim()); + } + + if (StringUtils.isNotBlank(city)) { + condition.put("city", city.trim()); + } + + if (StringUtils.isNotBlank(area)) { + condition.put("area", area.trim()); + } + + if (StringUtils.isNotBlank(town)) { + condition.put("town", town.trim()); + } + + if (StringUtils.isNotBlank(community)) { + condition.put("community", community.trim()); + } + UserInfo userInfo = userService.selectByUser(getUser().getUsername()); + if (!companyService.isMain(userInfo.getCompany())){ + condition.put("company",userInfo.getCompany()); + } + //是系统菜单下的就显示主体,否则非主体 +// if (isMain) { +// condition.put("isMain", 1); +// } else { +// condition.put("isMain", 0); +// } + pageInfo.setCondition(condition); + companyService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @GetMapping("/companyList") + @ApiOperation(value = "获取所有单位",response = Msg.class) + public Msg getCompanyList(){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<CompanyInfo> companyList = companyService.selectByAll(); + msg.setResult(companyList); + return msg; + } + + @PostMapping("/addCompany") + @ApiOperation(value = "添加单位信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "单位代码"), + @ApiImplicitParam(name = "company",value = "单位名称"), + @ApiImplicitParam(name = "contactname",value = "联系人"), + @ApiImplicitParam(name = "contactphone",value = "联系电话"), + @ApiImplicitParam(name = "province",value = "省份"), + @ApiImplicitParam(name = "city",value = "城市"), + @ApiImplicitParam(name = "area",value = "区县"), + @ApiImplicitParam(name = "town",value = "街道"), + @ApiImplicitParam(name = "community",value = "社区"), + }) + public Msg addCompanyInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + CompanyInfo companyInfo = new CompanyInfo(); + companyInfo.setCode(jsonObject.getString("code")); + companyInfo.setCompany(jsonObject.getString("company")); + companyInfo.setContactname(jsonObject.getString("contactname")); + companyInfo.setContactphone(jsonObject.getString("contactphone")); + companyInfo.setIsmain(jsonObject.getByte("ismain")); + companyInfo.setProvince(jsonObject.getString("province")); + companyInfo.setCity(jsonObject.getString("city")); + companyInfo.setArea(jsonObject.getString("area")); + companyInfo.setTown(jsonObject.getString("town")); + companyInfo.setCommunity(jsonObject.getString("community")); + companyInfo.setCreatedby(getUser().getRealname()); + companyInfo.setCreateddate(new Date()); + companyInfo.setLastmodifiedby(getUser().getRealname()); + companyInfo.setLastmodifieddate(new Date()); + companyInfo.setIsdel((byte)0); + if(StringUtils.isNotBlank(companyInfo.getCode())){ + if (companyInfo.getCode().length() > 6){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位代码不能超过6位"); + return msg; + }else { + companyInfo.setCode(companyInfo.getCode().toUpperCase()); + } + } + if (companyInfo.getIsmain() == 1){ + CompanyInfo companyMain = companyService.selectExistMain(null); + if (companyMain != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在主体单位"); + return msg; + } + } + CompanyInfo companyInfoExist = companyService.selectExistByName(null,companyInfo.getCompany()); + if (null != companyInfoExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位名称重复"); + return msg; + }else { + companyService.save(companyInfo); + } + return msg; + } + + @PostMapping("/putCompany") + @ApiOperation(value = "修改单位信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "code",value = "单位代码"), + @ApiImplicitParam(name = "company",value = "单位名称"), + @ApiImplicitParam(name = "contactname",value = "联系人"), + @ApiImplicitParam(name = "contactphone",value = "联系电话"), + @ApiImplicitParam(name = "province",value = "省份"), + @ApiImplicitParam(name = "city",value = "城市"), + @ApiImplicitParam(name = "area",value = "区县"), + @ApiImplicitParam(name = "town",value = "街道"), + @ApiImplicitParam(name = "community",value = "社区"), + }) + public Msg putCompanyInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + CompanyInfo companyInfo = new CompanyInfo(); + companyInfo.setId(jsonObject.getLong("id")); + companyInfo.setCode(jsonObject.getString("code")); + companyInfo.setCompany(jsonObject.getString("company")); + companyInfo.setContactname(jsonObject.getString("contactname")); + companyInfo.setContactphone(jsonObject.getString("contactphone")); + companyInfo.setIsmain(jsonObject.getByte("ismain")); + companyInfo.setProvince(jsonObject.getString("province")); + companyInfo.setCity(jsonObject.getString("city")); + companyInfo.setArea(jsonObject.getString("area")); + companyInfo.setTown(jsonObject.getString("town")); + companyInfo.setCommunity(jsonObject.getString("community")); + companyInfo.setLastmodifiedby(getUser().getRealname()); + companyInfo.setLastmodifieddate(new Date()); + companyInfo.setIsdel((byte)0); + if(StringUtils.isNotBlank(companyInfo.getCode())){ + if (companyInfo.getCode().length() > 6){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位代码不能超过6位"); + return msg; + }else { + companyInfo.setCode(companyInfo.getCode().toUpperCase()); + } + } + if (companyInfo.getIsmain() == 1){ + CompanyInfo companyMain = companyService.selectExistMain(companyInfo.getId()); + if (companyMain != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在主体单位"); + return msg; + } + } + CompanyInfo companyInfoExist = companyService.selectExistByName(companyInfo.getId(),companyInfo.getCompany()); + if (null != companyInfoExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("单位名称重复"); + return msg; + }else { + companyService.updateById(companyInfo); + } + return msg; + } + + @PostMapping("/delCompany") + @ApiOperation(value = "删除单位信息", notes = "删除单位信息", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true) + }) + public Msg delCompanyInfo(@ApiParam(value = "id") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + CompanyInfo companyInfo = new CompanyInfo(); + companyInfo.setId(jsonObject.getLong("id")); + companyInfo.setLastmodifiedby(getUser().getRealname()); + companyInfo.setLastmodifieddate(new Date()); + companyInfo.setIsdel((byte)1); + companyService.updateById(companyInfo); + return msg; + } + + @GetMapping("/department") + @ApiOperation(value = "获取部门信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "sort",value = "排序规则"), + @ApiImplicitParam(name = "order",value = "排序字段"), + @ApiImplicitParam(name = "department",value = "部门") + }) + public Msg getDepartmentInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String department){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<String, Object>(); + + if (StringUtils.isNotBlank(department)) { + condition.put("department", department.trim()); + } + + pageInfo.setCondition(condition); + departmentService.selectDataGrid(pageInfo); + msg.setResult(pageInfo); + return msg; + } + + @GetMapping("/departmentList") + @ApiOperation(value = "获取所有部门",response = Msg.class) + public Msg getDepartmentList(){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + + List<DepartmentVo> departmentVoList = departmentService.selectByAll(); + msg.setResult(departmentVoList); + return msg; + } + + @PostMapping("/addDepartment") + @ApiOperation(value = "添加部门信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "issafety",value = "是否为安全部门 1或0"), + @ApiImplicitParam(name = "isinvolve",value = "是否为涉及部门 1或0"), + @ApiImplicitParam(name = "isanalysis",value = "是否为检测中心 1或0"), + }) + public Msg addDepartmentInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + DepartmentInfo departmentInfo = new DepartmentInfo(); + departmentInfo.setDepartment(jsonObject.getString("department")); + departmentInfo.setCreatedby(getUser().getRealname()); + departmentInfo.setCreateddate(new Date()); + departmentInfo.setLastmodifiedby(getUser().getRealname()); + departmentInfo.setLastmodifieddate(new Date()); + departmentInfo.setIsdel((byte)0); + + Byte issafety = jsonObject.getByte("issafety"); + if (issafety == 1){ + DepartmentInfo department = departmentService.selectSafety(null); + if (department != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在安全管理部门"); + return msg; + } + } + departmentInfo.setIssafety(issafety); + + Byte isanalysis = jsonObject.getByte("isanalysis"); + if (isanalysis == 1){ + DepartmentInfo department = departmentService.selectAnalysis(null); + if (department != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在检测中心"); + return msg; + } + } + departmentInfo.setIsanalysis(isanalysis); + + DepartmentInfo departmentInfoExist = departmentService.selectExistByName(null,departmentInfo.getDepartment()); + if (null != departmentInfoExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("部门名称重复"); + return msg; + }else { + departmentService.save(departmentInfo); + } + + Byte isinvole = jsonObject.getByte("isinvolve"); + if (isinvole != null && isinvole == 1){ + InvolveDepInfo involveDepInfo = new InvolveDepInfo(); + involveDepInfo.setDepartment(departmentInfo.getDepartment()); + involveDepInfo.setLastmodifiedby(getUser().getRealname()); + involveDepInfo.setLastmodifieddate(new Date()); + involveDepService.save(involveDepInfo); + } + + return msg; + } + + @PostMapping("/putDepartment") + @ApiOperation(value = "修改部门信息",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id"), + @ApiImplicitParam(name = "department",value = "部门"), + @ApiImplicitParam(name = "issafety",value = "是否为安全部门 1或0"), + @ApiImplicitParam(name = "isinvolve",value = "是否为涉及部门 1或0"), + }) + public Msg putDepartmentInfo(@RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + DepartmentInfo departmentInfo = departmentService.getById(jsonObject.getLong("id")); + departmentInfo.setDepartment(jsonObject.getString("department")); + departmentInfo.setIssafety(jsonObject.getByte("issafety")); + departmentInfo.setLastmodifiedby(getUser().getRealname()); + departmentInfo.setLastmodifieddate(new Date()); + + Byte issafety = jsonObject.getByte("issafety"); + if (issafety == 1){ + DepartmentInfo department = departmentService.selectSafety(departmentInfo.getId()); + if (department != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在安全管理部门"); + return msg; + } + } + + Byte isanalysis = jsonObject.getByte("isanalysis"); + if (isanalysis == 1){ + DepartmentInfo department = departmentService.selectAnalysis(departmentInfo.getId()); + if (department != null && department.getId() != null){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("已存在检测中心"); + return msg; + } + } + departmentInfo.setIsanalysis(isanalysis); + + DepartmentInfo departmentInfoExist = departmentService.selectExistByName(departmentInfo.getId(),departmentInfo.getDepartment()); + if (null != departmentInfoExist){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("部门名称重复"); + return msg; + }else { + departmentService.updateById(departmentInfo); + } + + involveDepService.deleteByName(departmentInfo.getDepartment()); + Byte isinvole = jsonObject.getByte("isinvolve"); + if (isinvole != null && isinvole == 1){ + InvolveDepInfo involveDepInfo = new InvolveDepInfo(); + involveDepInfo.setDepartment(departmentInfo.getDepartment()); + involveDepInfo.setLastmodifiedby(getUser().getRealname()); + involveDepInfo.setLastmodifieddate(new Date()); + involveDepService.save(involveDepInfo); + } + return msg; + } + + @PostMapping("/delDepartment") + @ApiOperation(value = "删除部门信息", notes = "删除部门信息", response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(paramType="query",name = "id",value = "id",required = true) + }) + public Msg delDepartmentInfo(@ApiParam(value = "id") + @RequestBody JSONObject jsonObject){ + Msg msg = new Msg(); + msg.setCode("200"); + msg.setMessage("success"); + DepartmentInfo departmentInfo = departmentService.getById(jsonObject.getLong("id")); + departmentInfo.setLastmodifiedby(getUser().getRealname()); + departmentInfo.setLastmodifieddate(new Date()); + departmentInfo.setIsdel((byte)1); + departmentService.updateById(departmentInfo); + involveDepService.deleteByName(departmentInfo.getDepartment()); + return msg; + } + + + @GetMapping(value = "/getWorkCert") + @ApiOperation(value = "获取作业证书",httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "mobile",value = "手机号",required = true), + }) + public Msg getWorkCert(String mobile){ + Msg msg = new Msg(); + msg.setCode("200"); + if (StringUtils.isBlank(mobile)){ + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("手机号不能为空"); + return msg; + } + List<WorkCertInfo> workCertInfos = workCertService.selectByMobile(mobile); + msg.setResult(workCertInfos); + return msg; + } + + @PostMapping(value = "/addWorkCert") + @ApiOperation(value = "新增作业证书",httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "realname",value = "姓名",required = true), + @ApiImplicitParam(name = "mobile",value = "手机号",required = true), + @ApiImplicitParam(name = "idcard",value = "身份证"), + @ApiImplicitParam(name = "certname",value = "文件名"), + @ApiImplicitParam(name = "starttime",value = "有效开始时间"), + @ApiImplicitParam(name = "endtime",value = "有效结束时间"), + @ApiImplicitParam(name = "file",value = "上传文件,单个"), + }) + Object addWorkCert(WorkCertVo workCertVo){ + Msg msg = new Msg(); + msg.setCode("200"); + try { + WorkCertInfo workCertInfo = BeanUtils.copy(workCertVo,WorkCertInfo.class); + if (workCertVo.getFile() != null) { + String name = UploadUtil.uploadFile(workCertVo.getFile(), Properties.workCertPath); + workCertInfo.setCertpath(workCert+name); + }else { + msg.setCode(ErrorCode.ERROR_10004.getCode()); + msg.setMessage("上传文件不能为空"); + } + workCertInfo.setCreateby(getUser().getRealname()); + workCertInfo.setCreatetime(new Date()); + workCertInfo.setIsdel((byte)0); + workCertService.save(workCertInfo); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("400"); + msg.setMessage(e.getMessage()); + } + return msg; + } + + @PostMapping(value = "/editWorkCert") + @ApiOperation(value = "修改作业证书",httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id",required = true), + @ApiImplicitParam(name = "certname",value = "文件名"), + @ApiImplicitParam(name = "starttime",value = "有效开始时间"), + @ApiImplicitParam(name = "endtime",value = "有效结束时间"), + @ApiImplicitParam(name = "file",value = "上传文件,单个"), + }) + Object editWorkCert(WorkCertVo workCertVo){ + Msg msg = new Msg(); + msg.setCode("200"); + try { + WorkCertInfo workCertInfo = workCertService.getById(workCertVo.getId()); + if (workCertVo.getFile() != null) { + String name = UploadUtil.uploadFile(workCertVo.getFile(), Properties.workCertPath); + workCertInfo.setCertpath(workCert+name); + } + workCertInfo.setStarttime(workCertVo.getStarttime()); + workCertInfo.setEndtime(workCertVo.getEndtime()); + workCertInfo.setCreateby(getUser().getRealname()); + workCertInfo.setCreatetime(new Date()); + workCertService.updateById(workCertInfo); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("400"); + msg.setMessage(e.getMessage()); + } + return msg; + } + + @PostMapping(value = "/delWorkCert") + @ApiOperation(value = "删除作业证书",httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id",value = "id",required = true), + }) + public Msg delWorkCert(@RequestBody WorkCertVo workCertVo){ + Msg msg = new Msg(); + msg.setCode("200"); + try { + WorkCertInfo workCertInfo = workCertService.getById(workCertVo.getId()); + workCertInfo.setCreateby(getUser().getRealname()); + workCertInfo.setCreatetime(new Date()); + workCertInfo.setIsdel((byte)1); + workCertService.updateById(workCertInfo); + } catch (Exception e) { + e.printStackTrace(); + msg.setCode("400"); + msg.setMessage(e.getMessage()); + } + return msg; + } + + @GetMapping("/blackList") + @ApiOperation(value = "获取黑名单详情",httpMethod = "POST") + public Msg getBlackList(@RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, + String company){ + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + HashMap<String, Object> condition = new HashMap<>(); + + if (StringUtils.isNotBlank(company)) { + condition.put("company", company.trim()); + } + + pageInfo.setCondition(condition); + blackListService.selectDataGrid(pageInfo); + return success(pageInfo); + } + + @PostMapping("/banCompany") + @ApiOperation(value = "添加黑名单",httpMethod = "POST") + public Msg banCompanyByName(@RequestBody JSONObject object){ + String company = object.getString("company"); + if (StringUtils.isBlank(company)){ + return new Msg(ErrorCode.ERROR_10001); + } + BlackListInfo blackListInfoExist = blackListService.getBlackListByName(company); + if (blackListInfoExist != null){return new Msg(ErrorCode.ERROR_50003,"指定公司已存在黑名单");} + + CompanyInfo companyInfo = companyService.selectByName(company); + if (companyInfo != null){ + List<UserInfo> userInfos = userService.selectByCompany(company); + userInfos.forEach(item -> { + item.setStatus((byte)0); + item.setLastmodifiedby(getUser().getRealname()); + item.setLastmodifieddate(new Date()); + }); + userService.updateBatchById(userInfos); + + companyInfo.setIsbanned((byte)1); + companyInfo.setLastmodifiedby(getUser().getRealname()); + companyInfo.setLastmodifieddate(new Date()); + companyService.updateById(companyInfo); + } + BlackListInfo blackListInfo = new BlackListInfo(); + blackListInfo.setCompany(company); + blackListInfo.setCreatedat(new Date()); + blackListInfo.setCreatedby(getUser().getRealname()); + blackListService.save(blackListInfo); + return success(); + } + + @PostMapping("/cancelBan") + @ApiOperation(value = "添加黑名单",httpMethod = "POST") + public Msg cancelBanCompanyByName(@RequestBody JSONObject object){ + String company = object.getString("company"); + if (StringUtils.isBlank(company)){ + return new Msg(ErrorCode.ERROR_10001); + } + BlackListInfo blackListInfoExist = blackListService.getBlackListByName(company); + if (blackListInfoExist == null){return new Msg(ErrorCode.ERROR_50003,"指定公司不存在黑名单");} + + CompanyInfo companyInfo = companyService.selectByName(company); + if (companyInfo != null){ + List<UserInfo> userInfos = userService.selectByCompany(company); + userInfos.forEach(item -> { + item.setStatus((byte)1); + item.setLastmodifiedby(getUser().getRealname()); + item.setLastmodifieddate(new Date()); + }); + userService.updateBatchById(userInfos); + + companyInfo.setIsbanned((byte)0); + companyInfo.setLastmodifiedby(getUser().getRealname()); + companyInfo.setLastmodifieddate(new Date()); + companyService.updateById(companyInfo); + } + blackListService.removeById(blackListInfoExist); + return success(); + } + + @PostMapping("/bindCard") + @ApiOperation(value = "绑定人员卡",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + @ApiImplicitParam(name = "empNo",value = "人员卡编号"), + @ApiImplicitParam(name = "deviceNo",value = "人员卡MC地址"), + }) + public Msg test(@RequestBody JSONObject jsonObject){ + String empNo = jsonObject.getString("empNo"); + String deviceNo = jsonObject.getString("deviceNo"); + String username = jsonObject.getString("username"); + + UserInfo userInfo = userService.selectByUser(username); + + if (userInfo == null || StringUtils.isBlank(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_20001); + } + String realname = userInfo.getRealname(); +// String realname = jsonObject.getString("username"); + if (StringUtils.isBlank(empNo) + || StringUtils.isBlank(deviceNo)){ + return new Msg(ErrorCode.ERROR_10002); + } + + try { + Msg msg = userService.saveEmployee(realname,empNo,deviceNo); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg; + } + userInfo.setEmpNo(empNo); + userInfo.setDeviceNo(deviceNo); + userInfo.setCardId(msg.getResult().toString()); + userService.updateById(userInfo); + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + + return success(); + } + + @PostMapping("/setCardValid") + @ApiOperation(value = "设置人员卡无效",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + @ApiImplicitParam(name = "isValid",value = "有效标记(0.有效,1.无效)"), + }) + public Msg setCardValid(@RequestBody JSONObject jsonObject){ + String username = jsonObject.getString("username"); + + UserInfo userInfo = userService.selectByUser(username); + + if (userInfo == null || StringUtils.isBlank(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_20001); + } + String isValid = jsonObject.getString("isValid"); + String cardId = userInfo.getCardId(); + try { + Msg msg = userService.setCardValid(isValid,cardId); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg; + } + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + + return success(); + } + + @ApiOperation(value = "删除人员卡",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + }) + @PostMapping("/deleteEmp") + public Msg deleteEmp(@RequestBody JSONObject jsonObject){ + String username = jsonObject.getString("username"); + + UserInfo userInfo = userService.selectByUser(username); + + if (userInfo == null || StringUtils.isBlank(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_20001); + } + String cardId = userInfo.getCardId(); + try { + Msg msg = userService.delEmployee(cardId); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg; + } + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + userInfo.setDeviceNo(""); + userInfo.setEmpNo(""); + userInfo.setCardId(""); + userService.updateById(userInfo); + + return success(); + } + + @PostMapping("/setInvalidDel") + @ApiOperation(value = "设置人员卡无效并删除",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + }) + public Msg setInvalidDel(@RequestBody JSONObject jsonObject){ + String username = jsonObject.getString("username"); + + UserInfo userInfo = userService.selectByUser(username); + + if (userInfo == null || StringUtils.isBlank(userInfo.getRealname())){ + return new Msg(ErrorCode.ERROR_20001); + } + String isValid = "1"; + String cardId = userInfo.getCardId(); + if (StringUtils.isBlank(cardId)){ + return new Msg(ErrorCode.ERROR_50001,"当前用户没有绑定人员卡"); + } + try { + Msg msg = userService.setCardValid(isValid,cardId); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg; + } + Msg msg1 = userService.delEmployee(cardId); + if (!msg1.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg1; + } + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + + userInfo.setDeviceNo(""); + userInfo.setEmpNo(""); + userInfo.setCardId(""); + userService.updateById(userInfo); + return success(); + } + + @PostMapping("/getRealGps") + public Msg getRealGps(@RequestBody JSONObject jsonObject){ + try { + Msg msg = userService.getRealGps(); + if (!msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ + return msg; + } + return success(msg); + } catch (Exception e) { + e.printStackTrace(); + return new Msg(ErrorCode.ERROR_60002); + } + + } + + @PostMapping("/getGps") + @ApiOperation(value = "获取当前所有绑卡用户位置",response = Msg.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名(非必填)"), + }) + public Msg getGps(@RequestBody JSONObject jsonObject){ + String username = jsonObject.getString("username"); + List<UserInfo> userInfo = userService.getGps(username); + return success(userInfo); + } + + + /** + * @Description: 通过用户名能查location表最新一条位置数据 + * @date 2021/12/27 9:06 + */ + @PostMapping("/location") + @ApiOperation(value = "查询人员实时位置接口", response = Msg.class) + public Msg getLocation(@RequestBody String username) { + UserInfo user = userService.selectByUser(username); + if (user == null) + throw new BusinessException("用户不存在"); + DeviceLocation deviceLocation = deviceLocationService.selectByUser(user); + return success(deviceLocation); + } + + /** + * @Description: 通过开始时间、结束时间、用户名查到location表一段坐标lis + * @date 2021/12/27 9:35 + */ + @PostMapping("/location-list") + @ApiOperation(value = "查询人员轨迹接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + @ApiImplicitParam(name = "starttime",value = "开始时间"), + @ApiImplicitParam(name = "endtime",value = "结束时间") + }) + public Msg getLocationList(@RequestBody JSONObject jsonObj) { + String username = jsonObj.getString("username"); + Date starttime = jsonObj.getDate("starttime"); + Date endtime = jsonObj.getDate("endtime"); + List<DeviceLocation> locationList = deviceLocationService.selectUserLocations(username, starttime, endtime); + return success(locationList); + } + + @PostMapping("/department-userList") + @ApiOperation("/查找部门下的人员进行分页") + public Msg getUserPageInDepartment(@RequestBody FilterObject filterObject){ + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage<UserVo> page = userService.selectUserPageInDepartment(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + + /** + * @Description: 忘记密码 <=> 修改密码 + * @date 2022/5/6 15:19 + */ + @PostMapping("/pwd-change") + @ApiOperation("修改密码") + public Msg pwdChange(@RequestBody JSONObject pwdBody) { + String username = pwdBody.getString("username"); + String password = pwdBody.getString("password"); + String phone = pwdBody.getString("phone"); + userService.pwdChange(username, password, phone); + return success(); + } + + /** + * @Description: 换取账号 + */ + @PostMapping("/getAccount") + @ApiOperation("换取账号") + @ApiImplicitParams({ + @ApiImplicitParam(name = "username",value = "用户名"), + @ApiImplicitParam(name = "department",value = "部门"), + }) + public Msg getAccount(@RequestBody JSONObject accountBody) { + String username = accountBody.getString("username"); + String password = accountBody.getString("department"); + return success(userService.getAccount(username, password)); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/WarningController.java b/src/main/java/com/gk/hotwork/Controller/WarningController.java new file mode 100644 index 0000000..8d8a8de --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/WarningController.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.Controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.WarningInfo; +import com.gk.hotwork.Service.UserService; +import com.gk.hotwork.Service.WarningService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @author : jingjy + * @date : 2021/9/10 9:26 + */ +@Api(tags = "任务流程数据接口") +@RestController +@RequestMapping("/warning") +public class WarningController extends BaseController { + @Autowired + private WarningService warningService; + @Autowired + private UserService userService; + + @GetMapping("/info") + public Msg getWarningInfo(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "isDeal", required = false) String isDeal, + @RequestParam(value = "type", required = false) String type, + @RequestParam(defaultValue = "0") Integer pageIndex, + @RequestParam(value = "startTime", required = false) String startTime, + @RequestParam(value = "endTime", required = false) String endTime, + @RequestParam(defaultValue = "10") Integer pageSize, + String sort, String order){ + PageInfo pageInfo = new PageInfo(pageIndex, pageSize,sort,order); + + Map<String, Object> condition = new HashMap<>(4); + if (StringUtils.isNotBlank(code)) { + condition.put("code", code); + } + if (StringUtils.isNotBlank(isDeal)) { + condition.put("isDeal", isDeal); + } + if (StringUtils.isNotBlank(type)) { + condition.put("type", type); + } + if (StringUtils.isNotBlank(startTime)){ + condition.put("startTime", startTime); + } + if (StringUtils.isNotBlank(endTime)){ + condition.put("endTime", endTime); + } + pageInfo.setCondition(condition); + warningService.selectDataGrid(pageInfo); + + return success(pageInfo); + } + + @PostMapping("/deal") + public Msg dealWarning(String id){ + UserInfo userInfo = userService.getById(getUser().getId()); + if (StringUtils.isBlank(id)){ + return new Msg(ErrorCode.ERROR_10001); + } + WarningInfo warningInfo = warningService.getById(id); + if (warningInfo == null || warningInfo.getIsdeal() == 1){ + return new Msg(ErrorCode.ERROR_50001,"警告信息未找到或已处理"); + } + warningInfo.setIsdeal((byte)1); + warningInfo.setDealat(new Date()); + warningInfo.setDealby(userInfo.getRealname()); + warningService.updateById(warningInfo); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Controller/WorkShowController.java b/src/main/java/com/gk/hotwork/Controller/WorkShowController.java new file mode 100644 index 0000000..624bd69 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/WorkShowController.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.Controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.TaskService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; +import java.util.List; + +@Api(tags = "数据可视") +@RestController +@RequestMapping("/workShow") +public class WorkShowController extends BaseController { + + @Autowired + private TaskService taskService; + + + /** + * @Description: 今日作业总数 + * @date 2021/9/9 14:08 + */ + @GetMapping("/work-today") + public Msg workToday() { + List<Map> data = taskService.getWorkToday(); + return success(data); + } + + /** + * @Description: 4个总数 + * @date 2021/9/10 14:29 + */ + @GetMapping("/four-total") + public Msg fourTotal() { + Map data = taskService.getFourTotal(); + return success(data); + } + + /** + * @Description: 今日作业总数列表 + * @date 2021/9/9 14:48 + */ + @PostMapping("/work-today-detail") + public Msg workTodayDetail(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = taskService.getWorkTodayDetail(new Page<>(pageIndex, pageSize), filterObject.getFilter()); + return success(page); + } + + /** + * @Description: period内特殊作业类型对比(period天内动火作业总数, 审批完成) + * @date 2021/9/9 16:00 + */ + @GetMapping("/work-period/{period}") + public Msg specialCompareInMonth(@PathVariable String period) { + List<Map> data = taskService.getSpecialCompareInPeriod(period); + return success(data); + } + + + /** + * @Description: 30天 每一天的作业总数(审批完成) + * @date 2021/9/9 16:48 + */ + @GetMapping("/work-everyday-month") + public Msg workEverydayInMonth() { + Map data = taskService.getWorkEverydayInMonth(); + return success(data); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/AppFileInfo.java b/src/main/java/com/gk/hotwork/Domain/AppFileInfo.java new file mode 100644 index 0000000..21062c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/AppFileInfo.java @@ -0,0 +1,119 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("appfile") +public class AppFileInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 文件类型 filetype 仓储、监管**/ + private String filetype; + + /** 文件名称 filename **/ + private String filename; + + /** 文件链接 fileurl **/ + private String fileurl; + + /** 版本号 version **/ + private Integer version; + + /** 备注 remark **/ + private String remark; + + /** 创建时间 created **/ + private Date created; + + /** 更新时间 updated **/ + private Date updated; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 文件类型 filetype **/ + public String getFiletype() { + return filetype; + } + + /** 文件类型 filetype **/ + public void setFiletype(String filetype) { + this.filetype = filetype == null ? null : filetype.trim(); + } + + /** 文件名称 filename **/ + public String getFilename() { + return filename; + } + + /** 文件名称 filename **/ + public void setFilename(String filename) { + this.filename = filename == null ? null : filename.trim(); + } + + /** 文件链接 fileurl **/ + public String getFileurl() { + return fileurl; + } + + /** 文件链接 fileurl **/ + public void setFileurl(String fileurl) { + this.fileurl = fileurl == null ? null : fileurl.trim(); + } + + /** 版本号 version **/ + public Integer getVersion() { + return version; + } + + /** 版本号 version **/ + public void setVersion(Integer version) { + this.version = version; + } + + /** 备注 remark **/ + public String getRemark() { + return remark; + } + + /** 备注 remark **/ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** 创建时间 created **/ + public Date getCreated() { + return created; + } + + /** 创建时间 created **/ + public void setCreated(Date created) { + this.created = created; + } + + /** 更新时间 updated **/ + public Date getUpdated() { + return updated; + } + + /** 更新时间 updated **/ + public void setUpdated(Date updated) { + this.updated = updated; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/AuthorizationInfo.java b/src/main/java/com/gk/hotwork/Domain/AuthorizationInfo.java new file mode 100644 index 0000000..6a4e4d7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/AuthorizationInfo.java @@ -0,0 +1,144 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("authorization") +public class AuthorizationInfo { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 企业编号 enterprisenumber **/ + private String enterprisenumber; + + /** 授权码 authcode **/ + private String authcode; + + /** 授权码前三位(唯一确定一家企业) authcodeprefix **/ + private String authcodeprefix; + + /** 合同编号 contractcode **/ + private String contractcode; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 标记 flag **/ + private Byte flag; + + /** 最后使用时间 lasttime **/ + private Date lasttime; + + /** 是否使用(0.未启用;1.已启用) status **/ + private Byte status; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 企业编号 enterprisenumber **/ + public String getEnterprisenumber() { + return enterprisenumber; + } + + /** 企业编号 enterprisenumber **/ + public void setEnterprisenumber(String enterprisenumber) { + this.enterprisenumber = enterprisenumber == null ? null : enterprisenumber.trim(); + } + + /** 授权码 authcode **/ + public String getAuthcode() { + return authcode; + } + + /** 授权码 authcode **/ + public void setAuthcode(String authcode) { + this.authcode = authcode == null ? null : authcode.trim(); + } + + /** 授权码前三位(唯一确定一家企业) authcodeprefix **/ + public String getAuthcodeprefix() { + return authcodeprefix; + } + + /** 授权码前三位(唯一确定一家企业) authcodeprefix **/ + public void setAuthcodeprefix(String authcodeprefix) { + this.authcodeprefix = authcodeprefix == null ? null : authcodeprefix.trim(); + } + + /** 合同编号 contractcode **/ + public String getContractcode() { + return contractcode; + } + + /** 合同编号 contractcode **/ + public void setContractcode(String contractcode) { + this.contractcode = contractcode == null ? null : contractcode.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + /** 最后使用时间 lasttime **/ + public Date getLasttime() { + return lasttime; + } + + /** 最后使用时间 lasttime **/ + public void setLasttime(Date lasttime) { + this.lasttime = lasttime; + } + + /** 是否使用(0.未启用;1.已启用) status **/ + public Byte getStatus() { + return status; + } + + /** 是否使用(0.未启用;1.已启用) status **/ + public void setStatus(Byte status) { + this.status = status; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/BlackListInfo.java b/src/main/java/com/gk/hotwork/Domain/BlackListInfo.java new file mode 100644 index 0000000..36da8f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/BlackListInfo.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("blacklist") +public class BlackListInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 供应商黑名单 id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 供应商名称 company **/ + private String company; + + /** 联系人 contactname **/ + private String contactname; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 标记 flag **/ + private Byte flag; + + /** 供应商黑名单 id **/ + public Long getId() { + return id; + } + + /** 供应商黑名单 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 供应商名称 company **/ + public String getCompany() { + return company; + } + + /** 供应商名称 company **/ + public void setCompany(String company) { + this.company = company == null ? null : company.trim(); + } + + /** 联系人 contactname **/ + public String getContactname() { + return contactname; + } + + /** 联系人 contactname **/ + public void setContactname(String contactname) { + this.contactname = contactname == null ? null : contactname.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/CompanyInfo.java b/src/main/java/com/gk/hotwork/Domain/CompanyInfo.java new file mode 100644 index 0000000..a0a61c7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/CompanyInfo.java @@ -0,0 +1,241 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("company") +public class CompanyInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 单位代码 code **/ + private String code; + + /** 单位名称 company **/ + private String company; + + /** 是否为主体单位 ismain **/ + private Byte ismain; + + /** 联系人 contactname **/ + private String contactname; + + /** 联系电话 contactphone **/ + private String contactphone; + + /** 省份 province **/ + private String province; + + /** 城市 city **/ + private String city; + + /** 区县 area **/ + private String area; + + /** 乡镇 town **/ + private String town; + + /** 社区 community **/ + private String community; + + /** 是否删除 isdel **/ + private Byte isdel; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createddate **/ + private Date createddate; + + /** 更新人 lastmodifiedby **/ + private String lastmodifiedby; + + /** 更新时间 lastmodifieddate **/ + private Date lastmodifieddate; + + private String longitude; + + private String latitude; + + private Byte isbanned; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 名称 company **/ + public String getCompany() { + return company; + } + + /** 名称 company **/ + public void setCompany(String company) { + this.company = company == null ? null : company.trim(); + } + + /** 联系人 contactname **/ + public String getContactname() { + return contactname; + } + + /** 联系人 contactname **/ + public void setContactname(String contactname) { + this.contactname = contactname == null ? null : contactname.trim(); + } + + /** 联系电话 contactphone **/ + public String getContactphone() { + return contactphone; + } + + /** 联系电话 contactphone **/ + public void setContactphone(String contactphone) { + this.contactphone = contactphone == null ? null : contactphone.trim(); + } + + /** 省份 province **/ + public String getProvince() { + return province; + } + + /** 省份 province **/ + public void setProvince(String province) { + this.province = province == null ? null : province.trim(); + } + + /** 城市 city **/ + public String getCity() { + return city; + } + + /** 城市 city **/ + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + /** 区县 area **/ + public String getArea() { + return area; + } + + /** 区县 area **/ + public void setArea(String area) { + this.area = area == null ? null : area.trim(); + } + + /** 乡镇 town **/ + public String getTown() { + return town; + } + + /** 乡镇 town **/ + public void setTown(String town) { + this.town = town == null ? null : town.trim(); + } + + /** 社区 community **/ + public String getCommunity() { + return community; + } + + /** 社区 community **/ + public void setCommunity(String community) { + this.community = community == null ? null : community.trim(); + } + + /** 是否删除 isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除 isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + public String getCreatedby() { + return createdby; + } + + public void setCreatedby(String createdby) { + this.createdby = createdby; + } + + public Date getCreateddate() { + return createddate; + } + + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + public String getLastmodifiedby() { + return lastmodifiedby; + } + + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby; + } + + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Byte getIsmain() { + return ismain; + } + + public void setIsmain(Byte ismain) { + this.ismain = ismain; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public Byte getIsbanned() { + return isbanned; + } + + public void setIsbanned(Byte isbanned) { + this.isbanned = isbanned; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DepartmentInfo.java b/src/main/java/com/gk/hotwork/Domain/DepartmentInfo.java new file mode 100644 index 0000000..62887f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DepartmentInfo.java @@ -0,0 +1,122 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("department") +public class DepartmentInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 部门名称 **/ + private String department; + + /** 是否为安全部门 issafety **/ + private Byte issafety; + + /** 是否为检测中心 isanalysis **/ + private Byte isanalysis; + + /** 是否删除 isdel **/ + private Byte isdel; + + public Date getCreateddate() { + return createddate; + } + + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + public String getLastmodifiedby() { + return lastmodifiedby; + } + + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby; + } + + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createddate **/ + private Date createddate; + + /** 更新人 lastmodifiedby **/ + private String lastmodifiedby; + + /** 更新时间 lastmodifieddate **/ + private Date lastmodifieddate; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** department **/ + public String getDepartment() { + return department; + } + + /** department **/ + public void setDepartment(String department) { + this.department = department == null ? null : department.trim(); + } + + /** 是否为安全部门 issafety **/ + public Byte getIssafety() { + return issafety; + } + + /** 是否为安全部门 issafety **/ + public void setIssafety(Byte issafety) { + this.issafety = issafety; + } + + public Byte getIsanalysis() { + return isanalysis; + } + + public void setIsanalysis(Byte isanalysis) { + this.isanalysis = isanalysis; + } + + /** 是否删除 isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除 isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + public String getCreatedby() { + return createdby; + } + + public void setCreatedby(String createdby) { + this.createdby = createdby; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DeviceLocation.java b/src/main/java/com/gk/hotwork/Domain/DeviceLocation.java new file mode 100644 index 0000000..a8722f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DeviceLocation.java @@ -0,0 +1,240 @@ +package com.gk.hotwork.Domain; + + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + +public class DeviceLocation implements Serializable { + + private Long id; + //总图ID + private Long rootAreaId; + //定位地图ID + private Long areaId; + //(可选)车间/房间号(需要特殊配置才会生效) + private String gateId; + //固定为"Tag" + private String deviceType; + //标签编号 + private String uid; + //标签编号(为兼容性而保留,与uid 含义相同) + private String tagId; + //用户自定义编号 + private String userId; + //通讯中继编号 + private String routerId; + //触发时间,采用标准的UTC格式 ,本地时间需要用户软件依据时区自行转换 + private Date raiseTime; + //X轴坐标 + private BigDecimal x; + //Y轴坐标 + private BigDecimal y; + //Z轴坐标(地图配置时自定义) + private BigDecimal z; + //整型 楼层(地图配置时自定义) + private Integer floor; + //方向标志, 整型: 4~门口 5~离开 + private Integer direction; + //(引擎V2.41 版以上) 速度,米/秒 + private BigDecimal speed; + // (引擎V2.41 版以上)当标签进入静止状态后,会继续输出一段时间的定位信息,此时silent=true + private Boolean silent; + // (可选)经度 + private BigDecimal longitude; + // (可选)纬度 + private BigDecimal latitude; + // (可选)海拔 + private BigDecimal altitude; + //(可选)经纬度坐标系 "wgs84"(默认值), "gcj02"(谷歌标准) ,"bd09"(百度标准) + private String gpsType; + //(可选)定位模式, ”ble“ ~蓝牙定位 , "gps"~GPS 定位 注:经纬度和海拔是可选字段,需要特殊配置才会生效 + private String mode; + + private Date createTime; + + public Long getRootAreaId() { + return rootAreaId; + } + + public void setRootAreaId(Long rootAreaId) { + this.rootAreaId = rootAreaId; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getGateId() { + return gateId; + } + + public void setGateId(String gateId) { + this.gateId = gateId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getTagId() { + return tagId; + } + + public void setTagId(String tagId) { + this.tagId = tagId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getRouterId() { + return routerId; + } + + public void setRouterId(String routerId) { + this.routerId = routerId; + } + + public Date getRaiseTime() { + return raiseTime; + } + + public void setRaiseTime(Date raiseTime) { + this.raiseTime = raiseTime; + } + + public BigDecimal getX() { + return x; + } + + public void setX(BigDecimal x) { + this.x = x; + } + + public BigDecimal getY() { + return y; + } + + public void setY(BigDecimal y) { + this.y = y; + } + + public BigDecimal getZ() { + return z; + } + + public void setZ(BigDecimal z) { + this.z = z; + } + + public Integer getFloor() { + return floor; + } + + public void setFloor(Integer floor) { + this.floor = floor; + } + + public Integer getDirection() { + return direction; + } + + public void setDirection(Integer direction) { + this.direction = direction; + } + + public BigDecimal getSpeed() { + return speed; + } + + public void setSpeed(BigDecimal speed) { + this.speed = speed; + } + + public Boolean getSilent() { + return silent; + } + + public void setSilent(Boolean silent) { + this.silent = silent; + } + + public BigDecimal getLongitude() { + return longitude; + } + + public void setLongitude(BigDecimal longitude) { + this.longitude = longitude; + } + + public BigDecimal getLatitude() { + return latitude; + } + + public void setLatitude(BigDecimal latitude) { + this.latitude = latitude; + } + + public BigDecimal getAltitude() { + return altitude; + } + + public void setAltitude(BigDecimal altitude) { + this.altitude = altitude; + } + + public String getGpsType() { + return gpsType; + } + + public void setGpsType(String gpsType) { + this.gpsType = gpsType; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DevicePing.java b/src/main/java/com/gk/hotwork/Domain/DevicePing.java new file mode 100644 index 0000000..c7ea7fc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DevicePing.java @@ -0,0 +1,114 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Table("device_ping") +public class DevicePing implements Serializable { + + @TableId(type = IdType.AUTO) + private Long id; + //"Router" 代表通讯基站/网关,"Beacon" 表示是定位信标, "Tag" 表示标签, "Station" 代表定位基站 + private String deviceType; + //标签编号 + private String uid; + + private Date raiseTime; + //电压数值 + private BigDecimal volt; + //电压单位 "%"或者"V" + private String voltUnit; + //是否静止 + private Boolean silent; + //仅在deviceType="Beacon" 时有效, 表示转发基站的编号(信标的状态必须通过某个基站转发) + private String routerId; + //0x02 处在一键呼救报警状态 , 0x04 静止状态 + private String state; + + private Date createTime; + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public Date getRaiseTime() { + return raiseTime; + } + + public void setRaiseTime(Date raiseTime) { + this.raiseTime = raiseTime; + } + + public BigDecimal getVolt() { + return volt; + } + + public void setVolt(BigDecimal volt) { + this.volt = volt; + } + + public String getVoltUnit() { + return voltUnit; + } + + public void setVoltUnit(String voltUnit) { + this.voltUnit = voltUnit; + } + + public Boolean getSilent() { + return silent; + } + + public void setSilent(Boolean silent) { + this.silent = silent; + } + + public String getRouterId() { + return routerId; + } + + public void setRouterId(String routerId) { + this.routerId = routerId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DevicePressKey.java b/src/main/java/com/gk/hotwork/Domain/DevicePressKey.java new file mode 100644 index 0000000..14f0960 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DevicePressKey.java @@ -0,0 +1,93 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("device_presskey") +public class DevicePressKey implements Serializable { + + @TableId(type = IdType.AUTO) + private Long id; + + private String deviceType; + + private String uid; + //按键值(保留字段,固定为1) + private String keyCode; + // 触发时间,采用标准的UTC格式 ,本地时间需要用户软件依据时区自行转换 + private Date raiseTime; + //本次呼救的ID, 呼救过程中保持相同 + private Long sessionId; + //地图编号(按键时刻所在的地图) + private Long areaId; + + private Date createTime; + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getKeyCode() { + return keyCode; + } + + public void setKeyCode(String keyCode) { + this.keyCode = keyCode; + } + + public Date getRaiseTime() { + return raiseTime; + } + + public void setRaiseTime(Date raiseTime) { + this.raiseTime = raiseTime; + } + + public Long getSessionId() { + return sessionId; + } + + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DictionaryItemInfo.java b/src/main/java/com/gk/hotwork/Domain/DictionaryItemInfo.java new file mode 100644 index 0000000..a49d74e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DictionaryItemInfo.java @@ -0,0 +1,158 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("dictionaryitem") +public class DictionaryItemInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 序号 sort **/ + private Integer sort; + + /** 是否使用1使用 0禁用 status **/ + private Byte status; + + /** 字典标签 text **/ + private String text; + + /** 字典值 value **/ + private String value; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createddate **/ + private Date createddate; + + /** 更新人 modifiedby **/ + private String modifiedby; + + /** 更新时间 modifieddate **/ + private Date modifieddate; + + /** 备注 description **/ + private String description; + + /** 字典类型id typeid **/ + private Long typeid; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 序号 sort **/ + public Integer getSort() { + return sort; + } + + /** 序号 sort **/ + public void setSort(Integer sort) { + this.sort = sort; + } + + /** 是否使用1使用 0禁用 status **/ + public Byte getStatus() { + return status; + } + + /** 是否使用1使用 0禁用 status **/ + public void setStatus(Byte status) { + this.status = status; + } + + /** 字典标签 text **/ + public String getText() { + return text; + } + + /** 字典标签 text **/ + public void setText(String text) { + this.text = text == null ? null : text.trim(); + } + + /** 字典值 value **/ + public String getValue() { + return value; + } + + /** 字典值 value **/ + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createddate **/ + public Date getCreateddate() { + return createddate; + } + + /** 创建时间 createddate **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** 更新人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 更新人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 更新时间 modifieddate **/ + public Date getModifieddate() { + return modifieddate; + } + + /** 更新时间 modifieddate **/ + public void setModifieddate(Date modifieddate) { + this.modifieddate = modifieddate; + } + + /** 备注 description **/ + public String getDescription() { + return description; + } + + /** 备注 description **/ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** 字典类型id typeid **/ + public Long getTypeid() { + return typeid; + } + + /** 字典类型id typeid **/ + public void setTypeid(Long typeid) { + this.typeid = typeid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DictionaryTypeInfo.java b/src/main/java/com/gk/hotwork/Domain/DictionaryTypeInfo.java new file mode 100644 index 0000000..1797cd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DictionaryTypeInfo.java @@ -0,0 +1,132 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("dictionarytype") +public class DictionaryTypeInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 编码 code **/ + private String code; + + /** 状态1使用 0禁用 status **/ + private Byte status; + + /** 类型名称 text **/ + private String text; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createddate **/ + private Date createddate; + + /** 更新人 modifiedby **/ + private String modifiedby; + + /** 更新时间 modifieddate **/ + private Date modifieddate; + + /** 备注 description **/ + private String description; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 编码 code **/ + public String getCode() { + return code; + } + + /** 编码 code **/ + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + /** 状态1使用 0禁用 status **/ + public Byte getStatus() { + return status; + } + + /** 状态1使用 0禁用 status **/ + public void setStatus(Byte status) { + this.status = status; + } + + /** 类型名称 text **/ + public String getText() { + return text; + } + + /** 类型名称 text **/ + public void setText(String text) { + this.text = text == null ? null : text.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createddate **/ + public Date getCreateddate() { + return createddate; + } + + /** 创建时间 createddate **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** 更新人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 更新人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 更新时间 modifieddate **/ + public Date getModifieddate() { + return modifieddate; + } + + /** 更新时间 modifieddate **/ + public void setModifieddate(Date modifieddate) { + this.modifieddate = modifieddate; + } + + /** 备注 description **/ + public String getDescription() { + return description; + } + + /** 备注 description **/ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/DistrictInfo.java b/src/main/java/com/gk/hotwork/Domain/DistrictInfo.java new file mode 100644 index 0000000..d708ace --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/DistrictInfo.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Domain; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("district") +public class DistrictInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** code **/ + private String code; + + /** name **/ + private String name; + + /** parentcode **/ + private String parentcode; + + /** 1省份2城市3区县4乡镇5居委会 type **/ + private Byte type; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** code **/ + public String getCode() { + return code; + } + + /** code **/ + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + /** name **/ + public String getName() { + return name; + } + + /** name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** parentcode **/ + public String getParentcode() { + return parentcode; + } + + /** parentcode **/ + public void setParentcode(String parentcode) { + this.parentcode = parentcode == null ? null : parentcode.trim(); + } + + /** 1省份2城市3区县4乡镇5居委会 type **/ + public Byte getType() { + return type; + } + + /** 1省份2城市3区县4乡镇5居委会 type **/ + public void setType(Byte type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Do/SafetySelfInspectionItemQualifiedCountDO.java b/src/main/java/com/gk/hotwork/Domain/Do/SafetySelfInspectionItemQualifiedCountDO.java new file mode 100644 index 0000000..70e76e9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Do/SafetySelfInspectionItemQualifiedCountDO.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Domain.Do; + +import io.swagger.models.auth.In; + +import java.io.Serializable; + +public class SafetySelfInspectionItemQualifiedCountDO implements Serializable { + + private Integer itemSum; + + private Integer qualifiedItem; + + public Integer getItemSum() { + return itemSum; + } + + public void setItemSum(Integer itemSum) { + this.itemSum = itemSum; + } + + public Integer getQualifiedItem() { + return qualifiedItem; + } + + public void setQualifiedItem(Integer qualifiedItem) { + this.qualifiedItem = qualifiedItem; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/ElementManagement.java b/src/main/java/com/gk/hotwork/Domain/ElementManagement.java new file mode 100644 index 0000000..0e83bbd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/ElementManagement.java @@ -0,0 +1,175 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("element_management") +public class ElementManagement implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 要素名称 name **/ + private String name; + + /** 要素级别 type 0:A级要素 1:B级要素**/ + private Integer type; + + /** 父要素id parent_id **/ + private Long parentId; + + /** 要素备注 remark **/ + private String remark; + + /** B级要素得分 point **/ + private Integer point; + + /** A级要素权重 weight **/ + private Float weight; + + @TableField(exist = false) + /** 父级要素名称 parentName **/ + private String parentName; + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + public Integer getPoint() { + return point; + } + + public void setPoint(Integer point) { + this.point = point; + } + + public Float getWeight() { + return weight; + } + + public void setWeight(Float weight) { + this.weight = weight; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/ElementTree.java b/src/main/java/com/gk/hotwork/Domain/ElementTree.java new file mode 100644 index 0000000..5e0f299 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/ElementTree.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +public class ElementTree implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 类型 type **/ + private Integer type; + + /** 标签 label **/ + private String label; + + /** 值 value **/ + private Long value; + + /** 子节点 **/ + private List<ElementTree> children; + + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + public List<ElementTree> getChildren() { + return children; + } + + public void setChildren(List<ElementTree> children) { + this.children = children; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/EmergencyPlan.java b/src/main/java/com/gk/hotwork/Domain/EmergencyPlan.java new file mode 100644 index 0000000..f94a864 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/EmergencyPlan.java @@ -0,0 +1,156 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("emergency_plan") +public class EmergencyPlan implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 应急预案名称 name **/ + private String name; + + /** 应急预案文件类型 file_type 0:图片 1:文件**/ + private Integer fileType; + + /** 应急预案文件 **/ + @TableField(exist = false) + private List<EmergencyPlanFile> fileList; + + /** 应急预案文件 **/ + @TableField(exist = false) + private List<String> viewerList; + + /** 应急预案备注 remark **/ + private String remark; + + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getFileType() { + return fileType; + } + + public void setFileType(Integer fileType) { + this.fileType = fileType; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public List<EmergencyPlanFile> getFileList() { + return fileList; + } + + public void setFileList(List<EmergencyPlanFile> fileList) { + this.fileList = fileList; + } + + public List<String> getViewerList() { + return viewerList; + } + + public void setViewerList(List<String> viewerList) { + this.viewerList = viewerList; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/EmergencyPlanFile.java b/src/main/java/com/gk/hotwork/Domain/EmergencyPlanFile.java new file mode 100644 index 0000000..36367ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/EmergencyPlanFile.java @@ -0,0 +1,160 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("emergency_plan_file") +public class EmergencyPlanFile implements Serializable { + + private final static long serialVersionUID = 1L; + + + /** 文件名称 file_name **/ + private String fileName; + + /** 文件路径 file_url **/ + private String fileUrl; + + /** 应急预案id emergency_plan_id **/ + private Long emergencyPlanId; + + @TableField(exist = false) + private String url; + @TableField(exist = false) + private String uid; + @TableField(exist = false) + private String status; + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public Long getEmergencyPlanId() { + return emergencyPlanId; + } + + public void setEmergencyPlanId(Long emergencyPlanId) { + this.emergencyPlanId = emergencyPlanId; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/ApplyStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/ApplyStatus.java new file mode 100644 index 0000000..3adcfc9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/ApplyStatus.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + + +public enum ApplyStatus implements IEnum { + APPROVING("APPROVING", "待审批"), + PASS("PASS", "通过"), + REFUSE("REFUSE","拒绝"); + + private String code; + + private String msg; + + ApplyStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static ApplyStatus parse(String code){ + for(ApplyStatus as:ApplyStatus.values()){ + if(as.getCode().equals(code)){ + return as; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/AssessAppealStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/AssessAppealStatus.java new file mode 100644 index 0000000..de30e54 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/AssessAppealStatus.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AssessAppealStatus { + UNAPPEALED("UNAPPEALED","未申诉"), + APPEALING("APPEALING","申诉中"), + PASSED("PASSED","申诉通过"), + UNPASSED("UNPASSED","申诉未通过") + ; + + + private String code; + + @JsonValue + private String msg; + + + AssessAppealStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/AssessApplyStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/AssessApplyStatus.java new file mode 100644 index 0000000..c070667 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/AssessApplyStatus.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AssessApplyStatus { + + TOSUBMIT("TOSUBMIT","待提交") , + + PENDING("PENDING","待审批") , + + APPROVED("APPROVED","审批通过"), + + REJECT("REJECT","驳回"),; + + + private String code; + + @JsonValue + private String msg; + + AssessApplyStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/AssessPunishment.java b/src/main/java/com/gk/hotwork/Domain/Enum/AssessPunishment.java new file mode 100644 index 0000000..ec0c121 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/AssessPunishment.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Domain.Enum; + +public enum AssessPunishment { + M0("M0","吊销企业许可证"), + M1("M1","暂停使用1个月"), + M2("M2","暂停使用3个月"), + M3("M3","暂停使用6个月"); + + + private String code; + + private String msg; + + AssessPunishment(String code, String msg) { + this.code = code; + this.msg = msg; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/AssessType.java b/src/main/java/com/gk/hotwork/Domain/Enum/AssessType.java new file mode 100644 index 0000000..e8d5307 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/AssessType.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AssessType { + + SALE("SALE","销售评定"), + ACCESS("ACCESS","准入评定"),; + + + private String code; + + @JsonValue + private String msg; + + + AssessType(String code, String msg) { + this.code = code; + this.msg = msg; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/CertificatePersonType.java b/src/main/java/com/gk/hotwork/Domain/Enum/CertificatePersonType.java new file mode 100644 index 0000000..42b0d24 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/CertificatePersonType.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CertificatePersonType { + + DRIVER("DRIVER", "驾驶员"), + ESCORT("ESCORT", "押运员"),; + + private String code; + + private String msg; + + CertificatePersonType(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static CertificatePersonType parse(String code){ + for(CertificatePersonType cs:CertificatePersonType.values()){ + if(cs.getCode().equals(code)){ + return cs; + } + } + return null; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/CertificateStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/CertificateStatus.java new file mode 100644 index 0000000..c7cde0a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/CertificateStatus.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum CertificateStatus implements IEnum { + TOSUBMIT("TOSUBMIT", "待提交"), + PENDING("PENDING", "待审批"), + APPROVED("APPROVED","已审批"); + + private String code; + + private String msg; + + CertificateStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static CertificateStatus parse(String code){ + for(CertificateStatus cs:CertificateStatus.values()){ + if(cs.getCode().equals(code)){ + return cs; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/CommitStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/CommitStatus.java new file mode 100644 index 0000000..316d2ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/CommitStatus.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum CommitStatus implements IEnum { + DEL("DEL", "删除"), + MOD("MOD", "修改"),; + + private String code; + + private String msg; + + CommitStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static CommitStatus parse(String code){ + for(CommitStatus cs:CommitStatus.values()){ + if(cs.getCode().equals(code)){ + return cs; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/DocumentType.java b/src/main/java/com/gk/hotwork/Domain/Enum/DocumentType.java new file mode 100644 index 0000000..0257589 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/DocumentType.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum DocumentType implements IEnum { + + + RESCUE("RESCUE", "应急救援预案"), + FLOW("FLOW", "流向信息管理承诺书"), + ; + + private String code; + private String msg; + + DocumentType(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static DocumentType parse(String code){ + for(DocumentType dt:DocumentType.values()){ + if(dt.getCode().equals(code)){ + return dt; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/Element.java b/src/main/java/com/gk/hotwork/Domain/Enum/Element.java new file mode 100644 index 0000000..a0b434c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/Element.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Domain.Enum; + +import java.util.Random; + +/** + * @author : jingjy + * @date : 2021/5/24 10:13 + * @Description: 生成流向码的基本元素 + */ +public enum Element { + /** + * 基本元素为数字0-9及大写字母A-Z(不含I、O)共34种数字或字母 + **/ + A("A"), + B("B"), + C("C"), + D("D"), + E("E"), + F("F"), + G("G"), + H("H"), + J("J"), + K("K"), + L("L"), + M("M"), + N("N"), + P("P"), + Q("Q"), + R("R"), + S("S"), + T("T"), + U("U"), + V("V"), + W("W"), + X("X"), + Y("Y"), + Z("Z"), + ZERO(0), + ONE(1), + TWO(2), + THREE(3), + FOUR(4), + FIVE(5), + SIX(6), + SEVEN(7), + EIGHT(8), + NINE(9), + ; + + Element(Object i) { + this.i = i; + } + + private final Object i; + private static int random = (int) (Math.random() * 10); + private static Random rand = new Random(random); + + public static <T extends Enum<T>> T random(Class<T> ec) { + return random(ec.getEnumConstants()); + } + + public static <T> T random(T[] values) { + return values[rand.nextInt(values.length)]; + } + + public Object getValue() { + return i; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSafetySupervision.java b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSafetySupervision.java new file mode 100644 index 0000000..d402e4b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSafetySupervision.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.Domain.Enum; + +/** + * @author : jingjy + * @date : 2021/4/13 10:16 + */ +public enum EnterpriseSafetySupervision { + /** + * PRODUCE:烟花爆竹生产 + * WHOLESALER:烟花爆竹批发经营 + * RETAILER:烟花爆竹零售经营(长期) + * TEMP_RETAILER:烟花爆竹零售经营(短期) + */ + PRODUCE("PRODUCE","烟花爆竹生产"), + WHOLESALER("WHOLESALER","烟花爆竹批发经营"), + RETAILER("RETAILER","烟花爆竹零售经营(长期)"), + TEMP_RETAILER("TEMP_RETAILER","烟花爆竹零售经营(短期)"); + + + + EnterpriseSafetySupervision(String code, String msg) { + this.code = code; + this.msg = msg; + } + + private String code; + private String msg; + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } + + + public static boolean isInclude(String msg){ + boolean include = false; + for (EnterpriseSafetySupervision e: EnterpriseSafetySupervision.values()){ + if(msg.equals(e.getMsg())){ + include = true; + break; + } + } + return include; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSize.java b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSize.java new file mode 100644 index 0000000..b2d1dba --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseSize.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum EnterpriseSize implements IEnum { + MICRO("MICRO","微型"), + SMALL("SMALL","小型"), + MEDIUM("MEDIUM","中型"), + LARGE("LARGE","大型"); + + + EnterpriseSize(String code, String msg) { + this.code = code; + this.msg = msg; + } + + private String code; + @JsonValue + private String msg; + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } + + public static EnterpriseSize parse(String code){ + for(EnterpriseSize es:EnterpriseSize.values()){ + if(es.getCode().equals(code)){ + return es; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseStatus.java new file mode 100644 index 0000000..4561882 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/EnterpriseStatus.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum EnterpriseStatus implements IEnum { + + OFF("OFF","停止"), + ON("ON","正常"); + EnterpriseStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + private String code; + @JsonValue + private String msg; + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } + + public static EnterpriseStatus parse(String code){ + for(EnterpriseStatus es:EnterpriseStatus.values()){ + if(es.getCode().equals(code)){ + return es; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/ErrorCode.java b/src/main/java/com/gk/hotwork/Domain/Enum/ErrorCode.java new file mode 100644 index 0000000..55d6e20 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/ErrorCode.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Domain.Enum; + +/** + * @author : jingjy + * @date : 2021/4/14 10:57 + */ +public enum ErrorCode { + /** + * 错误码 + * SUCCESS : 200;成功 + * ERROR_999 : 999;自定义错误 + */ + SUCCESS("200","success"), + ERROR_PARAMS_ERROR("400","参数错误"), + ERROR_NOT_FOUND_DATA("300","数据未找到"), + ERROR_DATABASE_ERROR("301","数据库错误"), + ERROR_PAGE_SIZE_TOOMANY("305","分页条目数超过最大值"), + ERROR_SERVER_ERROR("500","服务端错误"), + ERROR_API_ERROR("501","API调用错误"), + // 参数错误 + ERROR_10001("10001","参数为空"), + ERROR_10002("10002","参数不全"), + ERROR_10003("10003","参数类型错误"), + ERROR_10004("10004","参数无效"), + // 用户错误 + ERROR_20001("20001","用户不存在"), + ERROR_20002("20002","用户未登陆"), + ERROR_20003("20003","用户名或密码错误"), + ERROR_20004("20004","用户账户已被禁用"), + ERROR_20005("20005","用户已存在"), + // 业务错误 + ERROR_30001("30001","系统业务出现问题"), + // 系统错误 + ERROR_40001("40001","系统内部错误"), + // 数据错误 + ERROR_50001("50001","数据未找到"), + ERROR_50002("50002","数据有误"), + ERROR_50003("50003","数据已存在"), + ERROR_50004("50004","数据不允许修改"), + ERROR_50005("50004","数据不允许删除"), + // 接口错误 + ERROR_60001("60001","系统内部接口调用异常"), + ERROR_60002("60002","系统外部接口调用异常"), + ERROR_60003("60003","接口禁止访问"), + ERROR_60004("60004","接口地址无效"), + ERROR_60005("60005","接口请求超时"), + ERROR_60006("60006","接口负载过高"), + // 权限错误 + ERROR_70001("70001","没有访问权限"), + + ERROR_999("999","自定义错误") + ; + + ErrorCode(String code, String msg) { + this.code = code; + this.msg = msg; + } + + private final String code; + private final String msg; + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/Etype.java b/src/main/java/com/gk/hotwork/Domain/Enum/Etype.java new file mode 100644 index 0000000..da28e4b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/Etype.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.Domain.Enum; + +import com.gk.hotwork.Domain.Exception.BusinessException; + +public enum Etype { + + E_60(1, "60吨位"), + E_130(2, "130吨位"), + + ; + + + int code; + String msg; + + Etype(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public static Etype parse(Integer code) { + if (code == null) throw new BusinessException("参数为空"); + for (Etype etype : Etype.values()) { + if (etype.code == code) { + return etype; + } + } + throw new BusinessException("找不到对应类型"); + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyOperation.java b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyOperation.java new file mode 100644 index 0000000..1429427 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyOperation.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum HiddenDangerApplyOperation { + + REPORT("REPORT","上报"), + RECTIFICATION("RECTIFICATION","整改"); + + HiddenDangerApplyOperation(String code, String msg) { + this.code = code; + this.msg = msg; + } + + String code; + @JsonValue + String msg; + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyStatus.java new file mode 100644 index 0000000..7ea317a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerApplyStatus.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum HiddenDangerApplyStatus { + + TORECTIFY("UNCONFIRMED","待整改"), + TOACCEPT("TOACCEPT","整改待验收"), + REJECTED("REJECTED","驳回待整改"), + COMPLETED("COMPLETED","已完成"), + ; + + + HiddenDangerApplyStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + String code; + @JsonValue + String msg; + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerLevel.java b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerLevel.java new file mode 100644 index 0000000..d05d7a5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerLevel.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum HiddenDangerLevel { + + URGENT("URGENT","重大隐患"), + COMMON("COMMON","一般隐患"); + + HiddenDangerLevel(String code, String msg) { + this.code = code; + this.msg = msg; + } + + String code; + @JsonValue + String msg; +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportSource.java b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportSource.java new file mode 100644 index 0000000..62d0bcd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportSource.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Domain.Enum; + +public enum HiddenDangerReportSource { + NORMAL(1, "隐患上报"), + SAFE_CHECK(2,"巡检上报"), + ; + + int code; + String msg; + + + HiddenDangerReportSource(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportStatus.java new file mode 100644 index 0000000..f8f752d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/HiddenDangerReportStatus.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.annotation.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum HiddenDangerReportStatus implements IEnum { + + PENDING("PENDING", "待提交"), + COMMITTED("COMMITTED", "已提交"),; + + private String code; + + private String msg; + + HiddenDangerReportStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static HiddenDangerReportStatus parse(String code){ + for(HiddenDangerReportStatus cs:HiddenDangerReportStatus.values()){ + if(cs.getCode().equals(code)){ + return cs; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/MsgType.java b/src/main/java/com/gk/hotwork/Domain/Enum/MsgType.java new file mode 100644 index 0000000..7cfa96b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/MsgType.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.Domain.Enum; + +public enum MsgType{ + NOTIFICATION("notify","通知"), + ALERT("alert","消息提示"), + MESSAGE("message","通知"); + + + MsgType(String code, String type) { + this.code = code; + this.type = type; + } + + private String code; + private String type; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/PersonnelCategory.java b/src/main/java/com/gk/hotwork/Domain/Enum/PersonnelCategory.java new file mode 100644 index 0000000..ad695e6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/PersonnelCategory.java @@ -0,0 +1,47 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.io.Serializable; + +public enum PersonnelCategory implements IEnum { + + + SECURITY("SECURITY", "安全人员"), + SPECIAL("SPECIAL", "特种人员"), + + ; + + private String code; + private String msg; + + PersonnelCategory(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + @JsonValue + public String getMsg() { + return msg; + } + + + + public static PersonnelCategory parse(String code){ + for(PersonnelCategory pc:PersonnelCategory.values()){ + if(pc.getCode().equals(code)){ + return pc; + } + } + return null; + } + + @Override + public Serializable getValue() { + return this.code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/ProvinceCode.java b/src/main/java/com/gk/hotwork/Domain/Enum/ProvinceCode.java new file mode 100644 index 0000000..92f2fea --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/ProvinceCode.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Domain.Enum; + +/** + * @author : jingjy + * @date : 2021/5/12 16:13 + */ +public enum ProvinceCode { + /** + * 错误码 + * SUCCESS : 200;成功 + * ERROR_999 : 999;自定义错误 + */ + BEIJING("北京市","京"), + TIANJIN("天津市","津"), + HEBEI("河北省","冀"), + SHANXI("山西省","晋"), + NEIMENG("内蒙古自治区","蒙"), + LIAONING("辽宁省" , "辽"), + JILIN("吉林省" ,"吉"), + HEILONGJIANG("黑龙江省" ,"黑"), + SHANGHAI("上海市","沪"), + JIANGSU("江苏省" , "苏"), + ZHEJIANG("浙江省","浙"), + ANHUI("安徽省","皖"), + FUJIAN("福建省" ,"闽"), + JIANGXI("江西省","赣"), + SHANDONG("山东省","鲁"), + HENAN("河南省","豫"), + HUBEI("湖北省","鄂"), + HUNAN("湖南省","湘"), + GUANGDONG("广东省","粤"), + GUANGXI("广西壮族自治区","桂"), + HAINAN("海南省","琼"), + SICHUAN("四川省","川"), + GUIZHOU("贵州省", "贵"), + YUNNAN("云南省","云"), + CHONGQING("重庆市","渝"), + XIZANG("西藏自治区" , "藏"), + ShAANXI("陕西省","陕"), + GANSU("甘肃省","甘"), + QINGHAI("青海省","青"), + NINGXIA("宁夏回族自治区","宁"), + XINJIANG("新疆维吾尔自治区","新"), + XIANGGANG("香港特别行政区","港"), + AOMENG("澳门特别行政区","澳"), + TAIWAN("台湾省","台"), + + + + + + ; + + ProvinceCode(String name, String abbr) { + this.name = name; + this.abbr = abbr; + } + + private final String name; + private final String abbr; + + public String getName() { + return name; + } + + public String getAbbr() { + return abbr; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/PunishStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/PunishStatus.java new file mode 100644 index 0000000..05d1cd2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/PunishStatus.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PunishStatus { + + UNPUNISH("UNPUNISH", "未处罚"), + PUNISHING("PUNISHING","处罚中"), + END("END", "处罚结束"),; + + + String code; + @JsonValue + String msg; + + PunishStatus(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/RedisServiceEnum.java b/src/main/java/com/gk/hotwork/Domain/Enum/RedisServiceEnum.java new file mode 100644 index 0000000..c6697f7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/RedisServiceEnum.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Domain.Enum; + +public enum RedisServiceEnum { + + + SMS_SERVICE("sms-service:","短信通知"); + + RedisServiceEnum(String service, String desc) { + this.service = service; + this.desc = desc; + } + + String service; + String desc; + + public String getService() { + return service; + } + + public String getDesc() { + return desc; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/ResultCodes.java b/src/main/java/com/gk/hotwork/Domain/Enum/ResultCodes.java new file mode 100644 index 0000000..f910b58 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/ResultCodes.java @@ -0,0 +1,155 @@ +package com.gk.hotwork.Domain.Enum; + +public enum ResultCodes { + OK("200","一切 ok"), + CLIENT_ERROR("A0001","用户端错误"), + CLIENT_REGEISTER_ERROR_("A0100","用户注册错误"), + CLIENT_NOT_ALLOW_PRIVACY_AGREEMENT("A0101","用户未同意隐私协议"), + CLIENT_REGEISTER_AREA_NOT_SUPPORT("A0102","注册国家或地区受限"), + CLIENT_USERNAME_ERROR("A0110","用户名校验失败"), + CLIENT_USERNAME_EXIST("A0111","用户名已存在"), + CLIENT_USERNAME_CONTAINS_SENSITIVE_WORD("A0112","用户名包含敏感词"), + CLIENT_USERNAME_CONTAINS_INVALID_SYMBOL("A0113","用户名包含特殊字符"), + CLIENT_PASSWORD_CHECK_ERROR("A0120","密码校验失败"), + CLIENT_PASSWORD_LENGTH_ERROR("A0121","密码长度错误"), + CLIENT_PASSWORD_RULE_ERROR("A0122","密码强度不够"), + CLIENT_CHECK_CODE_ERROR("A0130","校验码错误"), + CLIENT_CHECK_CODE_SMS_ERROR("A0131","短信校验码错误"), + CLIENT_CHECK_CODE_EMAIL_ERROR("A0132","邮件校验码错误"), + CLIENT_CHECK_CODE_AUDIO_ERROR("A0133","语音校验码错误"), + CLIENT_LICENSE_ERROR("A0140","用户证件异常"), + + CLIENT_USER_INFO_ERROR("A0150","用户基本信息校验失败"), + CLIENT_USER_PHONE_RULE_ERROR("A0151","手机格式校验失败"), + CLIENT_USER_ADDRESS_RULE_ERROR("A0152","地址格式校验失败"), + CLIENT_USER_MAIL_RULE_ERROR("A0153","邮箱格式校验失败"), + + CLIENT_LOGIN_ABNORMAL("A0200","用户登陆异常"), + CLIENT_PASSWORD_NULL("A0209","用户密码不可为空"), + CLIENT_PASSWORD_ERROR("A0210","用户密码错误"), + CLIENT_PASSWORD_INPUT_LIMIT_ERROR("A0211","用户输入密码次数超限"), + CLIENT_CREDENTIALS_EXPIRED("A0212","用户认证过期"), + CLIENT_CREDENTIALS_LACK("A0213","用户认证标识缺少"), + CLIENT_CREDENTIALS_TOKEN_INVALID("A0215","用户认证token无效"), + CLIENT_IDENTITY_CHECK_ERROR("A0220","用户身份校验失败"), + + CLIENT_LOGIN_OUTTIME("A0230","用户登陆已过期"), + + CLIENT_PERMISSION_ERROR("A0300","访问权限异常"), + CLIENT_PERMISSION_NOT_ALLOW("A0301","访问未授权"), + CLIENT_PERMISSION_AUTH_APPLY("A0302","正在授权中"), + CLIENT_PERMISSION_AUTH_REJECT("A0303","用户授权申请被拒绝"), + CLIENT_PERMISSION_AUTH_INTERCEPT("A0310","因访问对象隐私设置被拦截"), + CLIENT_PERMISSION_AUTH_EXPIRED("A0311","授权已过期"), + CLIENT_PERMISSION_API_NOAUTH("A0312","无权限使用API"), + CLIENT_PERMISSION_API_INTERCEPT("A0320","用户访问被拦截"), + + CLIENT_SIGN_ERROR("A0340","用户签名异常"), + CLIENT_SIGN_RSA_ERROR("A0341","RSA 签名错误"), + CLIENT_PARAM_ERROR("A0400","用户请求参数错误"), + CLIENT_PARAM_INVALID("A0402","参数无效"), + CLIENT_PARAM_REQUIRED_EMPTY("A0410","请求必填参数为空"), + CLIENT_PARAM_FORMAT_ERROR("A0421","参数格式不匹配"), + CLIENT_PARAM_BATCH_OVER_LIMIT("A0426","请求批量处理总个数超出限制"), + CLIENT_PARAM_JSON_PRASE_ERROR("A0427","请求 JSON 解析失败"), + CLIENT_PARAM_ILLEGAL("A0430","参数非法"), + CLIENT_ORDER_OVERTIME("A0444","订单已超时"), + CLIENT_ORDER_CLOSE("A0443","订单已关闭"), + + // 项目 + CLIENT_PROJECT_NOT_EXIST("A0450","项目不存在"), + // 菜单 + CLIENT_MENU_NOT_EXIST("A0460", "菜单不存在"), + CLIENT_MENU_PARENT_NOT_EXIST("A0461", "父菜单不存在"), + + // 用户 + CLIENT_ACCOUNT_USERNAME_EXISTED("A0480","账户名已存在"), + CLIENT_ACCOUNT_USERNAME_NULL("A0480","账户名不可为空"), + CLIENT_ACCOUNT_PASSWORD_NULL("A0481","账户密码不可为空"), + CLIENT_ACCOUNT_NOT_EXIST("A0201","用户账户不存在"), + CLIENT_ACCOUNT_FROZEN("A0202","用户账户被冻结"), + CLIENT_ACCOUNT_DELETE("A0203","用户账户已作废"), + CLIENT_ACCOUNT_DISABLED("A0204","用户账户不可用"), + CLIENT_ACCOUNT_ALREADY_ABANDON("A0205","用户账户已经弃用"), + CLIENT_ACCOUNT_HAS_NO_ROLE("A0206","用户账户未分配角色"), + CLIENT_ACCOUNT_ONLY_ONE_ROLE("A0207","用户账户只能拥有一个角色"), + + // + + // 角色 + CLIENT_ROLE_NOT_EXIST("A0250","角色不存在"), + CLIENT_ROLE_CODE_NOT_ON("A0251","角色未启用"), + CLIENT_ROLE_HAS_NO_PROJECT("A0252","角色未分配项目"), + CLIENT_ROLE_CODE_NOT_EXIST("A0253","角色code不存在"), + CLIENT_ROLE_DISABLED("A0253","角色未启用"), + + // 部门 + CLIENT_DEP_NOT_EXIST("A0270","部门不存在"), + CLIENT_DEP_NAME_EXIST("A0271","部门名称已存在"), + CLIENT_DEP_DISABLED("A0272","部门未启用"), + + // 权限 + CLIENT_PERMISSION_NOT_EXIST("A0280","权限不存在"), + + + + // 前端 + CLIENT_PARAM_NULL("C0001","请求关键参数为空"), + + // Redis + REDIS_KEY_NULL("R0001","系统redis入参为空"), + + + // 业务错误 + BUSINESS_ERROR("Y0001", "业务错误"), + + // 系统 + SERVER_ERROR("B0001","系统执行出错"), + SERVER_UPDATE_ERROR("B0002","数据更新失败"), + SERVER_ADD_ERROR("B00003","数据新增失败"), + SERVER_DEL_ERROR("B00004","数据删除失败"), + SERVER_PARAM_NULL("B00005","系统入参为空"), + SERVER_BATCH_ADD_ERROR("B00006","数据批量新增失败"), + SERVER_BATCH_UPDATE_ERROR("B00007","数据批量修改失败"), + SERVER_DATABASE_DATA_DUPLICATED("B00008","数据库内部记录重复"), + SERVER_UPDATE_DATA_NO_CHANGE("B00009","更新数据没有发生变化"), + SERVER_EXEC_OUTTIME("B0100","系统执行超时"), + SERVER_DEL_OVER_SIZE("B00010","批量删除个数过多"), + + + // RPC + RPC_RESULT_NULL("R0001","RPC没有返回"), + RPC_DATA_NULL("R0002","RPC数据为空"), + RPC_DATA_TYPE_NOT_MATCH("R0003","RPC数据返回类型不匹配"), + RPC_ACCESS_EXCEPTION("R0004","RPC访问异常"), + + // 请求 + CLIENT_METHOD_NOT_MATCH("M0001","请求方法不匹配") + ; + + + + ResultCodes(String code, String desc) { + this.code = code; + this.desc = desc; + } + + private String code; + private String desc; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/SendStatus.java b/src/main/java/com/gk/hotwork/Domain/Enum/SendStatus.java new file mode 100644 index 0000000..c648a7a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/SendStatus.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SendStatus { + + UN_SEND(0,"未发送"), + SUCCESS(1, "发送成功"), + FAILURE(2, "发送失败"), + + ; + + + SendStatus(int status, String msg) { + this.status = status; + this.msg = msg; + } + + int status; + @JsonValue + String msg; + + public int getStatus() { + return status; + } + + public String getMsg() { + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/SmsSource.java b/src/main/java/com/gk/hotwork/Domain/Enum/SmsSource.java new file mode 100644 index 0000000..2e591c1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/SmsSource.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.Domain.Enum; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SmsSource { + + WARN(1,"报警信息"); + + + SmsSource(int code, String msg) { + this.code = code; + this.msg = msg; + } + + int code; + @JsonValue + String msg; + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/SourceType.java b/src/main/java/com/gk/hotwork/Domain/Enum/SourceType.java new file mode 100644 index 0000000..7a18666 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/SourceType.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Domain.Enum; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SourceType { + + WEB("WEB","网页"), + APP("APP","安卓"); + + + SourceType(String code, String msg) { + this.code = code; + this.msg = msg; + } + + String code; + @JsonValue + String msg; +} diff --git a/src/main/java/com/gk/hotwork/Domain/Enum/TaskType.java b/src/main/java/com/gk/hotwork/Domain/Enum/TaskType.java new file mode 100644 index 0000000..8980b6a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Enum/TaskType.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Domain.Enum; + +public enum TaskType { + HOT(1,"动火作业"), + SPACE(2,"受限空间作业"), + HOISTING(3,"吊装作业"), + BLIND(4,"盲板抽堵作业"), + ELECTRIC(5,"临时用电作业"), + HIGH(6,"高处作业"), + BREAK(7,"断路作业"), + SOILD(8,"动土作业"), + + + + + + + ; + + + TaskType(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int code; + public String msg; + + public static Byte getTaskType(String msg) { + int taskTypeCode = 0; + for (TaskType type : TaskType.values()){ + if (type.msg.equals(msg)){ + taskTypeCode = type.code; + } + } + return (byte) taskTypeCode; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/EquipmentInfo.java b/src/main/java/com/gk/hotwork/Domain/EquipmentInfo.java new file mode 100644 index 0000000..ee0c6d4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/EquipmentInfo.java @@ -0,0 +1,141 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("equipment") +public class EquipmentInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 设备名称 name **/ + private String name; + + /** 设备条码 number **/ + private String number; + + /** 是否有摄像头 isphoto **/ + private Byte isphoto; + + /** 摄像头名称 photoname **/ + private String photoname; + + /** 摄像头地址 photoaddress **/ + private String photoaddress; + + /** 更新时间 updatetime **/ + private Date updatetime; + + /** 更新人 updateby **/ + private String updateby; + + /** 状态(0:未领用;1:使用中) status **/ + private Byte status; + + @TableField(exist = false) + private Boolean isFireMan; + + /** 设备表 id **/ + public Long getId() { + return id; + } + + /** 设备表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 设备名称 name **/ + public String getName() { + return name; + } + + /** 设备名称 name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** 设备条码 number **/ + public String getNumber() { + return number; + } + + /** 设备条码 number **/ + public void setNumber(String number) { + this.number = number == null ? null : number.trim(); + } + + /** 是否有摄像头 isphoto **/ + public Byte getIsphoto() { + return isphoto; + } + + /** 是否有摄像头 isphoto **/ + public void setIsphoto(Byte isphoto) { + this.isphoto = isphoto; + } + + /** 摄像头名称 photoname **/ + public String getPhotoname() { + return photoname; + } + + /** 摄像头名称 photoname **/ + public void setPhotoname(String photoname) { + this.photoname = photoname == null ? null : photoname.trim(); + } + + /** 摄像头地址 photoaddress **/ + public String getPhotoaddress() { + return photoaddress; + } + + /** 摄像头地址 photoaddress **/ + public void setPhotoaddress(String photoaddress) { + this.photoaddress = photoaddress == null ? null : photoaddress.trim(); + } + + /** 更新时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 更新时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + /** 更新人 updateby **/ + public String getUpdateby() { + return updateby; + } + + /** 更新人 updateby **/ + public void setUpdateby(String updateby) { + this.updateby = updateby == null ? null : updateby.trim(); + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Boolean getIsFireMan() { + return isFireMan; + } + + public void setIsFireMan(Boolean fireMan) { + isFireMan = fireMan; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/ExamScoreInfo.java b/src/main/java/com/gk/hotwork/Domain/ExamScoreInfo.java new file mode 100644 index 0000000..be3148e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/ExamScoreInfo.java @@ -0,0 +1,132 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("examscore") +public class ExamScoreInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 真实姓名 realname **/ + private String realname; + + /** 手机号 mobile **/ + private String mobile; + + /** 身份证 idcard **/ + private String idcard; + + /** 考试类型 examtype **/ + private String examtype; + + /** 分数 score **/ + private Integer score; + + /** 有效期结束时间 starttime **/ + private Date starttime; + + /** 有效期结束时间 endtime **/ + private Date endtime; + + /** 创建时间 createtime **/ + private Date createtime; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 真实姓名 realname **/ + public String getRealname() { + return realname; + } + + /** 真实姓名 realname **/ + public void setRealname(String realname) { + this.realname = realname == null ? null : realname.trim(); + } + + /** 手机号 mobile **/ + public String getMobile() { + return mobile; + } + + /** 手机号 mobile **/ + public void setMobile(String mobile) { + this.mobile = mobile == null ? null : mobile.trim(); + } + + /** 身份证 idcard **/ + public String getIdcard() { + return idcard; + } + + /** 身份证 idcard **/ + public void setIdcard(String idcard) { + this.idcard = idcard == null ? null : idcard.trim(); + } + + /** 考试类型 examtype **/ + public String getExamtype() { + return examtype; + } + + /** 考试类型 examtype **/ + public void setExamtype(String examtype) { + this.examtype = examtype == null ? null : examtype.trim(); + } + + /** 分数 score **/ + public Integer getScore() { + return score; + } + + /** 分数 score **/ + public void setScore(Integer score) { + this.score = score; + } + + /** 有效期结束时间 starttime **/ + public Date getStarttime() { + return starttime; + } + + /** 有效期结束时间 starttime **/ + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + /** 有效期结束时间 endtime **/ + public Date getEndtime() { + return endtime; + } + + /** 有效期结束时间 endtime **/ + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + /** 创建时间 createtime **/ + public Date getCreatetime() { + return createtime; + } + + /** 创建时间 createtime **/ + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Exception/AusinessException.java b/src/main/java/com/gk/hotwork/Domain/Exception/AusinessException.java new file mode 100644 index 0000000..91392fb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Exception/AusinessException.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Domain.Exception; + +public class AusinessException extends RuntimeException { + + private String code; + + private String message; + + public AusinessException(String code, String message) { + super(message); + this.message = message; + this.code = code; + } + + public AusinessException(E e, String message) { + super(message); + this.message = message; + this.code = e.getCode(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + @Override + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Exception/BusinessException.java b/src/main/java/com/gk/hotwork/Domain/Exception/BusinessException.java new file mode 100644 index 0000000..2867e08 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Exception/BusinessException.java @@ -0,0 +1,47 @@ +package com.gk.hotwork.Domain.Exception; + +import com.gk.hotwork.Domain.Enum.ResultCodes; + +public class BusinessException extends RuntimeException{ + private String code; + private String error; + + public BusinessException(String message) { + super(message); + } + + public BusinessException(ResultCodes code) { + super(code.getDesc()); + this.code = code.getCode(); + this.error = code.getDesc(); + + } + + public BusinessException(String code, String error) { + super(error); + this.code = code; + this.error = error; + } + + public BusinessException(E e, String error) { + super(error); + this.code = e.getCode(); + this.error = error; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Exception/E.java b/src/main/java/com/gk/hotwork/Domain/Exception/E.java new file mode 100644 index 0000000..5722ddf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Exception/E.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.Domain.Exception; + +public enum E { + + DATA_PARAM_NULL("B0100","数据传参为空"), + DATA_PARAM_CHECK_INVALID("B0101","数据校验非法"), + DATA_DATABASE_EXIST("B0111","数据记录已存在"), + DATA_DATABASE_DUPLICATED("B0113","数据记录重复"), + DATA_DATABASE_NO_EXISTENT("B0114","查询不到对应记录"), + DATA_DATABASE_EXIST_BUT_NOT_VALID("B0115","记录无效"), + DATA_STATUS_NOT_EXIST("B0120","数据状态不存在"), + NOT_DELETE("B0131","无法删除"), + ADD_FAIL("B0132","新增失败"), + UPDATE_FAIL("B0133","修改失败"), + DATA_BING_RELATION("B0116","数据已被绑定关系"), + DATA_OPERATION_NO_PERMISSION("B0122","数据没有操作权限"), + DATA_STATUS_CHECK_INVALID("B0121","数据状态不合法"), + EXPORT_FAIL("B0134","导出失败!"), + ; + private String code; + private String desc; + + E(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Exception/Handler/CustomExceptionHandler.java b/src/main/java/com/gk/hotwork/Domain/Exception/Handler/CustomExceptionHandler.java new file mode 100644 index 0000000..0a7ad5d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Exception/Handler/CustomExceptionHandler.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Domain.Exception.Handler; + +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.Msg; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +@ControllerAdvice +public class CustomExceptionHandler { + + private Logger logger = LogManager.getLogger(CustomExceptionHandler.class); + @ResponseBody + @ExceptionHandler(value = BusinessException.class) + public Msg errorHandler(BusinessException ex){ + logger.warn(ex); + Msg msg = new Msg(); + msg.setCode("400"); + msg.setMessage(ex.getMessage()); + return msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/FourColorMap2.java b/src/main/java/com/gk/hotwork/Domain/FourColorMap2.java new file mode 100644 index 0000000..d33f2d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/FourColorMap2.java @@ -0,0 +1,123 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("four_color_map2") +public class FourColorMap2 implements Serializable { + + private static final long serialVersionUID = 1L; + /** 主键Id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 类型 type **/ + private String type; + + /** 坐标 geometry **/ + private String geometry; + + /** 四色图属性 properties **/ + private String properties; + + /** 吨位类型(1:60,2:130) etype **/ + private Integer etype; + + /** 标识 valid_flag **/ + private Boolean validFlag; + + private String createBy; + + private Date createTime; + + private Date updateTime; + + + /** 主键Id id **/ + public Long getId() { + return id; + } + + /** 主键Id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 类型 type **/ + public String getType() { + return type; + } + + /** 类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 坐标 geometry **/ + public String getGeometry() { + return geometry; + } + + /** 坐标 geometry **/ + public void setGeometry(String geometry) { + this.geometry = geometry == null ? null : geometry.trim(); + } + + /** 四色图属性 properties **/ + public String getProperties() { + return properties; + } + + /** 四色图属性 properties **/ + public void setProperties(String properties) { + this.properties = properties == null ? null : properties.trim(); + } + + /** 吨位类型(1:60,2:130) etype **/ + public Integer getEtype() { + return etype; + } + + /** 吨位类型(1:60,2:130) etype **/ + public void setEtype(Integer etype) { + this.etype = etype ; + } + + /** 标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/FourColorPoint.java b/src/main/java/com/gk/hotwork/Domain/FourColorPoint.java new file mode 100644 index 0000000..ec9b236 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/FourColorPoint.java @@ -0,0 +1,105 @@ +package com.gk.hotwork.Domain; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("four_color_map") +public class FourColorPoint implements Serializable{ + + @TableId(type = IdType.INPUT) + private String id; + + private Integer etype; + + private String name; + + private String type; + + private String text; + + private String shapeType; + + @TableField(value = "clamp_toground") + private boolean clampToGround; + + private String color; + + private String geoType; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getEtype() { + return etype; + } + + public void setEtype(Integer etype) { + this.etype = etype; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getShapeType() { + return shapeType; + } + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + public boolean isClampToGround() { + return clampToGround; + } + + public void setClampToGround(boolean clampToGround) { + this.clampToGround = clampToGround; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getGeoType() { + return geoType; + } + + public void setGeoType(String geoType) { + this.geoType = geoType; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/FourColorPointCoord.java b/src/main/java/com/gk/hotwork/Domain/FourColorPointCoord.java new file mode 100644 index 0000000..cb4f5f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/FourColorPointCoord.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("four_color_map_coord") +public class FourColorPointCoord implements Serializable{ + + @TableId(type = IdType.AUTO) + private Long id; + + private String pointId; + + private Float lon; + + private Float lat; + + private Float hei; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPointId() { + return pointId; + } + + public void setPointId(String pointId) { + this.pointId = pointId; + } + + public Float getLon() { + return lon; + } + + public void setLon(Float lon) { + this.lon = lon; + } + + public Float getLat() { + return lat; + } + + public void setLat(Float lat) { + this.lat = lat; + } + + public Float getHei() { + return hei; + } + + public void setHei(Float hei) { + this.hei = hei; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/GasWarnInfo.java b/src/main/java/com/gk/hotwork/Domain/GasWarnInfo.java new file mode 100644 index 0000000..d36e1fa --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/GasWarnInfo.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@TableName("gaswarn") +public class GasWarnInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 气体类型 gastype **/ + private String gastype; + + /** 报警类型(预警、报警) warntype **/ + private String warntype; + + /** 最大值 max **/ + private BigDecimal max; + + /** 最小值 min **/ + private BigDecimal min; + + /** 气体单位 gasunit **/ + private String gasunit; + + /** 更新时间 updatetime **/ + private Date updatetime; + + /** 更新人 updateby **/ + private String updateby; + + /** 气体报警阈值 id **/ + public Long getId() { + return id; + } + + /** 气体报警阈值 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 气体类型 gastype **/ + public String getGastype() { + return gastype; + } + + /** 气体类型 gastype **/ + public void setGastype(String gastype) { + this.gastype = gastype == null ? null : gastype.trim(); + } + + /** 报警类型(预警、报警) warntype **/ + public String getWarntype() { + return warntype; + } + + /** 报警类型(预警、报警) warntype **/ + public void setWarntype(String warntype) { + this.warntype = warntype == null ? null : warntype.trim(); + } + + /** 最大值 max **/ + public BigDecimal getMax() { + return max; + } + + /** 最大值 max **/ + public void setMax(BigDecimal max) { + this.max = max; + } + + /** 最小值 min **/ + public BigDecimal getMin() { + return min; + } + + /** 最小值 min **/ + public void setMin(BigDecimal min) { + this.min = min; + } + + /** 气体单位 gasunit **/ + public String getGasunit() { + return gasunit; + } + + /** 气体单位 gasunit **/ + public void setGasunit(String gasunit) { + this.gasunit = gasunit == null ? null : gasunit.trim(); + } + + /** 更新时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 更新时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + /** 更新人 updateby **/ + public String getUpdateby() { + return updateby; + } + + /** 更新人 updateby **/ + public void setUpdateby(String updateby) { + this.updateby = updateby == null ? null : updateby.trim(); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/HelpDocInfo.java b/src/main/java/com/gk/hotwork/Domain/HelpDocInfo.java new file mode 100644 index 0000000..dd52ac7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/HelpDocInfo.java @@ -0,0 +1,158 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("helpdoc") +public class HelpDocInfo { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 文件类型 filetype **/ + private String filetype; + + /** 文件名称 filename **/ + private String filename; + + /** 文件链接 fileurl **/ + private String fileurl; + + /** 版本号 version **/ + private Integer version; + + /** 备注 remark **/ + private String remark; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 created **/ + private Date created; + + /** 更新时间 updated **/ + private Date updated; + + /** 是否删除 isdel **/ + private Byte isdel; + + /** 标记 flag **/ + private Byte flag; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 文件类型 filetype **/ + public String getFiletype() { + return filetype; + } + + /** 文件类型 filetype **/ + public void setFiletype(String filetype) { + this.filetype = filetype == null ? null : filetype.trim(); + } + + /** 文件名称 filename **/ + public String getFilename() { + return filename; + } + + /** 文件名称 filename **/ + public void setFilename(String filename) { + this.filename = filename == null ? null : filename.trim(); + } + + /** 文件链接 fileurl **/ + public String getFileurl() { + return fileurl; + } + + /** 文件链接 fileurl **/ + public void setFileurl(String fileurl) { + this.fileurl = fileurl == null ? null : fileurl.trim(); + } + + /** 版本号 version **/ + public Integer getVersion() { + return version; + } + + /** 版本号 version **/ + public void setVersion(Integer version) { + this.version = version; + } + + /** 备注 remark **/ + public String getRemark() { + return remark; + } + + /** 备注 remark **/ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 created **/ + public Date getCreated() { + return created; + } + + /** 创建时间 created **/ + public void setCreated(Date created) { + this.created = created; + } + + /** 更新时间 updated **/ + public Date getUpdated() { + return updated; + } + + /** 更新时间 updated **/ + public void setUpdated(Date updated) { + this.updated = updated; + } + + /** 是否删除 isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除 isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/HiddenDanger.java b/src/main/java/com/gk/hotwork/Domain/HiddenDanger.java new file mode 100644 index 0000000..636a504 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/HiddenDanger.java @@ -0,0 +1,311 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gk.hotwork.Domain.Enum.HiddenDangerApplyStatus; +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("hiddendanger") +public class HiddenDanger implements Serializable { + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + private String code; + + /** 隐患级别 level **/ + private HiddenDangerLevel level; + + /** 单子状态(未确认,已确认,已整改) status **/ + private HiddenDangerApplyStatus status; + + /** 提出人 requestor **/ + private String requestor; + + /** 提出人id requestorid **/ + private Long requestorid; + + /** 创建(提出)时间 createtime **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm" , timezone = "GMT+8") + private Date createtime; + + /** 创建说明 createnote **/ + private String createnote; + + + /** 整改时间 rectifytime **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm" , timezone = "GMT+8") + private Date rectifytime; + + /** 整改说明 rectifynote **/ + private String rectifynote; + + private String rectifymeasure; + + private String rectifier; + + private Long rectifierid; + + /** 有效标识 validflag **/ + private Boolean validflag; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm" , timezone = "GMT+8") + private Date rectifydeadline; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm" , timezone = "GMT+8") + private Date accepttime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm" , timezone = "GMT+8") + private Date rejecttime; + + private String rejectnote; + + private String acceptnote; + + private Integer source; + + //上报文件 + @TableField(exist = false) + private List<HiddenDangerResource> reportResources; + + //整改文件 + @TableField(exist = false) + private List<HiddenDangerResource> rectifyResources; + + @TableField(exist = false) + private Integer countNum; + + @TableField(exist = false) + private String constructionunit; + + /** 隐患id id **/ + public Long getId() { + return id; + } + + /** 隐患id id **/ + public void setId(Long id) { + this.id = id; + } + + public HiddenDangerLevel getLevel() { + return level; + } + + public void setLevel(HiddenDangerLevel level) { + this.level = level; + } + + public List<HiddenDangerResource> getReportResources() { + return reportResources; + } + + public void setReportResources(List<HiddenDangerResource> reportResources) { + this.reportResources = reportResources; + } + + public List<HiddenDangerResource> getRectifyResources() { + return rectifyResources; + } + + public void setRectifyResources(List<HiddenDangerResource> rectifyResources) { + this.rectifyResources = rectifyResources; + } + + /** 隐患级别 level **/ + + + public HiddenDangerApplyStatus getStatus() { + return status; + } + + public void setStatus(HiddenDangerApplyStatus status) { + this.status = status; + } + + /** 提出人 requestor **/ + public String getRequestor() { + return requestor; + } + + /** 提出人 requestor **/ + public void setRequestor(String requestor) { + this.requestor = requestor == null ? null : requestor.trim(); + } + + + /** 提出人id requestorid **/ + public Long getRequestorid() { + return requestorid; + } + + /** 提出人id requestorid **/ + public void setRequestorid(Long requestorid) { + this.requestorid = requestorid; + } + + + /** 创建(提出)时间 createtime **/ + public Date getCreatetime() { + return createtime; + } + + /** 创建(提出)时间 createtime **/ + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + /** 创建说明 createnote **/ + public String getCreatenote() { + return createnote; + } + + /** 创建说明 createnote **/ + public void setCreatenote(String createnote) { + this.createnote = createnote == null ? null : createnote.trim(); + } + + /** 整改时间 rectifytime **/ + public Date getRectifytime() { + return rectifytime; + } + + /** 整改时间 rectifytime **/ + public void setRectifytime(Date rectifytime) { + this.rectifytime = rectifytime; + } + + /** 整改说明 rectifynote **/ + public String getRectifynote() { + return rectifynote; + } + + /** 整改说明 rectifynote **/ + public void setRectifynote(String rectifynote) { + this.rectifynote = rectifynote == null ? null : rectifynote.trim(); + } + + + + public Boolean getValidflag() { + return validflag; + } + + public void setValidflag(Boolean validflag) { + this.validflag = validflag; + } + + + + public Integer getCountNum() { + return countNum; + } + + public void setCountNum(Integer countNum) { + this.countNum = countNum; + } + + public String getConstructionunit() { + return constructionunit; + } + + public void setConstructionunit(String constructionunit) { + this.constructionunit = constructionunit; + } + + public String getRectifymeasure() { + return rectifymeasure; + } + + public void setRectifymeasure(String rectifymeasure) { + this.rectifymeasure = rectifymeasure; + } + + + public String getRectifier() { + return rectifier; + } + + public void setRectifier(String rectifier) { + this.rectifier = rectifier; + } + + public Date getRectifydeadline() { + return rectifydeadline; + } + + public void setRectifydeadline(Date rectifydeadline) { + this.rectifydeadline = rectifydeadline; + } + + public Long getRectifierid() { + return rectifierid; + } + + public void setRectifierid(Long rectifierid) { + this.rectifierid = rectifierid; + } + + + public Date getAccepttime() { + return accepttime; + } + + public void setAccepttime(Date accepttime) { + this.accepttime = accepttime; + } + + public Date getRejecttime() { + return rejecttime; + } + + public void setRejecttime(Date rejecttime) { + this.rejecttime = rejecttime; + } + + public String getRejectnote() { + return rejectnote; + } + + public void setRejectnote(String rejectnote) { + this.rejectnote = rejectnote; + } + + public String getAcceptnote() { + return acceptnote; + } + + public void setAcceptnote(String acceptnote) { + this.acceptnote = acceptnote; + } + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + + public Integer getSource() { + return source; + } + + public void setSource(Integer source) { + this.source = source; + } +} + diff --git a/src/main/java/com/gk/hotwork/Domain/HiddenDangerLog.java b/src/main/java/com/gk/hotwork/Domain/HiddenDangerLog.java new file mode 100644 index 0000000..a306652 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/HiddenDangerLog.java @@ -0,0 +1,128 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.gk.hotwork.Domain.Enum.SourceType; + +import java.io.Serializable; +import java.util.Date; + +@TableName("hiddendangerLog") +public class HiddenDangerLog implements Serializable { + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 操作人 operator **/ + private String operator; + + /** 操作人id operatorid **/ + private Long operatorid; + + /** 操作 operation **/ + private String operation; + + /** 操作时间 operationtime **/ + private Date operationtime; + + /** 内容 detail **/ + private String detail; + + /** 内容 detail **/ + private SourceType source; + + /** 额外 extra **/ + private String extra; + + /** 有效表示 validflag **/ + private Boolean validflag; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 操作人 operator **/ + public String getOperator() { + return operator; + } + + /** 操作人 operator **/ + public void setOperator(String operator) { + this.operator = operator == null ? null : operator.trim(); + } + + /** 操作人id operatorid **/ + public Long getOperatorid() { + return operatorid; + } + + /** 操作人id operatorid **/ + public void setOperatorid(Long operatorid) { + this.operatorid = operatorid; + } + + /** 操作 operation **/ + public String getOperation() { + return operation; + } + + /** 操作 operation **/ + public void setOperation(String operation) { + this.operation = operation == null ? null : operation.trim(); + } + + /** 操作时间 operationtime **/ + public Date getOperationtime() { + return operationtime; + } + + /** 操作时间 operationtime **/ + public void setOperationtime(Date operationtime) { + this.operationtime = operationtime; + } + + /** 内容 detail **/ + public String getDetail() { + return detail; + } + + /** 内容 detail **/ + public void setDetail(String detail) { + this.detail = detail == null ? null : detail.trim(); + } + + /** 额外 extra **/ + public String getExtra() { + return extra; + } + + /** 额外 extra **/ + public void setExtra(String extra) { + this.extra = extra == null ? null : extra.trim(); + } + + /** 有效表示 validflag **/ + public Boolean getValidflag() { + return validflag; + } + + /** 有效表示 validflag **/ + public void setValidflag(Boolean validflag) { + this.validflag = validflag; + } + + public SourceType getSource() { + return source; + } + + public void setSource(SourceType source) { + this.source = source; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/HiddenDangerResource.java b/src/main/java/com/gk/hotwork/Domain/HiddenDangerResource.java new file mode 100644 index 0000000..d8e729b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/HiddenDangerResource.java @@ -0,0 +1,153 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.gk.hotwork.Domain.Enum.HiddenDangerApplyOperation; +import com.gk.hotwork.Domain.Enum.SourceType; + +import java.io.Serializable; +import java.util.Date; + +@TableName("hiddendangerresource") +public class HiddenDangerResource implements Serializable { + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 操作(上传隐患、上传整改) operation **/ + private HiddenDangerApplyOperation operation; + + /** 所属隐患id belongid **/ + private Long belongid; + + /** 源文件名 originalfilename **/ + private String originalfilename; + + /** 文件名 filename **/ + private String filename; + + /** 文件类型 type **/ + private String type; + + /** 相对路径地址 url **/ + private String url; + + /** 创建时间 createtime **/ + private Date createtime; + + /** 有效标识 validflag **/ + private Boolean validflag; + + /** 排序 order **/ + private Integer sort; + + private SourceType source; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + public HiddenDangerApplyOperation getOperation() { + return operation; + } + + public void setOperation(HiddenDangerApplyOperation operation) { + this.operation = operation; + } + + /** 所属隐患id belongid **/ + public Long getBelongid() { + return belongid; + } + + /** 所属隐患id belongid **/ + public void setBelongid(Long belongid) { + this.belongid = belongid; + } + + /** 源文件名 originalfilename **/ + public String getOriginalfilename() { + return originalfilename; + } + + /** 源文件名 originalfilename **/ + public void setOriginalfilename(String originalfilename) { + this.originalfilename = originalfilename == null ? null : originalfilename.trim(); + } + + /** 文件名 filename **/ + public String getFilename() { + return filename; + } + + /** 文件名 filename **/ + public void setFilename(String filename) { + this.filename = filename == null ? null : filename.trim(); + } + + /** 文件类型 type **/ + public String getType() { + return type; + } + + /** 文件类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 相对路径地址 url **/ + public String getUrl() { + return url; + } + + /** 相对路径地址 url **/ + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + /** 创建时间 createtime **/ + public Date getCreatetime() { + return createtime; + } + + /** 创建时间 createtime **/ + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public Boolean getValidflag() { + return validflag; + } + + public void setValidflag(Boolean validflag) { + this.validflag = validflag; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public SourceType getSource() { + return source; + } + + public void setSource(SourceType source) { + this.source = source; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/InvolveDepInfo.java b/src/main/java/com/gk/hotwork/Domain/InvolveDepInfo.java new file mode 100644 index 0000000..3cfb280 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/InvolveDepInfo.java @@ -0,0 +1,67 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("involvedep") +public class InvolveDepInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** department **/ + private String department; + + /** 更新人 lastmodifiedby **/ + private String lastmodifiedby; + + /** 更新时间 lastmodifieddate **/ + private Date lastmodifieddate; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** department **/ + public String getDepartment() { + return department; + } + + /** department **/ + public void setDepartment(String department) { + this.department = department == null ? null : department.trim(); + } + + /** 更新人 lastmodifiedby **/ + public String getLastmodifiedby() { + return lastmodifiedby; + } + + /** 更新人 lastmodifiedby **/ + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby == null ? null : lastmodifiedby.trim(); + } + + /** 更新时间 lastmodifieddate **/ + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + /** 更新时间 lastmodifieddate **/ + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Log/HiddenDangerLogAnno.java b/src/main/java/com/gk/hotwork/Domain/Log/HiddenDangerLogAnno.java new file mode 100644 index 0000000..7527831 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Log/HiddenDangerLogAnno.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Domain.Log; + +import com.gk.hotwork.Domain.Enum.SourceType; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface HiddenDangerLogAnno { + + String operation() default ""; + String detail() default ""; + SourceType source() default SourceType.WEB; + +} diff --git a/src/main/java/com/gk/hotwork/Domain/MajorEquipment.java b/src/main/java/com/gk/hotwork/Domain/MajorEquipment.java new file mode 100644 index 0000000..11e6e8e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/MajorEquipment.java @@ -0,0 +1,186 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("major_equipment") +public class MajorEquipment implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 设备区域 area_id **/ + private Integer areaId; + + /** 设备区域名称 **/ + @TableField(exist = false) + private String areaName; + + /** 设备编号 serial_number **/ + private String serialNumber; + + /** 设备名称 name **/ + private String name; + + /** 状态 status 0:在用 1:停用**/ + private Integer status; + + /** 容积 volume **/ + private Float volume; + + /** 负责人 user_id **/ + private Long userId; + + /** 负责人名称 **/ + @TableField(exist = false) + private String userName; + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Float getVolume() { + return volume; + } + + public void setVolume(Float volume) { + this.volume = volume; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Integer getAreaId() { + return areaId; + } + + public void setAreaId(Integer areaId) { + this.areaId = areaId; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/MajorEquipmentAlarm.java b/src/main/java/com/gk/hotwork/Domain/MajorEquipmentAlarm.java new file mode 100644 index 0000000..bf9c7cc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/MajorEquipmentAlarm.java @@ -0,0 +1,179 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("major_equipment_alarm") +public class MajorEquipmentAlarm implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 设备id equipment_id **/ + private Long equipmentId; + + /** 设备名称 **/ + @TableField(exist = false) + private String equipmentName; + + /** 设备编号 **/ + @TableField(exist = false) + private String equipmentSerialNumber; + + /** 状态 status 0:未处理 1:已处理**/ + private Integer status; + + /** 报警时间 alarm_time **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date alarmTime; + + /** 报警信息 alarm_info **/ + private String alarmInfo; + + /** 备注 remark **/ + private String remark; + + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public Long getEquipmentId() { + return equipmentId; + } + + public void setEquipmentId(Long equipmentId) { + this.equipmentId = equipmentId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getAlarmTime() { + return alarmTime; + } + + public void setAlarmTime(Date alarmTime) { + this.alarmTime = alarmTime; + } + + public String getAlarmInfo() { + return alarmInfo; + } + + public void setAlarmInfo(String alarmInfo) { + this.alarmInfo = alarmInfo; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentSerialNumber() { + return equipmentSerialNumber; + } + + public void setEquipmentSerialNumber(String equipmentSerialNumber) { + this.equipmentSerialNumber = equipmentSerialNumber; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/MajorEquipmentData.java b/src/main/java/com/gk/hotwork/Domain/MajorEquipmentData.java new file mode 100644 index 0000000..b468439 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/MajorEquipmentData.java @@ -0,0 +1,223 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("major_equipment_data") +public class MajorEquipmentData implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 设备id equipment_id **/ + private Long equipmentId; + + /** 监测时间 monitoring_time **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date monitoringTime; + + /** 设备名称 **/ + @TableField(exist = false) + private String equipmentName; + + /** 设备编号 **/ + @TableField(exist = false) + private String equipmentSerialNumber; + + /** 导入excel的序号 **/ + @TableField(exist = false) + private String index; + + /** 仪表量程下限 range_lower_limit **/ + private Float rangeLowerLimit; + + /** 仪表量程上限 range_upper_limit **/ + private Float rangeUpperLimit; + + /** 高高液位报警值 high_high_liquid_alarm **/ + private Float highHighLiquidAlarm; + + /** 高液位报警值 high_liquid_alarm **/ + private Float highLiquidAlarm; + + /** 低液位报警值 low_liquid_alarm**/ + private Float lowLiquidAlarm; + + /** 低低液位报警值 low_low_liquid_alarm**/ + private Float lowLowLiquidAlarm; + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public Long getEquipmentId() { + return equipmentId; + } + + public void setEquipmentId(Long equipmentId) { + this.equipmentId = equipmentId; + } + + public Float getRangeLowerLimit() { + return rangeLowerLimit; + } + + public void setRangeLowerLimit(Float rangeLowerLimit) { + this.rangeLowerLimit = rangeLowerLimit; + } + + public Float getRangeUpperLimit() { + return rangeUpperLimit; + } + + public void setRangeUpperLimit(Float rangeUpperLimit) { + this.rangeUpperLimit = rangeUpperLimit; + } + + public Float getHighHighLiquidAlarm() { + return highHighLiquidAlarm; + } + + public void setHighHighLiquidAlarm(Float highHighLiquidAlarm) { + this.highHighLiquidAlarm = highHighLiquidAlarm; + } + + public Float getHighLiquidAlarm() { + return highLiquidAlarm; + } + + public void setHighLiquidAlarm(Float highLiquidAlarm) { + this.highLiquidAlarm = highLiquidAlarm; + } + + public Float getLowLiquidAlarm() { + return lowLiquidAlarm; + } + + public void setLowLiquidAlarm(Float lowLiquidAlarm) { + this.lowLiquidAlarm = lowLiquidAlarm; + } + + public Float getLowLowLiquidAlarm() { + return lowLowLiquidAlarm; + } + + public void setLowLowLiquidAlarm(Float lowLowLiquidAlarm) { + this.lowLowLiquidAlarm = lowLowLiquidAlarm; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentSerialNumber() { + return equipmentSerialNumber; + } + + public void setEquipmentSerialNumber(String equipmentSerialNumber) { + this.equipmentSerialNumber = equipmentSerialNumber; + } + + public Date getMonitoringTime() { + return monitoringTime; + } + + public void setMonitoringTime(Date monitoringTime) { + this.monitoringTime = monitoringTime; + } + + public String getIndex() { + return index; + } + + public void setIndex(String index) { + this.index = index; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/PermissionInfo.java b/src/main/java/com/gk/hotwork/Domain/PermissionInfo.java new file mode 100644 index 0000000..c2af734 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/PermissionInfo.java @@ -0,0 +1,273 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("permission") +public class PermissionInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Integer id; + + /** 名称 name **/ + private String name; + + /** 菜单层级 level **/ + private Integer level; + + /** 菜单标题 title **/ + private String title; + + /** 页面路径/资源链接url path **/ + private String path; + + /** 前端组件 component **/ + private String component; + + /** 图标 icon **/ + private String icon; + + /** 按钮权限类型 buttonType **/ + private String buttontype; + + /** 状态 status 是否启用 1启用 -1禁用**/ + private Integer status; + + /** 描述 description **/ + private String description; + + /** 排序 sortOrder **/ + private Double sortorder; + + /** 类型 type 1菜单 2按钮 3功能 4数据权限 **/ + private Integer type; + + /** 拓展 节点展开 前端所需 expand **/ + private Boolean expand; + + /** 是否勾选 前端所需 checked **/ + private Boolean checked; + + /** 是否选中 前端所需 selected **/ + private Boolean selected; + + /** 创建人 createdBy **/ + private String createdby; + + /** 创建时间 createdDate **/ + private Date createddate; + + /** 更新人 lastModifiedBy **/ + private String lastmodifiedby; + + /** 更新时间 lastModifiedDate **/ + private Date lastmodifieddate; + + /** 父id parentid **/ + private Integer parentid; + + /** id id **/ + public Integer getId() { + return id; + } + + /** id id **/ + public void setId(Integer id) { + this.id = id; + } + + /** 名称 name **/ + public String getName() { + return name; + } + + /** 名称 name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** 级别 level **/ + public Integer getLevel() { + return level; + } + + /** 级别 level **/ + public void setLevel(Integer level) { + this.level = level; + } + + /** 名称 title **/ + public String getTitle() { + return title; + } + + /** 名称 title **/ + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + + /** 路径 path **/ + public String getPath() { + return path; + } + + /** 路径 path **/ + public void setPath(String path) { + this.path = path == null ? null : path.trim(); + } + + /** 接口路径 component **/ + public String getComponent() { + return component; + } + + /** 接口路径 component **/ + public void setComponent(String component) { + this.component = component == null ? null : component.trim(); + } + + /** 图标 icon **/ + public String getIcon() { + return icon; + } + + /** 图标 icon **/ + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } + + /** 按钮类型 buttonType **/ + public String getButtontype() { + return buttontype; + } + + /** 按钮类型 buttonType **/ + public void setButtontype(String buttontype) { + this.buttontype = buttontype == null ? null : buttontype.trim(); + } + + /** 状态 status **/ + public Integer getStatus() { + return status; + } + + /** 状态 status **/ + public void setStatus(Integer status) { + this.status = status; + } + + /** 描述 description **/ + public String getDescription() { + return description; + } + + /** 描述 description **/ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** 排序 sortOrder **/ + public Double getSortorder() { + return sortorder; + } + + /** 排序 sortOrder **/ + public void setSortorder(Double sortorder) { + this.sortorder = sortorder; + } + + /** 类型 type **/ + public Integer getType() { + return type; + } + + /** 类型 type **/ + public void setType(Integer type) { + this.type = type; + } + + /** 拓展 expand **/ + public Boolean getExpand() { + return expand; + } + + /** 拓展 expand **/ + public void setExpand(Boolean expand) { + this.expand = expand; + } + + /** 是否检查 checked **/ + public Boolean getChecked() { + return checked; + } + + /** 是否检查 checked **/ + public void setChecked(Boolean checked) { + this.checked = checked; + } + + /** 是否选中 selected **/ + public Boolean getSelected() { + return selected; + } + + /** 是否选中 selected **/ + public void setSelected(Boolean selected) { + this.selected = selected; + } + + /** 创建人 createdBy **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdBy **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createdDate **/ + public Date getCreateddate() { + return createddate; + } + + /** 创建时间 createdDate **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** 更新人 lastModifiedBy **/ + public String getLastmodifiedby() { + return lastmodifiedby; + } + + /** 更新人 lastModifiedBy **/ + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby == null ? null : lastmodifiedby.trim(); + } + + /** 更新时间 lastModifiedDate **/ + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + /** 更新时间 lastModifiedDate **/ + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } + + public Integer getParentid() { + return parentid; + } + + public void setParentid(Integer parentid) { + this.parentid = parentid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Reserve.java b/src/main/java/com/gk/hotwork/Domain/Reserve.java new file mode 100644 index 0000000..e50354b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Reserve.java @@ -0,0 +1,238 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("reserve") +public class Reserve implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** 主键id id **/ + private Long id; + + /** 受限空间 space **/ + private Integer space; + + /** 吊装作业 hoisting **/ + private Integer hoisting; + + /** 动土作业 soild **/ + private Integer soild; + + /** 断路 break **/ + private Integer breaks; + + /** 高处作业 high **/ + private Integer high; + + /** 临时用电 electricity **/ + private Integer electricity; + + /** 盲板 blindboard **/ + private Integer blindboard; + + /** 动火方式 fire **/ + private Integer fire; + + /** 预约时间 appointment **/ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") + private Date appointment; + + /** 创建时间 createtime **/ + private Date createtime; + + /** 更新时间 updatetime **/ + private Date updatetime; + + /** 有效标识 validflag **/ + private Boolean validflag; + + /** 创建人id createby **/ + private Long createby; + + /** 创建人name createbyname **/ + private String createbyname; + + /** 更新人name updatebyname **/ + private String updatebyname; + + private String createbydepartment; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 受限空间 space **/ + public Integer getSpace() { + return space; + } + + /** 受限空间 space **/ + public void setSpace(Integer space) { + this.space = space; + } + + /** 吊装作业 hoisting **/ + public Integer getHoisting() { + return hoisting; + } + + /** 吊装作业 hoisting **/ + public void setHoisting(Integer hoisting) { + this.hoisting = hoisting; + } + + /** 动土作业 soild **/ + public Integer getSoild() { + return soild; + } + + /** 动土作业 soild **/ + public void setSoild(Integer soild) { + this.soild = soild; + } + + /** 断路 break **/ + public Integer getBreaks() { + return breaks; + } + + public void setBreaks(Integer breaks) { + this.breaks = breaks; + } + + /** 高处作业 high **/ + public Integer getHigh() { + return high; + } + + /** 高处作业 high **/ + public void setHigh(Integer high) { + this.high = high; + } + + /** 临时用电 electricity **/ + public Integer getElectricity() { + return electricity; + } + + /** 临时用电 electricity **/ + public void setElectricity(Integer electricity) { + this.electricity = electricity; + } + + /** 盲板 blindboard **/ + public Integer getBlindboard() { + return blindboard; + } + + /** 盲板 blindboard **/ + public void setBlindboard(Integer blindboard) { + this.blindboard = blindboard; + } + + /** 动火方式 fire **/ + public Integer getFire() { + return fire; + } + + /** 动火方式 fire **/ + public void setFire(Integer fire) { + this.fire = fire; + } + + /** 预约时间 appointment **/ + public Date getAppointment() { + return appointment; + } + + /** 预约时间 appointment **/ + public void setAppointment(Date appointment) { + this.appointment = appointment; + } + + /** 创建时间 createtime **/ + public Date getCreatetime() { + return createtime; + } + + /** 创建时间 createtime **/ + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + /** 更新时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 更新时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + /** 有效标识 validflag **/ + public Boolean getValidflag() { + return validflag; + } + + /** 有效标识 validflag **/ + public void setValidflag(Boolean validflag) { + this.validflag = validflag; + } + + /** 创建人id createby **/ + public Long getCreateby() { + return createby; + } + + /** 创建人id createby **/ + public void setCreateby(Long createby) { + this.createby = createby; + } + + /** 创建人name createbyname **/ + public String getCreatebyname() { + return createbyname; + } + + /** 创建人name createbyname **/ + public void setCreatebyname(String createbyname) { + this.createbyname = createbyname == null ? null : createbyname.trim(); + } + + /** 更新人name updatebyname **/ + public String getUpdatebyname() { + return updatebyname; + } + + /** 更新人name updatebyname **/ + public void setUpdatebyname(String updatebyname) { + this.updatebyname = updatebyname == null ? null : updatebyname.trim(); + } + + public String getCreatebydepartment() { + return createbydepartment; + } + + public void setCreatebydepartment(String createbydepartment) { + this.createbydepartment = createbydepartment; + } + + + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskAnaUnit.java b/src/main/java/com/gk/hotwork/Domain/RiskAnaUnit.java new file mode 100644 index 0000000..8155834 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskAnaUnit.java @@ -0,0 +1,243 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("risk_ana_unit") +public class RiskAnaUnit implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 id + **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 危险源编码 hazard_code + **/ + private String hazardCode; + + /** + * 安全风险分析对象所属部门 hazard_dep + **/ + private String hazardDep; + + /** + * 安全风险分析对象所属部分负责人姓名 hazard_liable_person + **/ + private String hazardLiablePerson; + + /** + * 安全风险分析单元名称 risk_uint_name + **/ + private String riskUnitName; + + /** + * 创建时间 create_time + **/ + private Date createTime; + + /** + * 最新修改时间 update_time + **/ + private Date updateTime; + + /** + * 创建人 create_by + **/ + private String createBy; + + /** + * 最后修改人 update_by + **/ + private String updateBy; + + /** + * 是否有效 valid_flag + **/ + private Boolean validFlag; + + /** + * 安全风险分析对象所属部分负责人姓名id hazard_liable_person_id + **/ + private Long hazardLiablePersonId; + + /** + * 安全风险分析对象所属部门id hazard_dep_id + **/ + private Long hazardDepId; + + /** + * 主键 id + **/ + public Long getId() { + return id; + } + + /** + * 主键 id + **/ + public void setId(Long id) { + this.id = id; + } + + /** + * 危险源编码 hazard_code + **/ + public String getHazardCode() { + return hazardCode; + } + + /** + * 危险源编码 hazard_code + **/ + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode == null ? null : hazardCode.trim(); + } + + /** + * 安全风险分析对象所属部门 hazard_dep + **/ + public String getHazardDep() { + return hazardDep; + } + + /** + * 安全风险分析对象所属部门 hazard_dep + **/ + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep == null ? null : hazardDep.trim(); + } + + /** + * 安全风险分析对象所属部分负责人姓名 hazard_liable_person + **/ + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + /** + * 安全风险分析对象所属部分负责人姓名 hazard_liable_person + **/ + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson == null ? null : hazardLiablePerson.trim(); + } + + /** + * 安全风险分析单元名称 risk_uint_name + **/ + public String getRiskUnitName() { + return riskUnitName; + } + + /** + * 安全风险分析单元名称 risk_uint_name + **/ + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName == null ? null : riskUnitName.trim(); + } + + /** + * 创建时间 create_time + **/ + public Date getCreateTime() { + return createTime; + } + + /** + * 创建时间 create_time + **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 最新修改时间 update_time + **/ + public Date getUpdateTime() { + return updateTime; + } + + /** + * 最新修改时间 update_time + **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * 创建人 create_by + **/ + public String getCreateBy() { + return createBy; + } + + /** + * 创建人 create_by + **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** + * 最后修改人 update_by + **/ + public String getUpdateBy() { + return updateBy; + } + + /** + * 最后修改人 update_by + **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + /** + * 是否有效 valid_flag + **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** + * 是否有效 valid_flag + **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** + * 安全风险分析对象所属部分负责人姓名id hazard_liable_person_id + **/ + public Long getHazardLiablePersonId() { + return hazardLiablePersonId; + } + + /** + * 安全风险分析对象所属部分负责人姓名id hazard_liable_person_id + **/ + public void setHazardLiablePersonId(Long hazardLiablePersonId) { + this.hazardLiablePersonId = hazardLiablePersonId; + } + + /** + * 安全风险分析对象所属部门id hazard_dep_id + **/ + public Long getHazardDepId() { + return hazardDepId; + } + + /** + * 安全风险分析对象所属部门id hazard_dep_id + **/ + public void setHazardDepId(Long hazardDepId) { + this.hazardDepId = hazardDepId; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskControlClassify.java b/src/main/java/com/gk/hotwork/Domain/RiskControlClassify.java new file mode 100644 index 0000000..c9cfccc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskControlClassify.java @@ -0,0 +1,160 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("risk_control_classify") +public class RiskControlClassify implements Serializable { + + private final static long serialVersionUID = 1L; + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 措施分类 name **/ + private String name; + + /** 备注 note **/ + private String note; + + /** 排序 order_index **/ + private Integer orderIndex; + + /** 父类id parent_id **/ + private Long parentId; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最后更新时间 update_time **/ + private Date updateTime; + + /** 最后更信任 update_by **/ + private String updateBy; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** + * @Description: 子类 + */ + @TableField(exist = false) + private List<RiskControlClassify> subClassify; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 措施分类 name **/ + public String getName() { + return name; + } + + /** 措施分类 name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** 备注 note **/ + public String getNote() { + return note; + } + + /** 备注 note **/ + public void setNote(String note) { + this.note = note == null ? null : note.trim(); + } + + /** 排序 order_index **/ + public Integer getOrderIndex() { + return orderIndex; + } + + /** 排序 order_index **/ + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + + /** 父类id parent_id **/ + public Long getParentId() { + return parentId; + } + + /** 父类id parent_id **/ + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最后更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最后更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更信任 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更信任 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + public List<RiskControlClassify> getSubClassify() { + return subClassify; + } + + public void setSubClassify(List<RiskControlClassify> subClassify) { + this.subClassify = subClassify; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskControlMeasure.java b/src/main/java/com/gk/hotwork/Domain/RiskControlMeasure.java new file mode 100644 index 0000000..ccd039c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskControlMeasure.java @@ -0,0 +1,302 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("risk_control_measure") +public class RiskControlMeasure implements Serializable { + + private final static long serialVersionUID = 1L; + /** + * id + **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 所属安全事件id risk_event_id + **/ + private Long riskEventId; + + /** + * 自动化监控:1;隐患排查2 data_src + **/ + private String dataSrc; + + /** + * 管控措施描述 risk_measure_desc + **/ + private String riskMeasureDesc; + + /** + * classify1 + **/ + private String classify1; + + /** + * classify2 + **/ + private String classify2; + + /** + * 企业自己定义 classify3 + **/ + private String classify3; + + /** + * 隐患排查内容 troubleshoot_content + **/ + private String troubleshootContent; + + /** + * --周期时间数值 time_effect + **/ + private String timeEffect; + + /** + * --周期时间单位 time_unit + **/ + private String timeUnit; + /** + * 有效标识 valid_flag + **/ + private Boolean validFlag; + + /** + * 创建时间 create_time + **/ + private Date createTime; + + /** + * 最新修改时间 update_time + **/ + private Date updateTime; + + /** + * 创建人 create_by + **/ + private String createBy; + + /** + * 最后修改人 update_by + **/ + private String updateBy; + + @TableField(exist = false) + private RiskEvent riskEvent; + + /** + * id + **/ + public Long getId() { + + return id; + } + + public String getTimeEffect() { + return timeEffect; + } + + public void setTimeEffect(String timeEffect) { + this.timeEffect = timeEffect; + } + + public String getTimeUnit() { + return timeUnit; + } + + public void setTimeUnit(String timeUnit) { + this.timeUnit = timeUnit; + } + + /** + * id + **/ + public void setId(Long id) { + this.id = id; + } + + /** + * 所属安全事件id risk_event_id + **/ + public Long getRiskEventId() { + return riskEventId; + } + + /** + * 所属安全事件id risk_event_id + **/ + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + /** + * 自动化监控:1;隐患排查2 data_src + **/ + public String getDataSrc() { + return dataSrc; + } + + /** + * 自动化监控:1;隐患排查2 data_src + **/ + public void setDataSrc(String dataSrc) { + this.dataSrc = dataSrc == null ? null : dataSrc.trim(); + } + + + + /** + * 管控措施描述 risk_measure_desc + **/ + public String getRiskMeasureDesc() { + return riskMeasureDesc; + } + + /** + * 管控措施描述 risk_measure_desc + **/ + public void setRiskMeasureDesc(String riskMeasureDesc) { + this.riskMeasureDesc = riskMeasureDesc == null ? null : riskMeasureDesc.trim(); + } + + /** + * classify1 + **/ + public String getClassify1() { + return classify1; + } + + /** + * classify1 + **/ + public void setClassify1(String classify1) { + this.classify1 = classify1 == null ? null : classify1.trim(); + } + + /** + * classify2 + **/ + public String getClassify2() { + return classify2; + } + + /** + * classify2 + **/ + public void setClassify2(String classify2) { + this.classify2 = classify2 == null ? null : classify2.trim(); + } + + /** + * 企业自己定义 classify3 + **/ + public String getClassify3() { + return classify3; + } + + /** + * 企业自己定义 classify3 + **/ + public void setClassify3(String classify3) { + this.classify3 = classify3 == null ? null : classify3.trim(); + } + + /** + * 隐患排查内容 troubleshoot_content + **/ + public String getTroubleshootContent() { + return troubleshootContent; + } + + /** + * 隐患排查内容 troubleshoot_content + **/ + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent == null ? null : troubleshootContent.trim(); + } + + /** + * 有效标识 valid_flag + **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** + * 有效标识 valid_flag + **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** + * 创建时间 create_time + **/ + public Date getCreateTime() { + return createTime; + } + + /** + * 创建时间 create_time + **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 最新修改时间 update_time + **/ + public Date getUpdateTime() { + return updateTime; + } + + /** + * 最新修改时间 update_time + **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * 创建人 create_by + **/ + public String getCreateBy() { + return createBy; + } + + /** + * 创建人 create_by + **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** + * 最后修改人 update_by + **/ + public String getUpdateBy() { + return updateBy; + } + + /** + * 最后修改人 update_by + **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public RiskEvent getRiskEvent() { + return riskEvent; + } + + public void setRiskEvent(RiskEvent riskEvent) { + this.riskEvent = riskEvent; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskEvent.java b/src/main/java/com/gk/hotwork/Domain/RiskEvent.java new file mode 100644 index 0000000..ed94c28 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskEvent.java @@ -0,0 +1,134 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("risk_event") +public class RiskEvent implements Serializable { + + private final static long serialVersionUID = 1L; + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 所属安全风险单元id risk_unit_id **/ + private Long riskUnitId; + + /** 安全风险事件名称 risk_event_name **/ + private String riskEventName; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + /** + * @Description: 所属风险单元 + */ + @TableField(exist = false) + private RiskAnaUnit riskAnaUnit; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 所属安全风险单元id risk_unit_id **/ + public Long getRiskUnitId() { + return riskUnitId; + } + + /** 所属安全风险单元id risk_unit_id **/ + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + /** 安全风险事件名称 risk_event_name **/ + public String getRiskEventName() { + return riskEventName; + } + + /** 安全风险事件名称 risk_event_name **/ + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName == null ? null : riskEventName.trim(); + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + + public RiskAnaUnit getRiskAnaUnit() { + return riskAnaUnit; + } + + public void setRiskAnaUnit(RiskAnaUnit riskAnaUnit) { + this.riskAnaUnit = riskAnaUnit; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskMap.java b/src/main/java/com/gk/hotwork/Domain/RiskMap.java new file mode 100644 index 0000000..c1d4671 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskMap.java @@ -0,0 +1,127 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * 安全风险分布图 + */ +@TableName(value = "risk_map") +public class RiskMap { + + //ID,主键 + @TableId(type = IdType.AUTO) + private Long id; + + + //状态 0-正常 1-物理删除 + private Byte status; + + //图片路径 + private String img; + + //创建人ID + private Long createUid; + + //创建时间 + private Date createTime; + + private Long editUid; + + //最后编辑时间 + private Date editTime; + + //创建人名字 + private String createUname; + + //最后编辑人名字 + private String editUname; + + //描述 + private String descInfo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getEditTime() { + return editTime; + } + + public void setEditTime(Date editTime) { + this.editTime = editTime; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public String getEditUname() { + return editUname; + } + + public void setEditUname(String editUname) { + this.editUname = editUname; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public Long getEditUid() { + return editUid; + } + + public void setEditUid(Long editUid) { + this.editUid = editUid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RiskSource.java b/src/main/java/com/gk/hotwork/Domain/RiskSource.java new file mode 100644 index 0000000..5246604 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RiskSource.java @@ -0,0 +1,183 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * 风险源 + */ +@TableName("risk_source") +public class RiskSource implements Serializable { + + private final static long serialVersionUID = 1L; + + //ID,主键 + @TableId(type = IdType.AUTO) + private Long id; + + //风险源名称 + private String name; + + //风险源类型,1-设施设备,2-作业活动 + private Byte type; + + //风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险 + private Byte level; + + //状态,1-有效,2-无效,3-删除 + private Byte status; + + //可能导致的事故描述 + private String accidentDesc; + + //区域位置 + private String location; + + //所属部门ID + private Long depId; + + //所属部门名称 + private String depName; + + //创建时间 + private Date createTime; + + //创建人ID + private Long createUid; + + //创建人姓名 + private String createUname; + + //最新编辑时间 + private Date editTime; + + //最新编辑人ID + private Long editUid; + + //最新编辑人姓名 + private String editUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getAccidentDesc() { + return accidentDesc; + } + + public void setAccidentDesc(String accidentDesc) { + this.accidentDesc = accidentDesc; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Date getEditTime() { + return editTime; + } + + public void setEditTime(Date editTime) { + this.editTime = editTime; + } + + public Long getEditUid() { + return editUid; + } + + public void setEditUid(Long editUid) { + this.editUid = editUid; + } + + public String getEditUname() { + return editUname; + } + + public void setEditUname(String editUname) { + this.editUname = editUname; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RoleInfo.java b/src/main/java/com/gk/hotwork/Domain/RoleInfo.java new file mode 100644 index 0000000..4b6ead3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RoleInfo.java @@ -0,0 +1,143 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("role") +public class RoleInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** id **/ + private Long id; + + /** name **/ + private String name; + + /** createdby **/ + private String createdby; + + /** createddate **/ + private Date createddate; + + /** lastmodifiedby **/ + private String lastmodifiedby; + + /** lastmodifieddate **/ + private Date lastmodifieddate; + + /** description **/ + private String description; + + /** code **/ + private String code; + + /** btnaccess **/ + private String btnaccess; + + private Byte isdel; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** name **/ + public String getName() { + return name; + } + + /** name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** createdby **/ + public String getCreatedby() { + return createdby; + } + + /** createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** createddate **/ + public Date getCreateddate() { + return createddate; + } + + /** createddate **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** lastmodifiedby **/ + public String getLastmodifiedby() { + return lastmodifiedby; + } + + /** lastmodifiedby **/ + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby == null ? null : lastmodifiedby.trim(); + } + + /** lastmodifieddate **/ + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + /** lastmodifieddate **/ + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } + + /** description **/ + public String getDescription() { + return description; + } + + /** description **/ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** code **/ + public String getCode() { + return code; + } + + /** code **/ + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + /** btnaccess **/ + public String getBtnaccess() { + return btnaccess; + } + + /** btnaccess **/ + public void setBtnaccess(String btnaccess) { + this.btnaccess = btnaccess == null ? null : btnaccess.trim(); + } + + public Byte getIsdel() { + return isdel; + } + + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/RolePermissionsInfo.java b/src/main/java/com/gk/hotwork/Domain/RolePermissionsInfo.java new file mode 100644 index 0000000..903a362 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/RolePermissionsInfo.java @@ -0,0 +1,54 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("rolepermissions") +public class RolePermissionsInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** id **/ + private Long id; + + /** roleid **/ + private Long roleid; + + /** permissionid **/ + private Long permissionid; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** roleid **/ + public Long getRoleid() { + return roleid; + } + + /** roleid **/ + public void setRoleid(Long roleid) { + this.roleid = roleid; + } + + /** permissionid **/ + public Long getPermissionid() { + return permissionid; + } + + /** permissionid **/ + public void setPermissionid(Long permissionid) { + this.permissionid = permissionid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItem.java b/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItem.java new file mode 100644 index 0000000..c102a42 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItem.java @@ -0,0 +1,200 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("safety_inspection_item") +public class SafetyInspectionItem implements Serializable { + + private final static long serialVersionUID = 1L; + + /** A级要素id element_a **/ + private Long elementA; + + /** B级要素id element_b **/ + private Long elementB; + + /** 标准化要求 standardization_requirements **/ + private String standardizationRequirements; + + /** 企业达标标准 enterprise_standard **/ + private String enterpriseStandard; + + /** 评审方法 review_method **/ + private String reviewMethod; + + /** 否决项 veto **/ + private String veto; + + @TableField(exist = false) + /** A级要素名称 **/ + private String elementAName; + + @TableField(exist = false) + /** B级要素名称 **/ + private String elementBName; + + @TableField(exist = false) + /** 扣分项集合 **/ + private List<SafetyInspectionItemDeduction> deductionList; + + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Long getElementA() { + return elementA; + } + + public void setElementA(Long elementA) { + this.elementA = elementA; + } + + public Long getElementB() { + return elementB; + } + + public void setElementB(Long elementB) { + this.elementB = elementB; + } + + public String getStandardizationRequirements() { + return standardizationRequirements; + } + + public void setStandardizationRequirements(String standardizationRequirements) { + this.standardizationRequirements = standardizationRequirements; + } + + public String getEnterpriseStandard() { + return enterpriseStandard; + } + + public void setEnterpriseStandard(String enterpriseStandard) { + this.enterpriseStandard = enterpriseStandard; + } + + public String getReviewMethod() { + return reviewMethod; + } + + public void setReviewMethod(String reviewMethod) { + this.reviewMethod = reviewMethod; + } + + public String getVeto() { + return veto; + } + + public void setVeto(String veto) { + this.veto = veto; + } + + public String getElementAName() { + return elementAName; + } + + public void setElementAName(String elementAName) { + this.elementAName = elementAName; + } + + public String getElementBName() { + return elementBName; + } + + public void setElementBName(String elementBName) { + this.elementBName = elementBName; + } + + public List<SafetyInspectionItemDeduction> getDeductionList() { + return deductionList; + } + + public void setDeductionList(List<SafetyInspectionItemDeduction> deductionList) { + this.deductionList = deductionList; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItemDeduction.java b/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItemDeduction.java new file mode 100644 index 0000000..cf6243c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetyInspectionItemDeduction.java @@ -0,0 +1,130 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("safety_inspection_item_deduction") +public class SafetyInspectionItemDeduction implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 检查项id safety_inspection_item_id **/ + private Long safetyInspectionItemId; + + /** 扣分项名称 name **/ + private String name; + + /** 扣分项说明 remark **/ + private String remark; + + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Long getSafetyInspectionItemId() { + return safetyInspectionItemId; + } + + public void setSafetyInspectionItemId(Long safetyInspectionItemId) { + this.safetyInspectionItemId = safetyInspectionItemId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java new file mode 100644 index 0000000..32a6081 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java @@ -0,0 +1,263 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("safety_self_inspection") +public class SafetySelfInspection implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 自查清单名称 inspection_name **/ + private String inspectionName; + + /** 检查时间 inspection_time **/ + @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") + private Date inspectionTime; + + /** 检察人员 inspector **/ + private Long inspector; + + /** 被检查公司id **/ + private Long checkedCompanyId; + + /** 被检查公司名字 **/ + private String checkedCompanyName; + + /** 状态 0:暂存 1:评审中 2:已评审 status **/ + private Integer status; + + /** 不合格项数 **/ + @TableField(exist = false) + private Integer unqualifiedItem; + + /** 项数 **/ + @TableField(exist = false) + private Integer itemSum; + + /** 合格率 **/ + @TableField(exist = false) + private String qualifiedRate; + + /** 角色id **/ + @TableField(exist = false) + private Long roleid; + + /** 检察人员 **/ + @TableField(exist = false) + private String inspectorName; + + /** 检查开始时间 **/ + @TableField(exist = false) + @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") + private Date inspectionStartTime; + + /** 检查结束时间 **/ + @TableField(exist = false) + @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") + private Date inspectionEndTime; + + /** 检查项集合 **/ + @TableField(exist = false) + private List<SafetySelfInspectionItem> itemList; + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + public Long getCheckedCompanyId() { + return checkedCompanyId; + } + + public void setCheckedCompanyId(Long checkedCompanyId) { + this.checkedCompanyId = checkedCompanyId; + } + + public String getCheckedCompanyName() { + return checkedCompanyName; + } + + public void setCheckedCompanyName(String checkedCompanyName) { + this.checkedCompanyName = checkedCompanyName; + } + + public Integer getItemSum() { + return itemSum; + } + + public void setItemSum(Integer itemSum) { + this.itemSum = itemSum; + } + + public Long getRoleid() { + return roleid; + } + + public void setRoleid(Long roleid) { + this.roleid = roleid; + } + + public Integer getUnqualifiedItem() { + return unqualifiedItem; + } + + public void setUnqualifiedItem(Integer unqualifiedItem) { + this.unqualifiedItem = unqualifiedItem; + } + + public String getQualifiedRate() { + return qualifiedRate; + } + + public void setQualifiedRate(String qualifiedRate) { + this.qualifiedRate = qualifiedRate; + } + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public String getInspectionName() { + return inspectionName; + } + + public void setInspectionName(String inspectionName) { + this.inspectionName = inspectionName; + } + + public Date getInspectionTime() { + return inspectionTime; + } + + public void setInspectionTime(Date inspectionTime) { + this.inspectionTime = inspectionTime; + } + + public Long getInspector() { + return inspector; + } + + public void setInspector(Long inspector) { + this.inspector = inspector; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getInspectorName() { + return inspectorName; + } + + public void setInspectorName(String inspectorName) { + this.inspectorName = inspectorName; + } + + public Date getInspectionStartTime() { + return inspectionStartTime; + } + + public void setInspectionStartTime(Date inspectionStartTime) { + this.inspectionStartTime = inspectionStartTime; + } + + public Date getInspectionEndTime() { + return inspectionEndTime; + } + + public void setInspectionEndTime(Date inspectionEndTime) { + this.inspectionEndTime = inspectionEndTime; + } + + public List<SafetySelfInspectionItem> getItemList() { + return itemList; + } + + public void setItemList(List<SafetySelfInspectionItem> itemList) { + this.itemList = itemList; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItem.java b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItem.java new file mode 100644 index 0000000..59bb7e3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItem.java @@ -0,0 +1,270 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@TableName("safety_self_inspection_item") +public class SafetySelfInspectionItem implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 自查清单记录id safety_self_inspection_id **/ + private Long safetySelfInspectionId; + + /** 检查项id safety_inspection_item_id **/ + private Long safetyInspectionItemId; + + /** 检查结果0:否决 1:扣分 safety_inspection_item_result **/ + private Integer safetyInspectionItemResult; + + /** 否决项说明 **/ + private String safetyInspectionItemResultDesc; + + /** A级要素名称 **/ + @TableField(exist = false) + private String elementAName; + /** B级要素名称 **/ + @TableField(exist = false) + private String elementBName; + /** A级要素 **/ + @TableField(exist = false) + private Integer elementA; + /** A级要素权重 **/ + @TableField(exist = false) + private Float elementAWeight; + /** B级要素 **/ + @TableField(exist = false) + private Integer elementB; + /** B级要素 **/ + @TableField(exist = false) + private Integer point; + + + /** 标准化要求 standardization_requirements **/ + @TableField(exist = false) + private String standardizationRequirements; + + /** 企业达标标准 enterprise_standard **/ + @TableField(exist = false) + private String enterpriseStandard; + + /** 评审方法 review_method **/ + @TableField(exist = false) + private String reviewMethod; + + /** 否决项 veto **/ + @TableField(exist = false) + private String veto; + + @TableField(exist = false) + /** 扣分项集合 **/ + private List<SafetySelfInspectionItemDeduction> selfDeductionList; + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Long getSafetySelfInspectionId() { + return safetySelfInspectionId; + } + + public void setSafetySelfInspectionId(Long safetySelfInspectionId) { + this.safetySelfInspectionId = safetySelfInspectionId; + } + + public Long getSafetyInspectionItemId() { + return safetyInspectionItemId; + } + + public void setSafetyInspectionItemId(Long safetyInspectionItemId) { + this.safetyInspectionItemId = safetyInspectionItemId; + } + + public Integer getSafetyInspectionItemResult() { + return safetyInspectionItemResult; + } + + public void setSafetyInspectionItemResult(Integer safetyInspectionItemResult) { + this.safetyInspectionItemResult = safetyInspectionItemResult; + } + + public String getSafetyInspectionItemResultDesc() { + return safetyInspectionItemResultDesc; + } + + public void setSafetyInspectionItemResultDesc(String safetyInspectionItemResultDesc) { + this.safetyInspectionItemResultDesc = safetyInspectionItemResultDesc; + } + + public String getElementAName() { + return elementAName; + } + + public void setElementAName(String elementAName) { + this.elementAName = elementAName; + } + + public String getElementBName() { + return elementBName; + } + + public void setElementBName(String elementBName) { + this.elementBName = elementBName; + } + + public String getStandardizationRequirements() { + return standardizationRequirements; + } + + public void setStandardizationRequirements(String standardizationRequirements) { + this.standardizationRequirements = standardizationRequirements; + } + + public String getEnterpriseStandard() { + return enterpriseStandard; + } + + public void setEnterpriseStandard(String enterpriseStandard) { + this.enterpriseStandard = enterpriseStandard; + } + + public String getReviewMethod() { + return reviewMethod; + } + + public void setReviewMethod(String reviewMethod) { + this.reviewMethod = reviewMethod; + } + + public String getVeto() { + return veto; + } + + public void setVeto(String veto) { + this.veto = veto; + } + + public List<SafetySelfInspectionItemDeduction> getSelfDeductionList() { + return selfDeductionList; + } + + public void setSelfDeductionList(List<SafetySelfInspectionItemDeduction> selfDeductionList) { + this.selfDeductionList = selfDeductionList; + } + + public Integer getElementA() { + return elementA; + } + + public void setElementA(Integer elementA) { + this.elementA = elementA; + } + + public Integer getElementB() { + return elementB; + } + + public void setElementB(Integer elementB) { + this.elementB = elementB; + } + + public Integer getPoint() { + return point; + } + + public void setPoint(Integer point) { + this.point = point; + } + + public Float getElementAWeight() { + return elementAWeight; + } + + public void setElementAWeight(Float elementAWeight) { + this.elementAWeight = elementAWeight; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItemDeduction.java b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItemDeduction.java new file mode 100644 index 0000000..a3afdd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetySelfInspectionItemDeduction.java @@ -0,0 +1,152 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("safety_self_inspection_item_deduction") +public class SafetySelfInspectionItemDeduction implements Serializable { + + private final static long serialVersionUID = 1L; + + /** 自查清单记录的检查项id safety_self_inspection_item_id **/ + private Long safetySelfInspectionItemId; + + /** 扣分项id safety_inspection_item_deduction_id **/ + private Long safetyInspectionItemDeductionId; + + /** 扣分数 point **/ + private Integer point; + + /** 备注 remark **/ + private String remark; + + /** 名称 name **/ + @TableField(exist = false) + private String name; + + + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 有效标识 valid_flag **/ + private Boolean validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 最后更新人 update_by **/ + private String updateBy; + + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Boolean getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Boolean validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 最后更新人 update_by **/ + public String getUpdateBy() { + return updateBy; + } + + /** 最后更新人 update_by **/ + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Long getSafetySelfInspectionItemId() { + return safetySelfInspectionItemId; + } + + public void setSafetySelfInspectionItemId(Long safetySelfInspectionItemId) { + this.safetySelfInspectionItemId = safetySelfInspectionItemId; + } + + public Long getSafetyInspectionItemDeductionId() { + return safetyInspectionItemDeductionId; + } + + public void setSafetyInspectionItemDeductionId(Long safetyInspectionItemDeductionId) { + this.safetyInspectionItemDeductionId = safetyInspectionItemDeductionId; + } + + public Integer getPoint() { + return point; + } + + public void setPoint(Integer point) { + this.point = point; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SelfCheckInfo.java b/src/main/java/com/gk/hotwork/Domain/SelfCheckInfo.java new file mode 100644 index 0000000..7eec977 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SelfCheckInfo.java @@ -0,0 +1,198 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.Date; + +@ApiModel("检查内容类") +@TableName("selfcheck") +public class SelfCheckInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + + /** 作业类型 tasktype **/ + @ApiModelProperty("作业类型") + private String tasktype; + + /** 类型 type **/ + @ApiModelProperty("类型") + private String type; + + /** 检查类型 填空、判断 type **/ + @ApiModelProperty("检查类型") + private String checktype; + + + /** 检查内容 content **/ + @ApiModelProperty("检查内容") + private String content; + + /** 参考判断 standard **/ + @ApiModelProperty("参考判断") + private String standard; + + /** 排序 sort **/ + @ApiModelProperty("排序") + private Integer sort; + + /** 是否删除 isdel **/ + @ApiModelProperty("是否删除") + private Byte isdel; + + /** 备注 description **/ + @ApiModelProperty("备注") + private String description; + + /** 创建人 createdby **/ + @ApiModelProperty("创建人") + private String createdby; + + /** 创建时间 createddate **/ + @ApiModelProperty("创建时间") + private Date createddate; + + /** 更新人 modifiedby **/ + @ApiModelProperty("更新人") + private String modifiedby; + + /** 更新时间 modifieddate **/ + @ApiModelProperty("更新时间") + private Date modifieddate; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 类型 type **/ + public String getType() { + return type; + } + + /** 类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 检查内容 content **/ + public String getContent() { + return content; + } + + /** 检查内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 参考判断 standard **/ + public String getStandard() { + return standard; + } + + /** 参考判断 standard **/ + public void setStandard(String standard) { + this.standard = standard == null ? null : standard.trim(); + } + + /** 排序 sort **/ + public Integer getSort() { + return sort; + } + + /** 排序 sort **/ + public void setSort(Integer sort) { + this.sort = sort; + } + + /** 是否删除 isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除 isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + /** 备注 description **/ + public String getDescription() { + return description; + } + + /** 备注 description **/ + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createddate **/ + public Date getCreateddate() { + return createddate; + } + + /** 创建时间 createddate **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** 更新人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 更新人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 更新时间 modifieddate **/ + public Date getModifieddate() { + return modifieddate; + } + + /** 更新时间 modifieddate **/ + public void setModifieddate(Date modifieddate) { + this.modifieddate = modifieddate; + } + + + public String getChecktype() { + return checktype; + } + + public void setChecktype(String checktype) { + this.checktype = checktype; + } + + public String getTasktype() { + return tasktype; + } + + public void setTasktype(String tasktype) { + this.tasktype = tasktype; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SmsLog.java b/src/main/java/com/gk/hotwork/Domain/SmsLog.java new file mode 100644 index 0000000..218315f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SmsLog.java @@ -0,0 +1,135 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.gk.hotwork.Domain.Enum.SendStatus; +import com.gk.hotwork.Domain.Enum.SmsSource; + +import java.io.Serializable; +import java.util.Date; + +@TableName("sms_log") +public class SmsLog implements Serializable { + /** 主键id id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 手机号 phone **/ + private String phone; + + /** 发送内容 content **/ + private String content; + + /** 发送时间 send_time **/ + private Date sendTime; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 createby **/ + private String createby; + + /** 来源 source **/ + private Integer source; + + private String phoneUser; + + private Integer sendStatus; + + private String failureReason; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 手机号 phone **/ + public String getPhone() { + return phone; + } + + /** 手机号 phone **/ + public void setPhone(String phone) { + this.phone = phone == null ? null : phone.trim(); + } + + /** 发送内容 content **/ + public String getContent() { + return content; + } + + /** 发送内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 发送时间 send_time **/ + public Date getSendTime() { + return sendTime; + } + + /** 发送时间 send_time **/ + public void setSendTime(Date sendTime) { + this.sendTime = sendTime; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 createby **/ + public String getCreateby() { + return createby; + } + + /** 创建人 createby **/ + public void setCreateby(String createby) { + this.createby = createby == null ? null : createby.trim(); + } + + + + public String getPhoneUser() { + return phoneUser; + } + + public void setPhoneUser(String phoneUser) { + this.phoneUser = phoneUser; + } + + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + public Integer getSource() { + return source; + } + + public void setSource(Integer source) { + this.source = source; + } + + public Integer getSendStatus() { + return sendStatus; + } + + public void setSendStatus(Integer sendStatus) { + this.sendStatus = sendStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SmsLogInfo.java b/src/main/java/com/gk/hotwork/Domain/SmsLogInfo.java new file mode 100644 index 0000000..40795d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SmsLogInfo.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("smslog") +public class SmsLogInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** id id **/ + private Long id; + + /** 手机号 mobile **/ + private String mobile; + + /** 发送时间 sendtime **/ + private Date sendtime; + + /** 发送次数 times **/ + private Integer times; + + /**时间类型 1小时 2天**/ + private Byte type; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 手机号 mobile **/ + public String getMobile() { + return mobile; + } + + /** 手机号 mobile **/ + public void setMobile(String mobile) { + this.mobile = mobile == null ? null : mobile.trim(); + } + + /** 发送时间 sendtime **/ + public Date getSendtime() { + return sendtime; + } + + /** 发送时间 sendtime **/ + public void setSendtime(Date sendtime) { + this.sendtime = sendtime; + } + + /** 发送次数 times **/ + public Integer getTimes() { + return times; + } + + /** 发送次数 times **/ + public void setTimes(Integer times) { + this.times = times; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SubTaskInfo.java b/src/main/java/com/gk/hotwork/Domain/SubTaskInfo.java new file mode 100644 index 0000000..8474c4b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SubTaskInfo.java @@ -0,0 +1,422 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.List; + +@TableName("subtask") +public class SubTaskInfo implements Serializable { + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 任务编号 taskcode **/ + private String taskcode; + + /** 作业类型 type **/ + private String type; + + /** 作业类别 category **/ + private String category; + + /** 作业级别 level **/ + private Byte level; + + /** 是否选中(0:否;1:是) checked **/ + private Byte checked; + + /** 受限空间分类 spacecategory **/ + private String spacecategory; + + /** 受限空间名称 spacename **/ + private String spacename; + + /** 受限空间介质名称 spacemedium **/ + private String spacemedium; + + /** 是否酸碱腐蚀 acibase **/ + private String acibase; + + /** 吊装作业重量(单位:t) hoistingweight **/ + private Double hoistingweight; + + /** 动土作业深度(单位:m) soildepth **/ + private Double soildepth; + + /** 动土作业面积(单位:㎡) soilarea **/ + private Double soilarea; + + /** 动土文件地址 soilfile **/ + @TableField(exist = false) + private List<TaskEnclosure> soilfile; + + /** 断路原因 breakreason **/ + private String breakreason; + + @TableField(exist = false) + private List<TaskEnclosure> breakfile; + + /** 高处作业作业高度 workheight **/ + private Double workheight; + + /** 电源接入点 electricityarea **/ + private String electricityarea; + + /** 工作电压 voltage **/ + private String voltage; + + /** 功率 power **/ + private String power; + + /** 设备管道名称 pipename **/ + private String pipename; + + /** 设备管道介质 pipemedium **/ + private String pipemedium; + + /** 设备管道温度 pipetemperature **/ + private String pipetemperature; + + /** 设备管道压力 pipepressure **/ + private String pipepressure; + + /** 盲板材质 blindboardmaterial **/ + private String blindboardmaterial; + + /** 盲板规格 blindboardspecification **/ + private String blindboardspecification; + + /** 盲板编号 blindboardnumber **/ + private String blindboardnumber; + + /** 生产单位作业指挥 commander **/ + private String commander; + + /** 盲板位置图 blindboardlocation **/ + @TableField(exist = false) + private List<TaskEnclosure> blindboardlocation; + + /** 动火方式 firetype **/ + private String firetype; + + private String hoistinglevel; + + private String heightlevel; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 作业类型 type **/ + public String getType() { + return type; + } + + /** 作业类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 作业类别 category **/ + public String getCategory() { + return category; + } + + /** 作业类别 category **/ + public void setCategory(String category) { + this.category = category == null ? null : category.trim(); + } + + /** 作业级别 level **/ + public Byte getLevel() { + return level; + } + + /** 作业级别 level **/ + public void setLevel(Byte level) { + this.level = level; + } + + /** 是否选中(0:否;1:是) checked **/ + public Byte getChecked() { + return checked; + } + + /** 是否选中(0:否;1:是) checked **/ + public void setChecked(Byte checked) { + this.checked = checked; + } + + /** 受限空间分类 spacecategory **/ + public String getSpacecategory() { + return spacecategory; + } + + /** 受限空间分类 spacecategory **/ + public void setSpacecategory(String spacecategory) { + this.spacecategory = spacecategory == null ? null : spacecategory.trim(); + } + + /** 受限空间名称 spacename **/ + public String getSpacename() { + return spacename; + } + + /** 受限空间名称 spacename **/ + public void setSpacename(String spacename) { + this.spacename = spacename == null ? null : spacename.trim(); + } + + /** 受限空间介质名称 spacemedium **/ + public String getSpacemedium() { + return spacemedium; + } + + /** 受限空间介质名称 spacemedium **/ + public void setSpacemedium(String spacemedium) { + this.spacemedium = spacemedium == null ? null : spacemedium.trim(); + } + + /** 是否酸碱腐蚀 acibase **/ + public String getAcibase() { + return acibase; + } + + /** 是否酸碱腐蚀 acibase **/ + public void setAcibase(String acibase) { + this.acibase = acibase == null ? null : acibase.trim(); + } + + /** 吊装作业重量(单位:t) hoistingweight **/ + public Double getHoistingweight() { + return hoistingweight; + } + + /** 吊装作业重量(单位:t) hoistingweight **/ + public void setHoistingweight(Double hoistingweight) { + this.hoistingweight = hoistingweight; + } + + /** 动土作业深度(单位:m) soildepth **/ + public Double getSoildepth() { + return soildepth; + } + + /** 动土作业深度(单位:m) soildepth **/ + public void setSoildepth(Double soildepth) { + this.soildepth = soildepth; + } + + /** 动土作业面积(单位:㎡) soilarea **/ + public Double getSoilarea() { + return soilarea; + } + + /** 动土作业面积(单位:㎡) soilarea **/ + public void setSoilarea(Double soilarea) { + this.soilarea = soilarea; + } + + public List<TaskEnclosure> getSoilfile() { + return soilfile; + } + + public void setSoilfile(List<TaskEnclosure> soilfile) { + this.soilfile = soilfile; + } + + /** 断路原因 breakreason **/ + public String getBreakreason() { + return breakreason; + } + + /** 断路原因 breakreason **/ + public void setBreakreason(String breakreason) { + this.breakreason = breakreason == null ? null : breakreason.trim(); + } + + /** 高处作业作业高度 workheight **/ + public Double getWorkheight() { + return workheight; + } + + /** 高处作业作业高度 workheight **/ + public void setWorkheight(Double workheight) { + this.workheight = workheight; + } + + /** 电源接入点 electricityarea **/ + public String getElectricityarea() { + return electricityarea; + } + + /** 电源接入点 electricityarea **/ + public void setElectricityarea(String electricityarea) { + this.electricityarea = electricityarea == null ? null : electricityarea.trim(); + } + + /** 工作电压 voltage **/ + public String getVoltage() { + return voltage; + } + + /** 工作电压 voltage **/ + public void setVoltage(String voltage) { + this.voltage = voltage == null ? null : voltage.trim(); + } + + /** 功率 power **/ + public String getPower() { + return power; + } + + /** 功率 power **/ + public void setPower(String power) { + this.power = power == null ? null : power.trim(); + } + + /** 设备管道名称 pipename **/ + public String getPipename() { + return pipename; + } + + /** 设备管道名称 pipename **/ + public void setPipename(String pipename) { + this.pipename = pipename == null ? null : pipename.trim(); + } + + /** 设备管道介质 pipemedium **/ + public String getPipemedium() { + return pipemedium; + } + + /** 设备管道介质 pipemedium **/ + public void setPipemedium(String pipemedium) { + this.pipemedium = pipemedium == null ? null : pipemedium.trim(); + } + + /** 设备管道温度 pipetemperature **/ + public String getPipetemperature() { + return pipetemperature; + } + + /** 设备管道温度 pipetemperature **/ + public void setPipetemperature(String pipetemperature) { + this.pipetemperature = pipetemperature == null ? null : pipetemperature.trim(); + } + + /** 设备管道压力 pipepressure **/ + public String getPipepressure() { + return pipepressure; + } + + /** 设备管道压力 pipepressure **/ + public void setPipepressure(String pipepressure) { + this.pipepressure = pipepressure == null ? null : pipepressure.trim(); + } + + /** 盲板材质 blindboardmaterial **/ + public String getBlindboardmaterial() { + return blindboardmaterial; + } + + /** 盲板材质 blindboardmaterial **/ + public void setBlindboardmaterial(String blindboardmaterial) { + this.blindboardmaterial = blindboardmaterial == null ? null : blindboardmaterial.trim(); + } + + /** 盲板规格 blindboardspecification **/ + public String getBlindboardspecification() { + return blindboardspecification; + } + + /** 盲板规格 blindboardspecification **/ + public void setBlindboardspecification(String blindboardspecification) { + this.blindboardspecification = blindboardspecification == null ? null : blindboardspecification.trim(); + } + + /** 盲板编号 blindboardnumber **/ + public String getBlindboardnumber() { + return blindboardnumber; + } + + /** 盲板编号 blindboardnumber **/ + public void setBlindboardnumber(String blindboardnumber) { + this.blindboardnumber = blindboardnumber == null ? null : blindboardnumber.trim(); + } + + /** 生产单位作业指挥 commander **/ + public String getCommander() { + return commander; + } + + /** 生产单位作业指挥 commander **/ + public void setCommander(String commander) { + this.commander = commander == null ? null : commander.trim(); + } + + public List<TaskEnclosure> getBreakfile() { + return breakfile; + } + + public void setBreakfile(List<TaskEnclosure> breakfile) { + this.breakfile = breakfile; + } + + public List<TaskEnclosure> getBlindboardlocation() { + return blindboardlocation; + } + + public void setBlindboardlocation(List<TaskEnclosure> blindboardlocation) { + this.blindboardlocation = blindboardlocation; + } + + /** 动火方式 firetype **/ + public String getFiretype() { + return firetype; + } + + /** 动火方式 firetype **/ + public void setFiretype(String firetype) { + this.firetype = firetype == null ? null : firetype.trim(); + } + + public String getHoistinglevel() { + return hoistinglevel; + } + + public void setHoistinglevel(String hoistinglevel) { + this.hoistinglevel = hoistinglevel; + } + + public String getHeightlevel() { + return heightlevel; + } + + public void setHeightlevel(String heightlevel) { + this.heightlevel = heightlevel; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskAnalysis.java b/src/main/java/com/gk/hotwork/Domain/TaskAnalysis.java new file mode 100644 index 0000000..660639c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskAnalysis.java @@ -0,0 +1,189 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("taskanalysis") +public class TaskAnalysis { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 动火分析 id **/ + @TableId(type = IdType.AUTO) + private Byte id; + + /** 任务编号 taskcode **/ + @NotBlank(message = "任务编号不能为空") + private String taskcode; + + /** 分析时间 analysisat **/ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date analysisat; + + /** 分析数据 content **/ + private String content; + + /** 分析点名称 analysisarea **/ + private String analysisarea; + + /** 分析人 analyst **/ + private String analyst; + + /** 介质名称 mediumname **/ + private String mediumname; + + /** 介质分析值 mediumvalue **/ + private String mediumvalue; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + /** 动火分析 id **/ + public Byte getId() { + return id; + } + + /** 动火分析 id **/ + public void setId(Byte id) { + this.id = id; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 分析时间 analysisat **/ + public Date getAnalysisat() { + return analysisat; + } + + /** 分析时间 analysisat **/ + public void setAnalysisat(Date analysisat) { + this.analysisat = analysisat; + } + + /** 分析数据 content **/ + public String getContent() { + return content; + } + + /** 分析数据 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 分析点名称 analysisarea **/ + public String getAnalysisarea() { + return analysisarea; + } + + /** 分析点名称 analysisarea **/ + public void setAnalysisarea(String analysisarea) { + this.analysisarea = analysisarea == null ? null : analysisarea.trim(); + } + + /** 分析人 analyst **/ + public String getAnalyst() { + return analyst; + } + + /** 分析人 analyst **/ + public void setAnalyst(String analyst) { + this.analyst = analyst == null ? null : analyst.trim(); + } + + public String getMediumname() { + return mediumname; + } + + public void setMediumname(String mediumname) { + this.mediumname = mediumname; + } + + public String getMediumvalue() { + return mediumvalue; + } + + public void setMediumvalue(String mediumvalue) { + this.mediumvalue = mediumvalue; + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskEnclosure.java b/src/main/java/com/gk/hotwork/Domain/TaskEnclosure.java new file mode 100644 index 0000000..51e4624 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskEnclosure.java @@ -0,0 +1,246 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("taskenclosure") +public class TaskEnclosure implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** 任务附件表 id **/ + private Long id; + + /** 任务编号 taskcode **/ + private String taskcode; + + /** 类型 type **/ + private String type; + + /** 文件类型(1.图片;2.pdf) filetype **/ + private Byte filetype; + + /** 文件名称 filename **/ + private String filename; + + /** 文件原始名称 originalname **/ + private String originalname; + + /** 文件链接 fileurl **/ + private String fileurl; + + /** 版本号 version **/ + private Float version; + + /** 备注信息 remark **/ + private String remark; + + /** 创建人 createdby **/ + private String createdby; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 标记 flag **/ + private Byte flag; + + @TableField(exist = false) + private String url; + + @TableField(exist = false) + private String uid; + + @TableField(exist = false) + private String status; + + @TableField(exist = false) + private String name; + + /** 任务附件表 id **/ + public Long getId() { + return id; + } + + /** 任务附件表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 类型 type **/ + public String getType() { + return type; + } + + /** 类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 文件类型(1.图片;2.pdf) filetype **/ + public Byte getFiletype() { + return filetype; + } + + /** 文件类型(1.图片;2.pdf) filetype **/ + public void setFiletype(Byte filetype) { + this.filetype = filetype; + } + + /** 文件名称 filename **/ + public String getFilename() { + return filename; + } + + /** 文件名称 filename **/ + public void setFilename(String filename) { + this.filename = filename == null ? null : filename.trim(); + } + + /** 文件原始名称 originalname **/ + public String getOriginalname() { + return originalname; + } + + /** 文件原始名称 originalname **/ + public void setOriginalname(String originalname) { + this.originalname = originalname == null ? null : originalname.trim(); + } + + /** 文件链接 fileurl **/ + public String getFileurl() { + return fileurl; + } + + /** 文件链接 fileurl **/ + public void setFileurl(String fileurl) { + this.fileurl = fileurl == null ? null : fileurl.trim(); + } + + /** 版本号 version **/ + public Float getVersion() { + return version; + } + + /** 版本号 version **/ + public void setVersion(Float version) { + this.version = version; + } + + /** 备注信息 remark **/ + public String getRemark() { + return remark; + } + + /** 备注信息 remark **/ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskEquipment.java b/src/main/java/com/gk/hotwork/Domain/TaskEquipment.java new file mode 100644 index 0000000..61cf1ec --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskEquipment.java @@ -0,0 +1,149 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("taskequipment") +public class TaskEquipment { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** 任务所需设备表 id **/ + private Long id; + + /** 任务编号 taskcode **/ + private String taskcode; + + /** 设备名称 name **/ + private String name; + + /** 设备类型 type **/ + private String type; + + /** 所需数量 num **/ + private Integer num; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + /** 任务所需设备表 id **/ + public Long getId() { + return id; + } + + /** 任务所需设备表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 设备名称 name **/ + public String getName() { + return name; + } + + /** 设备名称 name **/ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** 设备类型 type **/ + public String getType() { + return type; + } + + /** 设备类型 type **/ + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + /** 所需数量 num **/ + public Integer getNum() { + return num; + } + + /** 所需数量 num **/ + public void setNum(Integer num) { + this.num = num; + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskEquipmentBindInfo.java b/src/main/java/com/gk/hotwork/Domain/TaskEquipmentBindInfo.java new file mode 100644 index 0000000..646e3a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskEquipmentBindInfo.java @@ -0,0 +1,97 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +@TableName("taskequipmentbind") +public class TaskEquipmentBindInfo implements Serializable { + /** 作业设备条码绑定表 id **/ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 作业编号 taskcode **/ + @NotBlank(message = "作业编号不能为空") + private String taskcode; + + /** 设备条码 equipmentnumber **/ + @NotBlank(message = "设备条码不能为空") + private String equipmentnumber; + + /** 设备名称 equipmentname **/ + private String equipmentname; + + /** 更新人 updateby **/ + private String updateby; + + /** 更新时间 updatetime **/ + private Date updatetime; + + /** 作业设备条码绑定表 id **/ + public Long getId() { + return id; + } + + /** 作业设备条码绑定表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 作业编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 作业编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 设备条码 equipmentnumber **/ + public String getEquipmentnumber() { + return equipmentnumber; + } + + /** 设备条码 equipmentnumber **/ + public void setEquipmentnumber(String equipmentnumber) { + this.equipmentnumber = equipmentnumber == null ? null : equipmentnumber.trim(); + } + + /** 设备名称 equipmentname **/ + public String getEquipmentname() { + return equipmentname; + } + + /** 设备名称 equipmentname **/ + public void setEquipmentname(String equipmentname) { + this.equipmentname = equipmentname == null ? null : equipmentname.trim(); + } + + /** 更新人 updateby **/ + public String getUpdateby() { + return updateby; + } + + /** 更新人 updateby **/ + public void setUpdateby(String updateby) { + this.updateby = updateby == null ? null : updateby.trim(); + } + + /** 更新时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 更新时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/TaskGasInfo.java b/src/main/java/com/gk/hotwork/Domain/TaskGasInfo.java new file mode 100644 index 0000000..d576908 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskGasInfo.java @@ -0,0 +1,166 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@TableName("taskgas") +public class TaskGasInfo implements Serializable { + /** 作业气体浓度表 id **/ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 作业编号 taskcode **/ + @NotBlank(message = "作业编号不能为空") + private String taskcode; + + /** 作业人员 taskworker **/ + private String taskworker; + + /** 气体类型 gastype **/ + @NotBlank(message = "气体类型不能为空") + private String gastype; + + /** 气体浓度值 gasvalue **/ + @NotNull(message = "气体浓度值不能为空") + private BigDecimal gasvalue; + + /** 气体单位 gasunit **/ + @NotBlank(message = "气体单位不能为空") + private String gasunit; + + /** 是否报警 iswarn **/ + private Byte iswarn; + + /** 是否预警 isyujing **/ + private Byte isyujing; + + /** 是否发短信 issms **/ + private Byte issms; + + /** 是否处理 ismend **/ + private Byte ismend; + + /** 上传时间 updatetime **/ + private Date updatetime; + + /** 作业气体浓度表 id **/ + public Long getId() { + return id; + } + + /** 作业气体浓度表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 作业人员 taskworker **/ + public String getTaskworker() { + return taskworker; + } + + /** 作业人员 taskworker **/ + public void setTaskworker(String taskworker) { + this.taskworker = taskworker == null ? null : taskworker.trim(); + } + + /** 气体类型 gastype **/ + public String getGastype() { + return gastype; + } + + /** 气体类型 gastype **/ + public void setGastype(String gastype) { + this.gastype = gastype == null ? null : gastype.trim(); + } + + /** 气体浓度值 gasvalue **/ + public BigDecimal getGasvalue() { + return gasvalue; + } + + /** 气体浓度值 gasvalue **/ + public void setGasvalue(BigDecimal gasvalue) { + this.gasvalue = gasvalue; + } + + /** 气体单位 gasunit **/ + public String getGasunit() { + return gasunit; + } + + /** 气体单位 gasunit **/ + public void setGasunit(String gasunit) { + this.gasunit = gasunit == null ? null : gasunit.trim(); + } + + /** 是否报警 iswarn **/ + public Byte getIswarn() { + return iswarn; + } + + /** 是否报警 iswarn **/ + public void setIswarn(Byte iswarn) { + this.iswarn = iswarn; + } + + /** 是否预警 isyujing **/ + public Byte getIsyujing() { + return isyujing; + } + + /** 是否预警 isyujing **/ + public void setIsyujing(Byte isyujing) { + this.isyujing = isyujing; + } + + /** 是否发短信 issms **/ + public Byte getIssms() { + return issms; + } + + /** 是否发短信 issms **/ + public void setIssms(Byte issms) { + this.issms = issms; + } + + /** 是否处理 ismend **/ + public Byte getIsmend() { + return ismend; + } + + /** 是否处理 ismend **/ + public void setIsmend(Byte ismend) { + this.ismend = ismend; + } + + /** 上传时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 上传时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/TaskInfo.java b/src/main/java/com/gk/hotwork/Domain/TaskInfo.java new file mode 100644 index 0000000..cc5e809 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskInfo.java @@ -0,0 +1,825 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("task") +public class TaskInfo { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + /** 已驳回 **/ + public static final Byte REJECTED = 0; + /** 未提交 **/ + public static final Byte UNCOMMITTED = 1; + /** 已提交 **/ + public static final Byte COMMITTED = 2; + /** 施工单位已确认 **/ + public static final Byte CONTRACTOR_APPROVED = 3; + /** 动火部位负责人审批通过 **/ + public static final Byte PART_APPROVED = 4; + /** 相关部门审批通过 **/ + public static final Byte RELEVANT_APPROVED = 5; + /** 安全部门审批通过 **/ + public static final Byte SECURITY_APPROVED = 6; + /** 审批通过 **/ + public static final Byte APPROVED = 7; + /** 提交检测中心 **/ + public static final Byte TEST_COMMITTED = 8; + /** 气体检测通过 **/ + public static final Byte TEST_CHECKED = 9; + + /** 等级:二级 **/ + public static final Byte LEVEL_SECOND = 0; + /** 等级:一级 **/ + public static final Byte LEVEL_ONE = 1; + /** 等级:特级 **/ + public static final Byte LEVEL_SPECIAL = 2; + + /** 等待整改 **/ + public static final Byte WAIT_RECTIFY = 0; + /** 作业中止 **/ + public static final Byte ABORT = 1; + /** 等待检查 **/ + public static final Byte WAIT_CHECK = 2; + /** 等待开始 **/ + public static final Byte WAIT_START = 3; + /** 作业中 **/ + public static final Byte DOING = 4; + /** 作业完成 **/ + public static final Byte COMPLETE = 5; + /** 作业未开始 **/ + public static final Byte WAIT_REVIEW = 6; + + + /** id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 作业状态 status **/ + private Byte status; + /** 区分60 130 参考 Etype类型 1:60 2:130**/ + private Integer etype; + + /** 申请单位 unit **/ + @NotBlank(message = "申请单位不能为空") + private String unit; + + /** 申请人部门 unit **/ + private String department; + + /** 申请人 applicant **/ + @NotBlank(message = "申请人不能为空") + private String applicant; + + /** 作业证编号 code **/ + private String code; + + /** 动火作业级别(特级、一级、二级) level **/ +// @NotNull(message = "作业级别不能为空") + private Byte level; + + /** 动火地点 area **/ +// @NotBlank(message = "作业地点不能为空") + private String area; + + /** 动火方式 mode **/ + private String mode; + + /** 负责人 director **/ +// @NotBlank(message = "作业负责人不能为空") + private String director; + + /** 开始时间 starttime **/ +// @NotNull(message = "开始时间不能为空") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date starttime; + + /** 结束时间 endtime **/ +// @NotNull(message = "结束时间不能为空") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date endtime; + + /** 涉及的其他特殊作业 othertask **/ + private String othertask; + + /** 危害辨识(火灾、触电) hazard **/ + private String hazard; + + /** 监火人 supervisor **/ + private String supervisor; + + /** 工种 profession **/ + private String profession; + + /** 动火部位负责人 partdirector **/ + private String partdirector; + + /** 相关单位监火人 approversupervisor **/ + private String approversupervisor; + + /** 相关单位工种 approverprofession **/ + private String approverprofession; + + /** 申请单位意见 applyunitopinion **/ + private String applyunitopinion; + + /** 施工单位意见 constructionopinion **/ + private String constructionopinion; + + /** 相关部门意见 relevantopinion **/ + private String relevantopinion; + + /** 安全管理部门意见 securityopinion **/ + private String securityopinion; + + /** 企业负责人意见 enterpriseopinion **/ + private String enterpriseopinion; + + /** 动火前,岗位当班班长验票 shiftleaderopinion **/ + private String shiftleaderopinion; + + /** 申请单位签名 applyunitname **/ + private String applyunitname; + + /** 施工单位签名 constructionname **/ + private String constructionname; + + /** 相关部门签名 relevantname **/ + private String relevantname; + + /** 安全管理部门签名 securityname **/ + private String securityname; + + /** 企业负责人签名 enterprisename **/ + private String enterprisename; + + /** 动火前,岗位当班班长验票签名 shiftleadername **/ + private String shiftleadername; + + /** 申请单位签名时间 applyunittime **/ + private Date applyunittime; + + /** 施工单位签名时间 constructiontime **/ + private Date constructiontime; + + /** 相关部门签名时间 relevanttime **/ + private Date relevanttime; + + /** 安全管理部门签名时间 securitytime **/ + private Date securitytime; + + /** 企业负责人签名时间 enterprisetime **/ + private Date enterprisetime; + + /** 动火前,岗位当班班长验票签名时间 shiftleadertime **/ + private Date shiftleadertime; + + /** 完工时间 completedtime **/ + private Date completedtime; + + /** 完工申请签字 completedname **/ + private String completedname; + + /** 完工确认人签字 completedconfirm **/ + private String completedconfirm; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + /** 是否删除(0:否,1:是) isdel **/ + private Byte isdel; + + /** 施工单位名称 constructionunit **/ + private String constructionunit; + + /** 安全管理部门名称 securitydep **/ + private String securitydep; + + /** 是否节假日 isholiday **/ + private Byte isholiday; + + /** 分析人 analyst **/ + private String analyst; + + /** 生成工作证路径 path **/ + private String path; + + /** 生成完整工作证路径 fullpath **/ + private String fullpath; + + /** 监火人意见 fullpath **/ + private String supervisoropinion; + + private String content; + + private String opinion; + + /** 任务描述(任务详情) description **/ + private String description; + + /** 是否需要气体检测分析(0:否,1:是) isanalysis **/ + private Byte isanalysis; + + /** 分析地点 analysisarea **/ + private String analysisarea; + + /** 分析介质 analysismedium **/ + private String analysismedium; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 作业状态 status **/ + public Byte getStatus() { + return status; + } + + /** 作业状态 status **/ + public void setStatus(Byte status) { + this.status = status; + } + + /** 申请单位 unit **/ + public String getUnit() { + return unit; + } + + /** 申请单位 unit **/ + public void setUnit(String unit) { + this.unit = unit == null ? null : unit.trim(); + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + /** 申请人 applicant **/ + public String getApplicant() { + return applicant; + } + + /** 申请人 applicant **/ + public void setApplicant(String applicant) { + this.applicant = applicant == null ? null : applicant.trim(); + } + + /** 作业证编号 code **/ + public String getCode() { + return code; + } + + /** 作业证编号 code **/ + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + /** 动火作业级别(特级、一级、二级) level **/ + public Byte getLevel() { + return level; + } + + /** 动火作业级别(特级、一级、二级) level **/ + public void setLevel(Byte level) { + this.level = level; + } + + /** 动火地点 area **/ + public String getArea() { + return area; + } + + /** 动火地点 area **/ + public void setArea(String area) { + this.area = area == null ? null : area.trim(); + } + + /** 动火方式 mode **/ + public String getMode() { + return mode; + } + + /** 动火方式 mode **/ + public void setMode(String mode) { + this.mode = mode; + } + + /** 负责人 director **/ + public String getDirector() { + return director; + } + + /** 负责人 director **/ + public void setDirector(String director) { + this.director = director == null ? null : director.trim(); + } + + /** 开始时间 starttime **/ + public Date getStarttime() { + return starttime; + } + + /** 开始时间 starttime **/ + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + /** 结束时间 endtime **/ + public Date getEndtime() { + return endtime; + } + + /** 结束时间 endtime **/ + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + /** 涉及的其他特殊作业 othertask **/ + public String getOthertask() { + return othertask; + } + + /** 涉及的其他特殊作业 othertask **/ + public void setOthertask(String othertask) { + this.othertask = othertask == null ? null : othertask.trim(); + } + + /** 危害辨识(火灾、触电) hazard **/ + public String getHazard() { + return hazard; + } + + /** 危害辨识(火灾、触电) hazard **/ + public void setHazard(String hazard) { + this.hazard = hazard == null ? null : hazard.trim(); + } + + /** 监火人 supervisor **/ + public String getSupervisor() { + return supervisor; + } + + /** 监火人 supervisor **/ + public void setSupervisor(String supervisor) { + this.supervisor = supervisor == null ? null : supervisor.trim(); + } + + /** 工种 profession **/ + public String getProfession() { + return profession; + } + + /** 工种 profession **/ + public void setProfession(String profession) { + this.profession = profession == null ? null : profession.trim(); + } + + /** 动火部位负责人 partdirector **/ + public String getPartdirector() { + return partdirector; + } + + /** 动火部位负责人 partdirector **/ + public void setPartdirector(String partdirector) { + this.partdirector = partdirector == null ? null : partdirector.trim(); + } + + /** 相关单位监火人 approversupervisor **/ + public String getApproversupervisor() { + return approversupervisor; + } + + /** 相关单位监火人 approversupervisor **/ + public void setApproversupervisor(String approversupervisor) { + this.approversupervisor = approversupervisor == null ? null : approversupervisor.trim(); + } + + /** 相关单位工种 approverprofession **/ + public String getApproverprofession() { + return approverprofession; + } + + /** 相关单位工种 approverprofession **/ + public void setApproverprofession(String approverprofession) { + this.approverprofession = approverprofession == null ? null : approverprofession.trim(); + } + + /** 申请单位意见 applyunitopinion **/ + public String getApplyunitopinion() { + return applyunitopinion; + } + + /** 申请单位意见 applyunitopinion **/ + public void setApplyunitopinion(String applyunitopinion) { + this.applyunitopinion = applyunitopinion == null ? null : applyunitopinion.trim(); + } + + /** 施工单位意见 constructionopinion **/ + public String getConstructionopinion() { + return constructionopinion; + } + + /** 施工单位意见 constructionopinion **/ + public void setConstructionopinion(String constructionopinion) { + this.constructionopinion = constructionopinion == null ? null : constructionopinion.trim(); + } + + /** 相关部门意见 relevantopinion **/ + public String getRelevantopinion() { + return relevantopinion; + } + + /** 相关部门意见 relevantopinion **/ + public void setRelevantopinion(String relevantopinion) { + this.relevantopinion = relevantopinion == null ? null : relevantopinion.trim(); + } + + /** 安全管理部门意见 securityopinion **/ + public String getSecurityopinion() { + return securityopinion; + } + + /** 安全管理部门意见 securityopinion **/ + public void setSecurityopinion(String securityopinion) { + this.securityopinion = securityopinion == null ? null : securityopinion.trim(); + } + + /** 企业负责人意见 enterpriseopinion **/ + public String getEnterpriseopinion() { + return enterpriseopinion; + } + + /** 企业负责人意见 enterpriseopinion **/ + public void setEnterpriseopinion(String enterpriseopinion) { + this.enterpriseopinion = enterpriseopinion == null ? null : enterpriseopinion.trim(); + } + + /** 动火前,岗位当班班长验票 shiftleaderopinion **/ + public String getShiftleaderopinion() { + return shiftleaderopinion; + } + + /** 动火前,岗位当班班长验票 shiftleaderopinion **/ + public void setShiftleaderopinion(String shiftleaderopinion) { + this.shiftleaderopinion = shiftleaderopinion == null ? null : shiftleaderopinion.trim(); + } + + /** 申请单位签名 applyunitname **/ + public String getApplyunitname() { + return applyunitname; + } + + /** 申请单位签名 applyunitname **/ + public void setApplyunitname(String applyunitname) { + this.applyunitname = applyunitname == null ? null : applyunitname.trim(); + } + + /** 施工单位签名 constructionname **/ + public String getConstructionname() { + return constructionname; + } + + /** 施工单位签名 constructionname **/ + public void setConstructionname(String constructionname) { + this.constructionname = constructionname == null ? null : constructionname.trim(); + } + + /** 相关部门签名 relevantname **/ + public String getRelevantname() { + return relevantname; + } + + /** 相关部门签名 relevantname **/ + public void setRelevantname(String relevantname) { + this.relevantname = relevantname == null ? null : relevantname.trim(); + } + + /** 安全管理部门签名 securityname **/ + public String getSecurityname() { + return securityname; + } + + /** 安全管理部门签名 securityname **/ + public void setSecurityname(String securityname) { + this.securityname = securityname == null ? null : securityname.trim(); + } + + /** 企业负责人签名 enterprisename **/ + public String getEnterprisename() { + return enterprisename; + } + + /** 企业负责人签名 enterprisename **/ + public void setEnterprisename(String enterprisename) { + this.enterprisename = enterprisename == null ? null : enterprisename.trim(); + } + + /** 动火前,岗位当班班长验票签名 shiftleadername **/ + public String getShiftleadername() { + return shiftleadername; + } + + /** 动火前,岗位当班班长验票签名 shiftleadername **/ + public void setShiftleadername(String shiftleadername) { + this.shiftleadername = shiftleadername == null ? null : shiftleadername.trim(); + } + + /** 申请单位签名时间 applyunittime **/ + public Date getApplyunittime() { + return applyunittime; + } + + /** 申请单位签名时间 applyunittime **/ + public void setApplyunittime(Date applyunittime) { + this.applyunittime = applyunittime; + } + + /** 施工单位签名时间 constructiontime **/ + public Date getConstructiontime() { + return constructiontime; + } + + /** 施工单位签名时间 constructiontime **/ + public void setConstructiontime(Date constructiontime) { + this.constructiontime = constructiontime; + } + + /** 相关部门签名时间 relevanttime **/ + public Date getRelevanttime() { + return relevanttime; + } + + /** 相关部门签名时间 relevanttime **/ + public void setRelevanttime(Date relevanttime) { + this.relevanttime = relevanttime; + } + + /** 安全管理部门签名时间 securitytime **/ + public Date getSecuritytime() { + return securitytime; + } + + /** 安全管理部门签名时间 securitytime **/ + public void setSecuritytime(Date securitytime) { + this.securitytime = securitytime; + } + + /** 企业负责人签名时间 enterprisetime **/ + public Date getEnterprisetime() { + return enterprisetime; + } + + /** 企业负责人签名时间 enterprisetime **/ + public void setEnterprisetime(Date enterprisetime) { + this.enterprisetime = enterprisetime; + } + + /** 动火前,岗位当班班长验票签名时间 shiftleadertime **/ + public Date getShiftleadertime() { + return shiftleadertime; + } + + /** 动火前,岗位当班班长验票签名时间 shiftleadertime **/ + public void setShiftleadertime(Date shiftleadertime) { + this.shiftleadertime = shiftleadertime; + } + + /** 完工时间 completedtime **/ + public Date getCompletedtime() { + return completedtime; + } + + /** 完工时间 completedtime **/ + public void setCompletedtime(Date completedtime) { + this.completedtime = completedtime; + } + + /** 完工申请签字 completedname **/ + public String getCompletedname() { + return completedname; + } + + /** 完工申请签字 completedname **/ + public void setCompletedname(String completedname) { + this.completedname = completedname == null ? null : completedname.trim(); + } + + /** 完工确认人签字 completedconfirm **/ + public String getCompletedconfirm() { + return completedconfirm; + } + + /** 完工确认人签字 completedconfirm **/ + public void setCompletedconfirm(String completedconfirm) { + this.completedconfirm = completedconfirm == null ? null : completedconfirm.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + /** 是否删除(0:否,1:是) isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除(0:否,1:是) isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + /** 施工单位名称 constructionunit **/ + public String getConstructionunit() { + return constructionunit; + } + + /** 施工单位名称 constructionunit **/ + public void setConstructionunit(String constructionunit) { + this.constructionunit = constructionunit == null ? null : constructionunit.trim(); + } + + /** 安全管理部门名称 securitydep **/ + public String getSecuritydep() { + return securitydep; + } + + /** 安全管理部门名称 securitydep **/ + public void setSecuritydep(String securitydep) { + this.securitydep = securitydep == null ? null : securitydep.trim(); + } + + public Byte getIsholiday() { + return isholiday; + } + + public void setIsholiday(Byte isholiday) { + this.isholiday = isholiday; + } + + public String getAnalyst() { + return analyst; + } + + public void setAnalyst(String analyst) { + this.analyst = analyst; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getFullpath() { + return fullpath; + } + + public void setFullpath(String fullpath) { + this.fullpath = fullpath; + } + + public String getSupervisoropinion() { + return supervisoropinion; + } + + public void setSupervisoropinion(String supervisoropinion) { + this.supervisoropinion = supervisoropinion; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getOpinion() { + return opinion; + } + + public void setOpinion(String opinion) { + this.opinion = opinion; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Byte getIsanalysis() { + return isanalysis; + } + + public void setIsanalysis(Byte isanalysis) { + this.isanalysis = isanalysis; + } + + public String getAnalysisarea() { + return analysisarea; + } + + public void setAnalysisarea(String analysisarea) { + this.analysisarea = analysisarea; + } + + public String getAnalysismedium() { + return analysismedium; + } + + public void setAnalysismedium(String analysismedium) { + this.analysismedium = analysismedium; + } + + public Integer getEtype() { + return etype; + } + + public void setEtype(Integer etype) { + this.etype = etype; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/TaskInvolveDepartment.java b/src/main/java/com/gk/hotwork/Domain/TaskInvolveDepartment.java new file mode 100644 index 0000000..8686656 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskInvolveDepartment.java @@ -0,0 +1,183 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName(("taskinvolvedep")) +public class TaskInvolveDepartment { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + /** id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 对应任务编号 taskcode **/ + private String taskcode; + + /** 单位名称 unit **/ + private String unit; + + /** 部门名称 department **/ + private String department; + + /** 审核状态(0:未审核;1:已审核) status **/ + private Byte status; + + /** 审核意见 content **/ + private String content; + + /** 审核时间 reviewedat **/ + private Date reviewedat; + + /** 审核人 reviewedby **/ + private String reviewedby; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 对应任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 对应任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 单位名称 unit **/ + public String getUnit() { + return unit; + } + + /** 单位名称 unit **/ + public void setUnit(String unit) { + this.unit = unit == null ? null : unit.trim(); + } + + /** 部门名称 department **/ + public String getDepartment() { + return department; + } + + /** 部门名称 department **/ + public void setDepartment(String department) { + this.department = department == null ? null : department.trim(); + } + + /** 审核状态(0:未审核;1:已审核) status **/ + public Byte getStatus() { + return status; + } + + /** 审核状态(0:未审核;1:已审核) status **/ + public void setStatus(Byte status) { + this.status = status; + } + + /** 审核意见 content **/ + public String getContent() { + return content; + } + + /** 审核意见 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 审核时间 reviewedat **/ + public Date getReviewedat() { + return reviewedat; + } + + /** 审核时间 reviewedat **/ + public void setReviewedat(Date reviewedat) { + this.reviewedat = reviewedat; + } + + /** 审核人 reviewedby **/ + public String getReviewedby() { + return reviewedby; + } + + /** 审核人 reviewedby **/ + public void setReviewedby(String reviewedby) { + this.reviewedby = reviewedby == null ? null : reviewedby.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskLocationInfo.java b/src/main/java/com/gk/hotwork/Domain/TaskLocationInfo.java new file mode 100644 index 0000000..272c34c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskLocationInfo.java @@ -0,0 +1,99 @@ +package com.gk.hotwork.Domain; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + +@TableName("tasklocation") +public class TaskLocationInfo implements Serializable { + /** 作业人员定位表 id **/ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /**作业编号 taskcode **/ + @NotBlank(message = "作业编号不能为空") + private String taskcode; + + /**作业人员 taskworker **/ + private String taskworker; + + /** 经度 longitude **/ + @NotBlank(message = "经度不能为空") + private String longitude; + + /** 纬度 latitude **/ + @NotBlank(message = "纬度不能为空") + private String latitude; + + /**更新时间 updatetime **/ + private Date updatetime; + + /** 作业人员定位表 id **/ + public Long getId() { + return id; + } + + /** 作业人员定位表 id **/ + public void setId(Long id) { + this.id = id; + } + + /** taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** taskworker **/ + public String getTaskworker() { + return taskworker; + } + + /** taskworker **/ + public void setTaskworker(String taskworker) { + this.taskworker = taskworker == null ? null : taskworker.trim(); + } + + /** longitude **/ + public String getLongitude() { + return longitude; + } + + /** longitude **/ + public void setLongitude(String longitude) { + this.longitude = longitude == null ? null : longitude.trim(); + } + + /** latitude **/ + public String getLatitude() { + return latitude; + } + + /** latitude **/ + public void setLatitude(String latitude) { + this.latitude = latitude == null ? null : latitude.trim(); + } + + /** updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/TaskLog.java b/src/main/java/com/gk/hotwork/Domain/TaskLog.java new file mode 100644 index 0000000..fa79dba --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskLog.java @@ -0,0 +1,121 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("tasklog") +public class TaskLog { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 任务日志记录 id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 任务编号 taskcode **/ + private String taskcode; + + /** 内容 content **/ + private String content; + + /** 审批人 operator **/ + private String operator; + + /** 操作时间 operationat **/ + private Date operationat; + + /** 单位 unit **/ + private String unit; + + /** flag **/ + private Byte flag; + + /** 任务日志记录 id **/ + public Long getId() { + return id; + } + + /** 任务日志记录 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 内容 content **/ + public String getContent() { + return content; + } + + /** 内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 审批人 operator **/ + public String getOperator() { + return operator; + } + + /** 审批人 operator **/ + public void setOperator(String operator) { + this.operator = operator == null ? null : operator.trim(); + } + + /** 操作时间 operationat **/ + public Date getOperationat() { + return operationat; + } + + /** 操作时间 operationat **/ + public void setOperationat(Date operationat) { + this.operationat = operationat; + } + + /** 单位 unit **/ + public String getUnit() { + return unit; + } + + /** 单位 unit **/ + public void setUnit(String unit) { + this.unit = unit == null ? null : unit.trim(); + } + + /** flag **/ + public Byte getFlag() { + return flag; + } + + /** flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + public TaskLog() { + } + + public TaskLog(String taskCode, String content, String operator, Date operationAt, String unit) { + this.taskcode = taskCode; + this.content = content; + this.operator = operator; + this.operationat = operationAt; + this.unit = unit; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskReview.java b/src/main/java/com/gk/hotwork/Domain/TaskReview.java new file mode 100644 index 0000000..3945fd5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskReview.java @@ -0,0 +1,219 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; +import java.util.List; + +@TableName("taskreview") +public class TaskReview { + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + private Long taskId; + + /** 任务编号 taskcode **/ + private String taskcode; + + /** 审批人 reviewer **/ + private String reviewer; + + /** 审批时间 reviewat **/ + private Date reviewat; + + /** 审批意见(0:否;1:是) isagree **/ + private Byte isagree; + + /** 审批描述 opinion **/ + private String opinion; + + /** 审批级别 level **/ + private String level; + + /** 现场图片路径可多个,逗号分隔 scenepic **/ + private String scenepic; + + /** 签名图片路径 autograph **/ + private String autograph; + + /** 经度 longitude **/ + private String longitude; + + /** 纬度 latitude **/ + private String latitude; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 标记 flag **/ + private Byte flag; + + @TableField(exist = false) + private List<String> pictures; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + /** 任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 审批人 reviewer **/ + public String getReviewer() { + return reviewer; + } + + /** 审批人 reviewer **/ + public void setReviewer(String reviewer) { + this.reviewer = reviewer == null ? null : reviewer.trim(); + } + + /** 审批时间 reviewat **/ + public Date getReviewat() { + return reviewat; + } + + /** 审批时间 reviewat **/ + public void setReviewat(Date reviewat) { + this.reviewat = reviewat; + } + + /** 审批意见(0:否;1:是) isagree **/ + public Byte getIsagree() { + return isagree; + } + + /** 审批意见(0:否;1:是) isagree **/ + public void setIsagree(Byte isagree) { + this.isagree = isagree; + } + + /** 审批描述 opinion **/ + public String getOpinion() { + return opinion; + } + + /** 审批描述 opinion **/ + public void setOpinion(String opinion) { + this.opinion = opinion == null ? null : opinion.trim(); + } + + /** 审批级别 level **/ + public String getLevel() { + return level; + } + + /** 审批级别 level **/ + public void setLevel(String level) { + this.level = level == null ? null : level.trim(); + } + + /** 现场图片路径可多个,逗号分隔 scenepic **/ + public String getScenepic() { + return scenepic; + } + + /** 现场图片路径可多个,逗号分隔 scenepic **/ + public void setScenepic(String scenepic) { + this.scenepic = scenepic == null ? null : scenepic.trim(); + } + + /** 签名图片路径 autograph **/ + public String getAutograph() { + return autograph; + } + + /** 签名图片路径 autograph **/ + public void setAutograph(String autograph) { + this.autograph = autograph == null ? null : autograph.trim(); + } + + /** 经度 longitude **/ + public String getLongitude() { + return longitude; + } + + /** 经度 longitude **/ + public void setLongitude(String longitude) { + this.longitude = longitude == null ? null : longitude.trim(); + } + + /** 纬度 latitude **/ + public String getLatitude() { + return latitude; + } + + /** 纬度 latitude **/ + public void setLatitude(String latitude) { + this.latitude = latitude == null ? null : latitude.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + public List<String> getPictures() { + return pictures; + } + + public void setPictures(List<String> pictures) { + this.pictures = pictures; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskRisk.java b/src/main/java/com/gk/hotwork/Domain/TaskRisk.java new file mode 100644 index 0000000..c1b7f8d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskRisk.java @@ -0,0 +1,214 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("taskrisk") +public class TaskRisk { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** 安全交底和风险告知确认卡 id **/ + private Long id; + + /** 作业证编号 taskcode **/ + private String taskcode; + + /** 作业内容 content **/ + private String content; + + /** 作业许可范围及作业环境 environment **/ + private String environment; + + /** 预防措施 preventive **/ + private String preventive; + + /** 应急措施 emergency **/ + private String emergency; + + /** 其他注意事项 other **/ + private String other; + + /** 企业负责人签字 director **/ + private String director; + + /** 作业单位现场负责人签字 taskdirector **/ + private String taskdirector; + + /** 告知时间 confirmat **/ + private Date confirmat; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + /** 安全交底和风险告知确认卡 id **/ + public Long getId() { + return id; + } + + /** 安全交底和风险告知确认卡 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 作业证编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 作业证编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 作业内容 content **/ + public String getContent() { + return content; + } + + /** 作业内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 作业许可范围及作业环境 environment **/ + public String getEnvironment() { + return environment; + } + + /** 作业许可范围及作业环境 environment **/ + public void setEnvironment(String environment) { + this.environment = environment == null ? null : environment.trim(); + } + + /** 预防措施 preventive **/ + public String getPreventive() { + return preventive; + } + + /** 预防措施 preventive **/ + public void setPreventive(String preventive) { + this.preventive = preventive == null ? null : preventive.trim(); + } + + /** 应急措施 emergency **/ + public String getEmergency() { + return emergency; + } + + /** 应急措施 emergency **/ + public void setEmergency(String emergency) { + this.emergency = emergency == null ? null : emergency.trim(); + } + + /** 其他注意事项 other **/ + public String getOther() { + return other; + } + + /** 其他注意事项 other **/ + public void setOther(String other) { + this.other = other == null ? null : other.trim(); + } + + /** 企业负责人签字 director **/ + public String getDirector() { + return director; + } + + /** 企业负责人签字 director **/ + public void setDirector(String director) { + this.director = director == null ? null : director.trim(); + } + + /** 作业单位现场负责人签字 taskdirector **/ + public String getTaskdirector() { + return taskdirector; + } + + /** 作业单位现场负责人签字 taskdirector **/ + public void setTaskdirector(String taskdirector) { + this.taskdirector = taskdirector == null ? null : taskdirector.trim(); + } + + /** 告知时间 confirmat **/ + public Date getConfirmat() { + return confirmat; + } + + /** 告知时间 confirmat **/ + public void setConfirmat(Date confirmat) { + this.confirmat = confirmat; + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskSecurity.java b/src/main/java/com/gk/hotwork/Domain/TaskSecurity.java new file mode 100644 index 0000000..e97e8b8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskSecurity.java @@ -0,0 +1,195 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:42:58 + */ +@TableName("tasksecurity") +public class TaskSecurity { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 安全措施 id **/ + @TableId(type = IdType.AUTO) + private Long id; + + /** 对应作业证编号 taskcode **/ + private String taskcode; + + /** 序列号 sn **/ + private Integer sn; + + /** 安全措施内容 content **/ + private String content; + + /** 是否选择(0:;1:√;2:/) checked **/ + private Byte checked; + + private String checktype; + + /** 安全检查项数量 num **/ + private Integer num; + + /** 确认人 confirmedby **/ + private String confirmedby; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + private String tasktype; + + /** 安全措施 id **/ + public Long getId() { + return id; + } + + /** 安全措施 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 对应作业证编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 对应作业证编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + /** 序列号 sn **/ + public Integer getSn() { + return sn; + } + + /** 序列号 sn **/ + public void setSn(Integer sn) { + this.sn = sn; + } + + /** 安全措施内容 content **/ + public String getContent() { + return content; + } + + /** 安全措施内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 是否选择(0:;1:√;2:/) checked **/ + public Byte getChecked() { + return checked; + } + + /** 是否选择(0:;1:√;2:/) checked **/ + public void setChecked(Byte checked) { + this.checked = checked; + } + + public String getChecktype() { + return checktype; + } + + public void setChecktype(String checktype) { + this.checktype = checktype; + } + + /** 安全检查项数量 num **/ + public Integer getNum() { + return num; + } + + /** 安全检查项数量 num **/ + public void setNum(Integer num) { + this.num = num; + } + + /** 确认人 confirmedby **/ + public String getConfirmedby() { + return confirmedby; + } + + /** 确认人 confirmedby **/ + public void setConfirmedby(String confirmedby) { + this.confirmedby = confirmedby == null ? null : confirmedby.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + public String getTasktype() { + return tasktype; + } + + public void setTasktype(String tasktype) { + this.tasktype = tasktype; + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Domain/TaskWorker.java b/src/main/java/com/gk/hotwork/Domain/TaskWorker.java new file mode 100644 index 0000000..772db39 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/TaskWorker.java @@ -0,0 +1,173 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +/** + * @author jingjy + * @date 2021-8-19 16:48:22 + */ +@TableName("taskworker") +public class TaskWorker { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** 动火人 id **/ + private Long id; + + /** 作业证编号 taskcode **/ + private String taskcode; + + /** 施工单位 unit **/ + private String unit; + + /** 动火人姓名 worker **/ + private String worker; + + /** 特种作业工种 branch **/ + private String branch; + + /** 特种作业证件号 number **/ + private String number; + + /** 创建时间 createdat **/ + private Date createdat; + + /** 创建人 createdby **/ + private String createdby; + + /** 修改时间 modifiedat **/ + private Date modifiedat; + + /** 修改人 modifiedby **/ + private String modifiedby; + + /** 标记 flag **/ + private Byte flag; + + private String tasktype; + + /** 动火人 id **/ + public Long getId() { + return id; + } + + /** 动火人 id **/ + public void setId(Long id) { + this.id = id; + } + + /** 作业证编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 作业证编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + + /** 施工单位 unti **/ + public String getUnit() { + return unit; + } + + /** 施工单位 unti **/ + public void setUnit(String unit) { + this.unit = unit; + } + + /** 动火人姓名 worker **/ + public String getWorker() { + return worker; + } + + /** 动火人姓名 worker **/ + public void setWorker(String worker) { + this.worker = worker == null ? null : worker.trim(); + } + + /** 特种作业工种 branch **/ + public String getBranch() { + return branch; + } + + /** 特种作业工种 branch **/ + public void setBranch(String branch) { + this.branch = branch == null ? null : branch.trim(); + } + + /** 特种作业证件号 number **/ + public String getNumber() { + return number; + } + + /** 特种作业证件号 number **/ + public void setNumber(String number) { + this.number = number == null ? null : number.trim(); + } + + /** 创建时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 创建时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 创建人 createdby **/ + public String getCreatedby() { + return createdby; + } + + /** 创建人 createdby **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** 修改时间 modifiedat **/ + public Date getModifiedat() { + return modifiedat; + } + + /** 修改时间 modifiedat **/ + public void setModifiedat(Date modifiedat) { + this.modifiedat = modifiedat; + } + + /** 修改人 modifiedby **/ + public String getModifiedby() { + return modifiedby; + } + + /** 修改人 modifiedby **/ + public void setModifiedby(String modifiedby) { + this.modifiedby = modifiedby == null ? null : modifiedby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + public String getTasktype() { + return tasktype; + } + + public void setTasktype(String tasktype) { + this.tasktype = tasktype; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/UserFace.java b/src/main/java/com/gk/hotwork/Domain/UserFace.java new file mode 100644 index 0000000..edb5c16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/UserFace.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.Domain; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("userface") +public class UserFace implements Serializable { + + private static final long serialVersionUID = 1L; + + /** userid **/ + private Long userid; + + /** updatetime **/ + private Date updatetime; + + /** code **/ + private String code; + + /** userid **/ + public Long getUserid() { + return userid; + } + + /** userid **/ + public void setUserid(Long userid) { + this.userid = userid; + } + + /** updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + /** code **/ + public String getCode() { + return code; + } + + /** code **/ + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/UserInfo.java b/src/main/java/com/gk/hotwork/Domain/UserInfo.java new file mode 100644 index 0000000..b4e5524 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/UserInfo.java @@ -0,0 +1,546 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@TableName("user") +public class UserInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户名:手机号 username + **/ + private String username; + + /** + * 密码 password + **/ + private String password; + + /** + * 真实姓名 password + **/ + private String realname; + + /** + * 身份证号 idcard + **/ + private String idcard; + + /** + * 邮箱 email + **/ + private String email; + + /** + * 单位 company + **/ + private String company; + + private Long companyid; + + /** + * 部门 department + **/ + private Long department; + /** + * 部门 department + **/ + @TableField(exist = false) + private String departmentname; + + /** + * 角色id roleid + **/ + @TableField(exist = false) + private Long roleid; + + /** + * 职务 job + **/ + private String job; + + /** + * 创建人 createdby + **/ + private String createdby; + + /** + * 创建时间 createddate + **/ + private Date createddate; + + /** + * 更新人 lastmodifiedby + **/ + private String lastmodifiedby; + + /** + * 更新时间 lastmodifieddate + **/ + private Date lastmodifieddate; + + /** + * 状态 1正常 0停用 status + **/ + private Byte status; + + /** + * 到期时间 expiredate + **/ + private Date expiredate; + + /** + * 是否删除 1删除 0未删 isdel + **/ + private Byte isdel; + + /** + * # 1超级管理员,2管理员,3普通用户 + **/ + private Integer type; + + /** + * 是否单位负责人 1是 0否 + **/ + private Byte iscompany; + + /** + * 是否部门负责人 1是 0否 + **/ + private Byte isdepartment; + + /** + * 是否上传 1是 0否 + **/ + private Byte isupload; + + private String roleSign; + + /* + 是否是安全员 + */ + private Byte issecurityofficer; + + /** + * 工号 + **/ + @TableField(value = "empno") + private String empNo; + + /** + * 设备MAC地址 + **/ + @TableField(value = "deviceno") + private String deviceNo; + + /** + * 定位卡ID + **/ + @TableField(value = "cardid") + private String cardId; + + /** + * 坐标轴X + **/ + @TableField(value = "crossX") + private BigDecimal crossX; + + /** + * 坐标轴Y + **/ + @TableField(value = "crossY") + private BigDecimal crossY; + + @TableField(value = "area") + private Integer area; + + @TableField(value = "latitude") + private BigDecimal latitude; + + @TableField(value = "longitude") + private BigDecimal longitude; + + @TableField(value = "layer") + private String layer; + + private Date updateat; + + private String slice; + + public Long getRoleid() { + return roleid; + } + + public void setRoleid(Long roleid) { + this.roleid = roleid; + } + + /** + * id + **/ + public Long getId() { + return id; + } + + /** + * id + **/ + public void setId(Long id) { + this.id = id; + } + + /** + * 用户名 username + **/ + public String getUsername() { + return username; + } + + /** + * 用户名 username + **/ + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + /** + * 密码 password + **/ + public String getPassword() { + return password; + } + + /** + * 密码 password + **/ + public void setPassword(String password) { + this.password = password == null ? null : password.trim(); + } + + /** + * 邮箱 email + **/ + public String getEmail() { + return email; + } + + /** + * 邮箱 email + **/ + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + /** + * 单位 company + **/ + public String getCompany() { + return company; + } + + + /** + * 职务 job + **/ + public String getJob() { + return job; + } + + /** + * 职务 job + **/ + public void setJob(String job) { + this.job = job == null ? null : job.trim(); + } + + /** + * 创建人 createdby + **/ + public String getCreatedby() { + return createdby; + } + + /** + * 创建人 createdby + **/ + public void setCreatedby(String createdby) { + this.createdby = createdby == null ? null : createdby.trim(); + } + + /** + * 创建时间 createddate + **/ + public Date getCreateddate() { + return createddate; + } + + /** + * 创建时间 createddate + **/ + public void setCreateddate(Date createddate) { + this.createddate = createddate; + } + + /** + * 更新人 lastmodifiedby + **/ + public String getLastmodifiedby() { + return lastmodifiedby; + } + + /** + * 更新人 lastmodifiedby + **/ + public void setLastmodifiedby(String lastmodifiedby) { + this.lastmodifiedby = lastmodifiedby == null ? null : lastmodifiedby.trim(); + } + + /** + * 更新时间 lastmodifieddate + **/ + public Date getLastmodifieddate() { + return lastmodifieddate; + } + + /** + * 更新时间 lastmodifieddate + **/ + public void setLastmodifieddate(Date lastmodifieddate) { + this.lastmodifieddate = lastmodifieddate; + } + + /** + * 状态 status + **/ + public Byte getStatus() { + return status; + } + + /** + * 状态 status + **/ + public void setStatus(Byte status) { + this.status = status; + } + + /** + * 到期时间 expiredate + **/ + public Date getExpiredate() { + return expiredate; + } + + /** + * 到期时间 expiredate + **/ + public void setExpiredate(Date expiredate) { + this.expiredate = expiredate; + } + + /** + * 是否删除 isdel + **/ + public Byte getIsdel() { + return isdel; + } + + /** + * 是否删除 isdel + **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Byte getIscompany() { + return iscompany; + } + + public void setIscompany(Byte iscompany) { + this.iscompany = iscompany; + } + + public Byte getIsdepartment() { + return isdepartment; + } + + public void setIsdepartment(Byte isdepartment) { + this.isdepartment = isdepartment; + } + + public Byte getIsupload() { + return isupload; + } + + public void setIsupload(Byte isupload) { + this.isupload = isupload; + } + + public String getEmpNo() { + return empNo; + } + + public void setEmpNo(String empNo) { + this.empNo = empNo; + } + + public String getDeviceNo() { + return deviceNo; + } + + public void setDeviceNo(String deviceNo) { + this.deviceNo = deviceNo; + } + + public String getCardId() { + return cardId; + } + + public void setCardId(String cardId) { + this.cardId = cardId; + } + + public BigDecimal getCrossX() { + return crossX; + } + + public void setCrossX(BigDecimal crossX) { + this.crossX = crossX; + } + + public BigDecimal getCrossY() { + return crossY; + } + + public void setCrossY(BigDecimal crossY) { + this.crossY = crossY; + } + + public Date getUpdateat() { + return updateat; + } + + public void setUpdateat(Date updateat) { + this.updateat = updateat; + } + + public Integer getArea() { + return area; + } + + public void setArea(Integer area) { + this.area = area; + } + + public BigDecimal getLatitude() { + return latitude; + } + + public void setLatitude(BigDecimal latitude) { + this.latitude = latitude; + } + + public BigDecimal getLongitude() { + return longitude; + } + + public void setLongitude(BigDecimal longitude) { + this.longitude = longitude; + } + + public String getLayer() { + return layer; + } + + public void setLayer(String layer) { + this.layer = layer; + } + + public String getSlice() { + return slice; + } + + public void setSlice(String slice) { + this.slice = slice; + } + + public String getRoleSign() { + return roleSign; + } + + public void setRoleSign(String roleSign) { + this.roleSign = roleSign; + } + + public Long getCompanyid() { + return companyid; + } + + public void setCompanyid(Long companyid) { + this.companyid = companyid; + } + + + public Byte getIssecurityofficer() { + return issecurityofficer; + } + + public void setIssecurityofficer(Byte issecurityofficer) { + this.issecurityofficer = issecurityofficer; + } + + + public void setDepartment(Long department) { + this.department = department; + } + + public String getDepartmentname() { + return departmentname; + } + + public void setDepartmentname(String departmentname) { + this.departmentname = departmentname; + } + + public void setCompany(String company) { + this.company = company; + } + + public Long getDepartment() { + return department; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/UserRolesInfo.java b/src/main/java/com/gk/hotwork/Domain/UserRolesInfo.java new file mode 100644 index 0000000..7ca2063 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/UserRolesInfo.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.Domain; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("userroles") +public class UserRolesInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + /** id id **/ + private Long id; + + /** 用户id userid **/ + private Long userid; + + /** 角色id roleid **/ + private Long roleid; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 用户id userid **/ + public Long getUserid() { + return userid; + } + + /** 用户id userid **/ + public void setUserid(Long userid) { + this.userid = userid; + } + + /** 角色id roleid **/ + public Long getRoleid() { + return roleid; + } + + /** 角色id roleid **/ + public void setRoleid(Long roleid) { + this.roleid = roleid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Base64Encrypt.java b/src/main/java/com/gk/hotwork/Domain/Utils/Base64Encrypt.java new file mode 100644 index 0000000..5f4167f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Base64Encrypt.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.Domain.Utils; + +import java.io.IOException; + +public class Base64Encrypt { + /** + * 编码 + * + * @param bstr + * @return String + */ + public static String encode(byte[] bstr) { + return new sun.misc.BASE64Encoder().encode(bstr); + } + + /** + * 解码 + * + * @param str + * @return string + */ + public static byte[] decode(String str) { + byte[] bt = null; + try { + sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder(); + bt = decoder.decodeBuffer(str); + } catch (IOException e) { + e.printStackTrace(); + } + + return bt; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/BeanProperty.java b/src/main/java/com/gk/hotwork/Domain/Utils/BeanProperty.java new file mode 100644 index 0000000..9a7be23 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/BeanProperty.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Domain.Utils; + +/** + * Bean属性 + * @author L.cm + */ +public class BeanProperty { + private final String name; + private final Class<?> type; + + public BeanProperty(String name, Class<?> type) { + this.name = name; + this.type = type; + } + + public String getName() { + return name; + } + public Class<?> getType() { + return type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/BeanUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/BeanUtils.java new file mode 100644 index 0000000..d386c61 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/BeanUtils.java @@ -0,0 +1,193 @@ +package com.gk.hotwork.Domain.Utils; + + +import org.springframework.cglib.beans.BeanCopier; +import org.springframework.cglib.beans.BeanGenerator; +import org.springframework.cglib.beans.BeanMap; + +import java.beans.PropertyDescriptor; +import java.lang.reflect.Method; +import java.util.Map; + +/** + * 基于CGlib + * 实体工具类,目前copy不支持map、list + * @author L.cm + * email: 596392912@qq.com + * site:http://www.dreamlu.net + * @date 2015年4月26日下午5:10:42 + */ +public final class BeanUtils extends org.springframework.beans.BeanUtils { + private BeanUtils(){} + + /** + * 实例化对象 + * @param clazz 类 + * @return 对象 + */ + @SuppressWarnings("unchecked") + public static <T> T newInstance(Class<?> clazz) { + return (T) instantiate(clazz); + } + + /** + * 实例化对象 + * @param clazzStr 类名 + * @return 对象 + */ + public static <T> T newInstance(String clazzStr) { + try { + Class<?> clazz = Class.forName(clazzStr); + return newInstance(clazz); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + + /** + * 获取Bean的属性 + * @param bean bean + * @param propertyName 属性名 + * @return 属性值 + */ + public static Object getProperty(Object bean, String propertyName) { + PropertyDescriptor pd = getPropertyDescriptor(bean.getClass(), propertyName); + if (pd == null) { + throw new RuntimeException("Could not read property '" + propertyName + "' from bean PropertyDescriptor is null"); + } + Method readMethod = pd.getReadMethod(); + if (readMethod == null) { + throw new RuntimeException("Could not read property '" + propertyName + "' from bean readMethod is null"); + } + if (!readMethod.isAccessible()) { + readMethod.setAccessible(true); + } + try { + return readMethod.invoke(bean); + } catch (Throwable ex) { + throw new RuntimeException("Could not read property '" + propertyName + "' from bean", ex); + } + } + + /** + * 设置Bean属性 + * @param bean bean + * @param propertyName 属性名 + * @param value 属性值 + */ + public static void setProperty(Object bean, String propertyName, Object value) { + PropertyDescriptor pd = getPropertyDescriptor(bean.getClass(), propertyName); + if (pd == null) { + throw new RuntimeException("Could not set property '" + propertyName + "' to bean PropertyDescriptor is null"); + } + Method writeMethod = pd.getWriteMethod(); + if (writeMethod == null) { + throw new RuntimeException("Could not set property '" + propertyName + "' to bean writeMethod is null"); + } + if (!writeMethod.isAccessible()) { + writeMethod.setAccessible(true); + } + try { + writeMethod.invoke(bean, value); + } catch (Throwable ex) { + throw new RuntimeException("Could not set property '" + propertyName + "' to bean", ex); + } + } + + /** + * 给一个Bean添加字段 + * @param superBean 父级Bean + * @param props 新增属性 + * @return {Object} + */ + public static Object generator(Object superBean, BeanProperty... props) { + Class<?> superclass = superBean.getClass(); + Object genBean = generator(superclass, props); + BeanUtils.copy(superBean, genBean); + return genBean; + } + + /** + * 给一个class添加字段 + * @param superclass 父级 + * @param props 新增属性 + * @return {Object} + */ + public static Object generator(Class<?> superclass, BeanProperty... props) { + BeanGenerator generator = new BeanGenerator(); + generator.setSuperclass(superclass); + generator.setUseCache(true); + for (BeanProperty prop : props) { + generator.addProperty(prop.getName(), prop.getType()); + } + return generator.create(); + } + + /** + * copy 对象属性到另一个对象,默认不使用Convert + * @param src + * @param clazz 类名 + * @return T + */ + public static <T> T copy(Object src, Class<T> clazz) { + BeanCopier copier = BeanCopier.create(src.getClass(), clazz, false); + + T to = newInstance(clazz); + copier.copy(src, to, null); + return to; + } + + /** + * 拷贝对象 + * @param src 源对象 + * @param dist 需要赋值的对象 + */ + public static void copy(Object src, Object dist) { + BeanCopier copier = BeanCopier + .create(src.getClass(), dist.getClass(), false); + + copier.copy(src, dist, null); + } + + /** + * 将对象装成map形式 + * @param src + * @return + */ + @SuppressWarnings("rawtypes") + public static Map toMap(Object src) { + return BeanMap.create(src); + } + + /** + * 将map 转为 bean + */ + public static <T> T toBean(Map<String, Object> beanMap, Class<T> valueType) { + T bean = BeanUtils.newInstance(valueType); + PropertyDescriptor[] beanPds = getPropertyDescriptors(valueType); + for (PropertyDescriptor propDescriptor : beanPds) { + String propName = propDescriptor.getName(); + // 过滤class属性 + if (propName.equals("class")) { + continue; + } + if (beanMap.containsKey(propName)) { + Method writeMethod = propDescriptor.getWriteMethod(); + if (null == writeMethod) { + continue; + } + Object value = beanMap.get(propName); + if (!writeMethod.isAccessible()) { + writeMethod.setAccessible(true); + } + try { + writeMethod.invoke(bean, value); + } catch (Throwable e) { + throw new RuntimeException("Could not set property '" + propName + "' to bean", e); + } + } + } + return bean; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/BooleanReason.java b/src/main/java/com/gk/hotwork/Domain/Utils/BooleanReason.java new file mode 100644 index 0000000..302d03b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/BooleanReason.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.Domain.Utils; + +import java.util.ArrayList; +import java.util.List; + +public class BooleanReason { + private Boolean value; + private List<String> reasons = new ArrayList<String>(); + private String resultmsg ; + private Object data; + private Long totalnum; + + public Boolean getValue() { + return value; + } + + public void setValue(Boolean value) { + this.value = value; + } + + public List<String> getReasons() { + return reasons; + } + + public void addReason(String reason) { + this.reasons.add(reason); + } + + public String getResultmsg() { + return this.reasons.size() > 0? this.reasons.get(this.reasons.size()-1): null; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + public Long getTotalnum() { + return totalnum; + } + + public void setTotalnum(Long totalnum) { + this.totalnum = totalnum; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/CodeUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/CodeUtils.java new file mode 100644 index 0000000..3318e5a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/CodeUtils.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.Domain.Utils; + +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** +* @author celin +* @date 2022/3/24 15:25 +*/ +public class CodeUtils { + + + //4位,不足4位补0 + public static String generateHiddenDangerCode(String pattern, HiddenDangerLevel hiddenDangerLevel,long userId, Integer n) { + assert hiddenDangerLevel != null; + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + String format = sdf.format(new Date()); + String level = hiddenDangerLevel == HiddenDangerLevel.COMMON?"C":"U"; + return format + level + String.format("%04d", userId) + "-" +String.format("%03d", n); + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/CommonUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/CommonUtil.java new file mode 100644 index 0000000..35f84bf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/CommonUtil.java @@ -0,0 +1,139 @@ +package com.gk.hotwork.Domain.Utils; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.setting.Setting; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +/** + * 常用工具类 + * + * @author zhangby + * @date 2019-05-13 12:20 + */ +public class CommonUtil { + + /** + * 解析token + * @return + */ + public static Claims parseJwtNoBearer(String jwt){ + try{ + Claims claims = Jwts.parser() + .setSigningKey("springCloud_oauth_service".getBytes()) + .parseClaimsJws(jwt).getBody(); + return claims; + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } + + /** + * 解析token + * @param jsonWebToken + * @param base64Security + * @return + */ + public static Claims parseJWT(String jsonWebToken, String base64Security){ + String jwt = jsonWebToken.replace("Bearer ", ""); + try{ + Claims claims = Jwts.parser() + .setSigningKey(base64Security.getBytes()) + .parseClaimsJws(jwt).getBody(); + return claims; + }catch(Exception ex){ + ex.printStackTrace(); + return null; + } + } + + /** + * 解析token + * @param jsonWebToken + * @return + */ + public static Claims parseJWT(String jsonWebToken){ + return emptyStr(jsonWebToken).map(token -> CommonUtil.parseJWT(token, "springCloud_oauth_service")).orElse(null); + } + + /** + * list数据转换 + * @param list list对象 + * @param func lamdba 表达式 function + * @param <E> 原对象 + * @param <T> 转换完的对象 + * @return List<E> + */ + public static <E,T> List<E> convers(List<T> list, Function<T, E> func) { + return list.stream().collect(ArrayList::new, (li, p) -> li.add(func.apply(p)), List::addAll); + } + + /** + * 加载错误信息 + * @return + */ + public static String loadErrorMsg(String num, Object... msg) { + //获取错误码配置信息 + Setting errorSetting = ConfigUtil.getErrorSetting(); + //获取错误码 + String errMsg = errorSetting.get(StrUtil.format("code_{}", num)); + if (ObjectUtil.isNotNull(msg)) { + errMsg = StrUtil.format(errMsg, msg); + } + return errMsg; + } + + /** + * 字符串模板替换 截取 + * ClassTest::getDictList4Function,{}::{} ->[ClassTest,getDictList4Function] + * + * @param str + * @param temp + * @return + */ + public static List<String> splitStr4Temp(String str, String temp) { + List<String> rsList = Lists.newArrayList(); + Iterator<String> iterator = Splitter.on("{}").omitEmptyStrings().split(temp).iterator(); + while (iterator.hasNext()) { + str = str.replace(iterator.next(), "〆"); + } + Iterator<String> split = Splitter.on("〆").omitEmptyStrings().split(str).iterator(); + while (split.hasNext()) { + rsList.add(split.next()); + } + return rsList.stream().filter(StrUtil::isNotBlank).collect(Collectors.toList()); + } + + /** + * 异常捕获 + * @param resolver resolver + * @param <T> T + * @return + */ + public static <T> Optional<T> resolve(Supplier<T> resolver) { + Optional<T> optional = Optional.empty(); + try { + T result = resolver.get(); + optional = Optional.ofNullable(result); + } catch (Exception e) { + optional = Optional.empty(); + } + return optional; + } + + public static Optional<String> emptyStr(String string) { + return Optional.ofNullable(string).filter(StrUtil::isNotBlank); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/ConfigUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/ConfigUtil.java new file mode 100644 index 0000000..d3c9c61 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/ConfigUtil.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Domain.Utils; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.setting.Setting; + +/** + * 获取公用配置文件 + * + * + * @author zhangby + * @date 2019-05-13 16:13 + */ +public class ConfigUtil { + /** + * 异常错误码配置 + */ + private static Setting errorSetting = null; + + /** + * 获取错误码配置 + */ + public static Setting getErrorSetting() { + return configFunction("error.setting", errorSetting); + } + + /** + * 读取系统配置信息 + * + * @param configName + * @return + */ + private static Setting configFunction(String configName, Setting prop) { + if (ObjectUtil.isNull(prop)) { + prop = new Setting(configName); + } + return prop; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Constants.java b/src/main/java/com/gk/hotwork/Domain/Utils/Constants.java new file mode 100644 index 0000000..63b0d70 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Constants.java @@ -0,0 +1,139 @@ +package com.gk.hotwork.Domain.Utils; + +/** + * 静态文件 + * + * @author zhangby + * @date 2019-05-13 12:19 + */ +public class Constants { + + + /************************* 系统常量 *********************************/ + /** + * yes_no: 0 否 + */ + public static final Integer YES_NO_0 = 0; + /** + * yes_no: 1 是 + */ + public static final Integer YES_NO_1 = 1; + /** + * 成功: success + */ + public static final String SUCCESS = "success"; + /** + * 失败: fail + */ + public static final String FAIL = "fail"; + + /** + * 非过滤URL **, + */ + public static final String FILTER_EXCLUDE_PATH = "/,/v2/api-docs,/swagger-resources/**,/swagger-ui.html,/webjars/**,/auth/**,/api/**,/error,/upload/**,/dbback/**,/push/**,/register/add,/companyList,/departmentList,/districtByName,/district,/pwd-change"; + + /** + * 登录授权类型 + */ + public static final String AUTH_TYPE = "auth_type"; + + /** + * 当前用户id + */ + public static final String CURRENT_USER_ID = "current_user_id"; + + /** + * 管理员角色id + */ + public static final String ROLE_ADMIN_ID = "1"; + + /** + * 系统管理员id + */ + public static final String USER_ADMIN_ID = "1"; + + /** + * 系统父类id + */ + public static final String SYS_PARENT_ID = "0"; + + /************************* 通用错误信息 ******************************/ + + /** 错误码 (ERROR CODE) */ + /** + * 正常 code:000 + */ + public static final String NORMAL = "000"; + /** + * 错误 code:999 + */ + public static final String ERROR = "999"; + + + /** 错误信息 (ERROR MESSAGE) */ + /** + * 正常 code:000 + */ + public static final String MSG_000 = "成功"; + /** + * 错误 code:999 + */ + public static final String MSG_999 = "系统错误"; + + + /** + * @Description: enterpriseresources->tabletype + * @author celin + */ + + /** + * @Description: 标准化 + */ + public static final String STANDARDIZATION = "Standardization"; + + /** + * @Description: 证书 + */ + public static final String LICENSE = "License"; + + /** + * @Description: 仓库 + */ + public static final String WAREHOUSE = "Warehouse"; + + /** + * @Description: 人员 + */ + public static final String PERSON = "Person"; + + /** + * @Description: 文件 + */ + public static final String DOCUMENT = "Document"; + + /** + * @Description: 上传反馈 + */ + public static final String FEED = "Feed"; + + + /** + * @Description: 法定代表人 + */ + public static final String LEGAL_REPRESENTATIVE = "法定代表人"; + + /** + * @Description: 主要负责人 + */ + public static final String MAIN_PRINCIPAL = "主要负责人"; + + /** + * @Description: 安全负责人 + */ + public static final String SECURITY_OFFICER = "安全负责人"; + + /** + * @Description: 信息员 + */ + public static final String INFORMATION_OFFICER = "信息员"; +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/DateUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/DateUtils.java new file mode 100644 index 0000000..656fa27 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/DateUtils.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.Domain.Utils; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class DateUtils { + + /** + * 根据时间 和时间格式 校验是否正确 + * @param length 校验的长度 + * @param sDate 校验的日期 + * @param format 校验的格式 + * @return + */ + public static boolean isLegalDate(int length, String sDate,String format) { + int legalLen = length; + if ((sDate == null) || (sDate.length() != legalLen)) { + return false; + } + DateFormat formatter = new SimpleDateFormat(format); + try { + Date date = formatter.parse(sDate); + return sDate.equals(formatter.format(date)); + } catch (Exception e) { + return false; + } + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/DigestUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/DigestUtils.java new file mode 100644 index 0000000..6107faf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/DigestUtils.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Domain.Utils; + +import org.apache.commons.codec.Charsets; + +/** + * 加密相关工具类直接使用Spring util封装,减少jar依赖 + * @author L.cm + */ +public class DigestUtils extends org.springframework.util.DigestUtils { + + /** + * Calculates the MD5 digest and returns the value as a 32 character hex string. + * + * @param data Data to digest + * @return MD5 digest as a hex string + */ + public static String md5Hex(final String data) { + return DigestUtils.md5DigestAsHex(data.getBytes(Charsets.UTF_8)); + } + + /** + * Return a hexadecimal string representation of the MD5 digest of the given bytes. + * @param bytes the bytes to calculate the digest over + * @return a hexadecimal digest string + */ + public static String md5Hex(final byte[] bytes) { + return DigestUtils.md5DigestAsHex(bytes); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/ExcelProperty.java b/src/main/java/com/gk/hotwork/Domain/Utils/ExcelProperty.java new file mode 100644 index 0000000..de2b0d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/ExcelProperty.java @@ -0,0 +1,100 @@ +package com.gk.hotwork.Domain.Utils; + +import org.apache.poi.ss.usermodel.*; + +import java.text.DecimalFormat; +import java.text.Format; +import java.util.Date; + +/** + * Created by Administrator on 2017/8/12. + */ +public class ExcelProperty { + public static Object getCellValue(Cell cell,FormulaEvaluator evaluator) { + Object value = ""; +// SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); //日期格式化 +// DecimalFormat df2 = new DecimalFormat("0.00"); //格式化数字 + + if(null == cell) + { + return ""; + } + switch (cell.getCellType()) { + case _NONE: + value = ""; + break; + case BLANK: + value = ""; + break; + case BOOLEAN: + value = cell.getBooleanCellValue(); + break; + case ERROR: + value = cell.getErrorCellValue(); + break; + case FORMULA: + CellValue cellValue = evaluator.evaluate(cell); + switch (cellValue.getCellType()) { + case _NONE: + value = ""; + break; + case BLANK: + value = ""; + break; + case BOOLEAN: + value = cellValue.getBooleanValue(); + break; + case ERROR: + value = cellValue.getErrorValue(); + break; + case NUMERIC: + value = cellValue.getNumberValue(); + break; + case STRING: + if(StringUtils.isNotBlank(cell.getStringCellValue())) + { + value=cell.getStringCellValue().trim(); + } + else { + value =""; + } + break; + default: + break; + } + break; + case NUMERIC: + value=formatNumericCell(cell.getNumericCellValue(), cell); + break; + case STRING: + if(StringUtils.isNotBlank(cell.getStringCellValue())) + { + value=cell.getStringCellValue().trim(); + } + else { + value =""; + } + break; + default: + break; + } + return value; + } + + public static String formatNumericCell(Double value, Cell cell) { + if(cell.getCellType() != CellType.NUMERIC && cell.getCellType() != CellType.FORMULA) { + return null; + } + //isCellDateFormatted判断该单元格是"时间格式"或者该"单元格的公式算出来的是时间格式" + if(DateUtil.isCellDateFormatted(cell)) { + Date date = cell.getDateCellValue(); + DataFormatter dataFormatter = new DataFormatter(); + Format format = dataFormatter.createFormat(cell); + return format.format(date); + } else { + DecimalFormat df = new DecimalFormat("#.###"); //格式化number String字符 + return df.format(value); + + } + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/FileOptUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/FileOptUtils.java new file mode 100644 index 0000000..7244168 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/FileOptUtils.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.Domain.Utils; + +import java.io.File; +/** + * Created by Administrator on 2018/1/28. + */ +public class FileOptUtils { + + public static Boolean isDirExists(String filename) { + try { + File file = new File(filename); + if (file.exists()) { + if (file.isDirectory()) { + return true; + } else { + return false; + } + } else { + file.mkdir(); + return true; + } + } catch (Exception e) { + return false; + } + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/FilterObject.java b/src/main/java/com/gk/hotwork/Domain/Utils/FilterObject.java new file mode 100644 index 0000000..0edb640 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/FilterObject.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.Domain.Utils; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Map; + +public class FilterObject { + + @NotEmpty + @NotNull + private Integer pageIndex; + @NotNull + @NotEmpty + private Integer pageSize; + + private Map<String, Object> filter; + + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Map<String, Object> getFilter() { + return filter; + } + + public void setFilter(Map<String, Object> filter) { + this.filter = filter; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/HexUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/HexUtil.java new file mode 100644 index 0000000..3380fbb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/HexUtil.java @@ -0,0 +1,88 @@ +package com.gk.hotwork.Domain.Utils; + +import org.apache.commons.lang3.StringUtils; + +public class HexUtil { + /** + * 将十六进制的字符串转换成字节数组 + * + * @param hexString + * @return + */ + public static byte[] hexStrToByteArrs(String hexString) { + if (StringUtils.isEmpty(hexString)) { + return null; + } + + hexString = hexString.replaceAll(" ", ""); + int len = hexString.length(); + int index = 0; + + byte[] bytes = new byte[len / 2]; + + while (index < len) { + String sub = hexString.substring(index, index + 2); + bytes[index / 2] = (byte) Integer.parseInt(sub, 16); + index += 2; + } + + return bytes; + } + + /** + * 数组转换成十六进制字符串 + * @return HexString + */ + public static final String bytesToHexString(byte[] bArray) { + StringBuffer sb = new StringBuffer(bArray.length); + String sTemp; + for (int i = 0; i < bArray.length; i++) { + sTemp = Integer.toHexString(0xFF & bArray[i]); + if (sTemp.length() < 2) + sb.append(0); + sb.append(sTemp.toUpperCase()); + // 在这里故意追加一个逗号便于最后的区分 + sb.append(" "); + } + return sb.toString(); + } + + + /** + * 字节转换为浮点 + * + * @param b 字节(至少4个字节) + * @param index 开始位置 + * @return + */ + public static float byte2float(byte[] b, int index) { + int l; + l = b[index + 0]; + l &= 0xff; + l |= ((long) b[index + 1] << 8); + l &= 0xffff; + l |= ((long) b[index + 2] << 16); + l &= 0xffffff; + l |= ((long) b[index + 3] << 24); + return Float.intBitsToFloat(l); + } + + + /**四个字节的寄存器(十六进制),两两转成十进制,传过来之后返回浮点数**/ + public static float GetFloat(int P1, int P2) + { + int intSign, intSignRest, intExponent, intExponentRest; + float faResult, faDigit; + intSign = P1 / 32768; + intSignRest = P1 % 32768; + intExponent = intSignRest / 128; + intExponentRest = intSignRest % 128; + faDigit = (float)(intExponentRest * 65536 + P2) / 8388608; + faResult = (float)Math.pow(-1, intSign) * (float)Math.pow(2, intExponent - 127) * (faDigit + 1); + return faResult; + } + + + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/HttpUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/HttpUtils.java new file mode 100644 index 0000000..c3d5870 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/HttpUtils.java @@ -0,0 +1,199 @@ +package com.gk.hotwork.Domain.Utils; + +import org.apache.http.Header; +import org.apache.http.HttpStatus; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Map; + +public class HttpUtils { + private static final Logger logger = LogManager.getLogger(HttpUtils.class); + + public static final String DEF_CHATSET = "UTF-8"; + public static final int DEF_CONN_TIMEOUT = 30000; + public static final int DEF_READ_TIMEOUT = 30000; + public static String userAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29"; + /** + * + * @param strUrl 请求地址 + * @param params 请求参数 + * @param method 请求方法 + * @return 网络请求字符串 + * @throws Exception + */ + public static String net(String strUrl, Map params, String method) throws Exception { + HttpURLConnection conn = null; + BufferedReader reader = null; + String rs = null; + try { + StringBuffer sb = new StringBuffer(); + if(method==null || method.equals("GET")){ + strUrl = strUrl+"?"+urlencode(params); + } + URL url = new URL(strUrl); + conn = (HttpURLConnection) url.openConnection(); + if(method==null || method.equals("GET")){ + conn.setRequestMethod("GET"); + }else{ + conn.setRequestMethod("POST"); + conn.setDoOutput(true); + } + conn.setRequestProperty("User-agent", userAgent); + conn.setUseCaches(false); + conn.setConnectTimeout(DEF_CONN_TIMEOUT); + conn.setReadTimeout(DEF_READ_TIMEOUT); + conn.setInstanceFollowRedirects(false); + conn.connect(); + if (params!= null && method.equals("POST")) { + try { + DataOutputStream out = new DataOutputStream(conn.getOutputStream()); + out.writeBytes(urlencode(params)); + } catch (Exception e) { + // TODO: handle exception + } + } + InputStream is = conn.getInputStream(); + reader = new BufferedReader(new InputStreamReader(is, DEF_CHATSET)); + String strRead = null; + while ((strRead = reader.readLine()) != null) { + sb.append(strRead); + } + rs = sb.toString(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (reader != null) { + reader.close(); + } + if (conn != null) { + conn.disconnect(); + } + } + return rs; + } + + //将map型转为请求参数型 + public static String urlencode(Map<String,Object>data) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry i : data.entrySet()) { + try { + sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue()+"","UTF-8")).append("&"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return sb.toString(); + } + + //post json +// public static String sendPost(String url, String data) { +// String response = null; +// try { +// HttpClient httpclient = null; +// HttpResponse httpresponse = null; +// HttpPost httppost = null; +// +// try { +// httpclient = HttpClients.createDefault(); +// httppost = new HttpPost(url); +// StringEntity stringentity = new StringEntity(data, +// ContentType.create("application/json", "UTF-8")); +// httppost.setEntity(stringentity); +// httpresponse = httpclient.execute(httppost); +// response = EntityUtils +// .toString(httpresponse.getEntity()); +// // 检验返回码 +// int statusCode = httpresponse.getStatusLine().getStatusCode(); +// if(statusCode != HttpStatus.SC_OK){ +// logger.error("请求出错: "+statusCode); +// if (statusCode == 307) { +// Header header = httpresponse.getFirstHeader("location"); // 跳转的目标地址是在 HTTP-HEAD上 +// String newuri = header.getValue(); // 这就是跳转后的地址,再向这个地址发出新申请 +// logger.error(newuri); +// +// httppost = new HttpPost(newuri); +// StringEntity newstringentity = new StringEntity(data, +// ContentType.create("application/json", "UTF-8")); +// httppost.setEntity(newstringentity); +// httpresponse = httpclient.execute(httppost); +// response = EntityUtils +// .toString(httpresponse.getEntity()); +// +// logger.error("请求出错: "+httpresponse.getStatusLine().getStatusCode()); +// } +// +// } +// } catch (Exception e){ +// e.printStackTrace(); +// }finally { +// if(httppost != null){ +// try { +// httppost.releaseConnection(); +// Thread.sleep(500); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } +// } +// } catch (Exception e) { +// e.printStackTrace(); +// } +// return response; +// } + + public static String sendPost(String url, String data) { + String resData = null; + try { + RequestConfig config = RequestConfig.custom().setRedirectsEnabled(false).build();//不允许重定向 + CloseableHttpClient client = HttpClients.custom().setDefaultRequestConfig(config).build(); + +// CloseableHttpClient client = HttpClients.createDefault(); + HttpPost post = new HttpPost(url); + post.setHeader("Content-Type", "application/json;charset=UTF-8"); + StringEntity se = new StringEntity(data, "UTF-8"); + se.setContentEncoding("UTF-8"); + se.setContentType("application/json"); + post.setEntity(se); + CloseableHttpResponse response = client.execute(post); + resData = EntityUtils.toString(response.getEntity()); + // 检验返回码 + int statusCode = response.getStatusLine().getStatusCode(); + if(statusCode != HttpStatus.SC_OK){ + logger.error("请求出错: "+statusCode); + if (statusCode == 307) { + Header header = response.getFirstHeader("Location"); // 跳转的目标地址是在 HTTP-HEAD上 + String newuri = header.getValue(); // 这就是跳转后的地址,再向这个地址发出新申请 + logger.error(newuri); + + post = new HttpPost(newuri); + StringEntity newstringentity = new StringEntity(data, + ContentType.create("application/json", "UTF-8")); + post.setEntity(newstringentity); + response = client.execute(post); + resData = EntityUtils.toString(response.getEntity()); + logger.error("请求出错: "+response.getStatusLine().getStatusCode()); + } + } + client.close(); + logger.info(resData); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + return resData; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/IdCardUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/IdCardUtil.java new file mode 100644 index 0000000..261ef95 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/IdCardUtil.java @@ -0,0 +1,171 @@ +package com.gk.hotwork.Domain.Utils; + +import java.util.HashSet; +import java.util.regex.Pattern; + +public class IdCardUtil { + + + /** 大陆地区地域编码最大值 **/ + public static final int MAX_MAINLAND_AREACODE = 659004; + /** 大陆地区地域编码最小值 **/ + public static final int MIN_MAINLAND_AREACODE = 110000; + /** 香港地域编码值 **/ + public static final int HONGKONG_AREACODE = 810000; // 香港地域编码值 + /** 台湾地域编码值 **/ + public static final int TAIWAN_AREACODE = 710000; + /** 澳门地域编码值 **/ + public static final int MACAO_AREACODE = 820000; + + /** 数字正则 **/ + public static final String regexNum = "^[0-9]*$"; + /** 闰年生日正则 **/ + public static final String regexBirthdayInLeapYear = "^((19[0-9]{2})|(200[0-9])|(201[0-5]))((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))$"; + /** 平年生日正则 **/ + public static final String regexBirthdayInCommonYear = "^((19[0-9]{2})|(200[0-9])|(201[0-5]))((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))$"; + + private static final HashSet<String> BLACK_SET = new HashSet<String>() { + + private static final long serialVersionUID = 48136604486603324L; + { + add("111111111111111"); + } + }; + + /** + * <p> + * 身份证格式强校验 + * </p> + * <p> + * 1、号码的结构 公民身份号码是特征组合码,由十七位数字本体码和一位校验码组成。排列顺序从左至右依次为:六位数字地址码, + * 八位数字出生日期码,三位数字顺序码和一位数字校验码。 + * </p> + * <p> + * 2、地址码(前六位数)表示编码对象常住户口所在县(市、旗、区)的行政区划代码,按GB/T2260的规定执行。 + * </p> + * <p> + * 3、出生日期码(第七位至十四位)表示编码对象出生的年、月、日,按GB/T7408的规定执行,年、月、日代码之间不用分隔符。 + * </p> + * <p> + * 4、顺序码(第十五位至十七位)表示在同一地址码所标识的区域范围内,对同年、同月、同日出生的人编定的顺序号, 顺序码的奇数分配给男性,偶数分配给女性。 + * </p> + * <p> + * 5、校验码(第十八位数) + * (1)十七位数字本体码加权求和公式 S = Sum(Ai * Wi), i = 0, ... , 16 ,先对前17位数字的权求和 + * Ai:表示第i位置上的身份证号码数字值 Wi:表示第i位置上的加权因子 Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 + * 2 (2)计算模 Y = mod(S, 11) (3)通过模得到对应的校验码 Y: 0 1 2 3 4 5 6 7 8 9 10 校验码: 1 0 + * X 9 8 7 6 5 4 3 2 + * </p> + */ + public static final boolean strongVerifyIdNumber(String idNumber) { + if (StringUtils.isEmpty(idNumber)) { + return false; + } + idNumber = idNumber.trim(); + + if (BLACK_SET.contains(idNumber)) { + return false; + } + if (!checkIdNumberRegex(idNumber)) { + return false; + } + if (!checkIdNumberArea(idNumber.substring(0, 6))) { + return false; + } + idNumber = convertFifteenToEighteen(idNumber); + if (!checkBirthday(idNumber.substring(6, 14))) { + return false; + } + if (!checkIdNumberVerifyCode(idNumber)) { + return false; + } + return true; + } + + /** + * 身份证正则校验 + */ + private static boolean checkIdNumberRegex(String idNumber) { + return Pattern.matches("^([0-9]{17}[0-9Xx])|([0-9]{15})$", idNumber); + } + + /** + * 身份证地区码检查 + */ + private static boolean checkIdNumberArea(String idNumberArea) { + int areaCode = Integer.parseInt(idNumberArea); + if (areaCode == HONGKONG_AREACODE || areaCode == MACAO_AREACODE || areaCode == TAIWAN_AREACODE) { + return true; + } + if (areaCode <= MAX_MAINLAND_AREACODE && areaCode >= MIN_MAINLAND_AREACODE) { + return true; + } + return false; + } + + /** + * 将15位身份证转换为18位 + */ + private static String convertFifteenToEighteen(String idNumber) { + if (15 != idNumber.length()) { + return idNumber; + } + idNumber = idNumber.substring(0, 6) + "19" + idNumber.substring(6, 15); + idNumber = idNumber + getVerifyCode(idNumber); + return idNumber; + } + + /** + * 根据身份证前17位计算身份证校验码 + */ + private static String getVerifyCode(String idNumber) { + if (!Pattern.matches(regexNum, idNumber.substring(0, 17))) { + return null; + } + String[] ValCodeArr = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" }; + String[] Wi = { "7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2" }; + + int sum = 0; + for (int i = 0; i < 17; i++) { + sum = sum + Integer.parseInt(String.valueOf(idNumber.charAt(i))) * Integer.parseInt(Wi[i]); + } + return ValCodeArr[sum % 11]; + } + + /** + * 身份证出生日期嘛检查 + */ + private static boolean checkBirthday(String idNumberBirthdayStr) { + Integer year = null; + try { + year = Integer.valueOf(idNumberBirthdayStr.substring(0, 4)); + } catch (Exception e) { + } + if (null == year) { + return false; + } + if (isLeapYear(year)) { + return Pattern.matches(regexBirthdayInLeapYear, idNumberBirthdayStr); + } else { + return Pattern.matches(regexBirthdayInCommonYear, idNumberBirthdayStr); + } + } + + /** + * 判断是否为闰年 + */ + private static boolean isLeapYear(int year) { + return (year % 400 == 0) || (year % 100 != 0 && year % 4 == 0); + } + + /** + * 身份证校验码检查 + */ + private static boolean checkIdNumberVerifyCode(String idNumber) { + return getVerifyCode(idNumber).equalsIgnoreCase(idNumber.substring(17)); + } + + + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/JacksonObjectMapper.java b/src/main/java/com/gk/hotwork/Domain/Utils/JacksonObjectMapper.java new file mode 100644 index 0000000..900a54c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/JacksonObjectMapper.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Domain.Utils; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.TimeZone; + +/** + * 解决Jackson 差8小时的问题 + * + */ +//@Component("jacksonObjectMapper") +public class JacksonObjectMapper extends ObjectMapper { + + private static final long serialVersionUID = 4288193147502386170L; + + private static final Locale CHINA = Locale.CHINA; + + public JacksonObjectMapper() { + this.setLocale(CHINA); + this.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", CHINA)); + this.setTimeZone(TimeZone.getTimeZone("GMT+8")); + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/JaxbUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/JaxbUtils.java new file mode 100644 index 0000000..cf8ec24 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/JaxbUtils.java @@ -0,0 +1,92 @@ +package com.gk.hotwork.Domain.Utils; + +import javax.xml.bind.*; +import javax.xml.transform.stream.StreamSource; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Created by Administrator on 2017/11/29. + */ +public class JaxbUtils <T>{ + public static String JaxbObj2Xml (Object object,Boolean withhead){ + String xmlString=""; + try { + StringWriter sw = new StringWriter(); + Marshaller jaxbMarshaller = null; + try { + JAXBContext jaxbContext = getContext(object.getClass()); + jaxbMarshaller = jaxbContext.createMarshaller(); + } catch (JAXBException e) { + e.printStackTrace(); + } + + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false); // 格式化输出 + jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");// 编码格式,默认为utf-8 + jaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);// 是否省略xml头信息 + + jaxbMarshaller.marshal(object, sw); + xmlString=sw.toString(); + if(withhead) + { + xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + xmlString; + } + } catch (JAXBException e) { + e.printStackTrace(); + } + return xmlString; + } + + public static <T> T JaxbXml2Obj(String xmlstr, Class<T> classz) throws JAXBException { + T req; + try { + JAXBContext context = JAXBContext.newInstance(classz); + Unmarshaller shaller = context.createUnmarshaller(); + + req = (T) shaller.unmarshal(new StringReader(xmlstr)); + } catch (JAXBException e) { + throw e; + } + return req; + } + + public static Map<Class<?>,JAXBContext> contextMap = new ConcurrentHashMap<Class<?>,JAXBContext>(); + + public static String convertToXml(Object obj) throws JAXBException{ + Class<?> clazz; + if (obj instanceof JAXBElement){ + clazz = ((JAXBElement<?>)obj).getDeclaredType(); + }else { + clazz = obj.getClass(); + } + StringWriter sw = new StringWriter(); + getContext(clazz).createMarshaller().marshal(obj,sw); + return sw.toString(); + } + + public static <T> T convertToJavaBean(String xml,Class<T>clazz)throws JAXBException{ + StringReader reader = new StringReader(xml); + return getContext(clazz).createUnmarshaller().unmarshal(new StreamSource(reader),clazz).getValue(); + } + + private static JAXBContext getContext(Class<?>clazz) throws JAXBException{ + JAXBContext context = contextMap.get(clazz); + if (null == context){ + context = JAXBContext.newInstance(clazz); + contextMap.put(clazz,context); + } + return context; + } + + + + + + + + + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/JsonUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/JsonUtils.java new file mode 100644 index 0000000..a1d583f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/JsonUtils.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.Domain.Utils; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; + + +public final class JsonUtils { + private JsonUtils() {} + + /** + * 将对象序列化成json字符串 + * @param object javaBean + * @return jsonString json字符串 + */ + public static String toJson(Object object) { + try { + return getInstance().writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + /** + * 将json反序列化成对象 + * @param jsonString jsonString + * @param valueType class + * @param <T> T 泛型标记 + * @return Bean + */ + public static <T> T parse(String jsonString, Class<T> valueType) { + try { + return getInstance().readValue(jsonString, valueType); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static ObjectMapper getInstance() { + return JacksonHolder.INSTANCE; + } + + private static class JacksonHolder { + private static ObjectMapper INSTANCE = new JacksonObjectMapper(); + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/LocationUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/LocationUtils.java new file mode 100644 index 0000000..3d9fefd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/LocationUtils.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.Domain.Utils; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import org.springframework.beans.factory.annotation.Value; + +import java.util.Map; + +/** + * @author : jingjy + * @date : 2021/12/7 11:07 + */ +public class LocationUtils { + + public static Msg net(Map<String, String> params, String url) throws Exception { + String response; + response = HttpUtils.net(url, params, "POST"); + if (StringUtils.isBlank(response)){ + return new Msg(ErrorCode.ERROR_60002); + } + JSONObject jsonResult = JSONObject.parseObject(response); + String status = jsonResult.getString("status"); + String msgInfo = jsonResult.getString("msginfo"); + + if (status.equals("1")){ + return new Msg(ErrorCode.ERROR_60002,msgInfo); + } + + String data = jsonResult.getString("data"); + + return new Msg("200","success",data); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/MD5Utils.java b/src/main/java/com/gk/hotwork/Domain/Utils/MD5Utils.java new file mode 100644 index 0000000..f7d2536 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/MD5Utils.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.Domain.Utils; + +import com.gk.hotwork.Domain.Exception.BusinessException; +import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.Logger; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.security.MessageDigest; + +public class MD5Utils { + + private static Logger logger = Logger.getLogger(MD5Utils.class); + private static final char[] HEX = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', + 'f' }; + private static final String MD5 = "MD5"; + private static final Charset CHARSET = Charset.forName("UTF-8"); + + public static char[] HexEncode(byte[] bytes) { + final int nBytes = bytes.length; + char[] result = new char[2 * nBytes]; + + int j = 0; + for (int i = 0; i < nBytes; i++) { + result[j++] = HEX[(0xF0 & bytes[i]) >>> 4]; + result[j++] = HEX[(0x0F & bytes[i])]; + } + + return result; + } + + public static byte[] Utf8Encode(CharSequence string) { + try { + ByteBuffer bytes = CHARSET.newEncoder().encode(CharBuffer.wrap(string)); + byte[] bytesCopy = new byte[bytes.limit()]; + System.arraycopy(bytes.array(), 0, bytesCopy, 0, bytes.limit()); + + return bytesCopy; + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new BusinessException("字符转码失败。"); + } + } + + public static String encode(String data) { + try { + if (StringUtils.isEmpty(data)) { + data = ""; + } + MessageDigest messageDigest = MessageDigest.getInstance(MD5); + byte[] digest = messageDigest.digest(Utf8Encode(data)); + return new String(HexEncode(digest)); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new BusinessException("字符转码失败。"); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/MatrixToImageWriter.java b/src/main/java/com/gk/hotwork/Domain/Utils/MatrixToImageWriter.java new file mode 100644 index 0000000..83aa6d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/MatrixToImageWriter.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.Domain.Utils; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.common.BitMatrix; +import sun.misc.BASE64Encoder; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Hashtable; + +public class MatrixToImageWriter { + private static final int BLACK = 0xFF000000; + private static final int WHITE = 0xFFFFFFFF; + + private MatrixToImageWriter() { + } + + private static BufferedImage toBufferedImage(BitMatrix matrix) { + int width = matrix.getWidth(); + int height = matrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE); + } + } + return image; + } + private static void writeToFile(BitMatrix matrix, String format, File file) + throws IOException { + BufferedImage image = toBufferedImage(matrix); + if (!ImageIO.write(image, format, file)) { + throw new IOException("Could not write an image of format " + + format + " to " + file); + } + } + private static void writeToStream(BitMatrix matrix, String format, + OutputStream stream) throws IOException { + BufferedImage image = toBufferedImage(matrix); + if (!ImageIO.write(image, format, stream)) { + throw new IOException("Could not write an image of format " + format); + } + } + + public static String getBase64Img(String text) throws IOException, WriterException { + // 二维码图片宽度 + int width = 40; + // 二维码图片高度 + int height = 40; + // 二维码的图片格式 + String format = "jpg"; + Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>(); + // 内容所使用字符集编码 + hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); + + BitMatrix bitMatrix = new MultiFormatWriter().encode(text, + BarcodeFormat.CODE_128, width, height, hints); + /*BitMatrix bitMatrix = new MultiFormatWriter().encode(text, + BarcodeFormat.QR_CODE, width, height, hints);*/ + // 生成二维码 + File outputFile = new File("d:" + File.separator + "new.jpg"); + MatrixToImageWriter.writeToFile(bitMatrix, format, outputFile); + + ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream(); + MatrixToImageWriter.writeToStream(bitMatrix, "PNG", pngOutputStream); + byte[] pngData = pngOutputStream.toByteArray(); + BASE64Encoder encoder = new BASE64Encoder(); + String png_base64 = encoder.encodeBuffer(pngData).trim(); + png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", ""); + return png_base64; + } +} + + diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Message.java b/src/main/java/com/gk/hotwork/Domain/Utils/Message.java new file mode 100644 index 0000000..be71c9f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Message.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.Domain.Utils; + +import com.gk.hotwork.Domain.Enum.MsgType; + +public class Message { + + private String type; + + private String message; + + + public Message(MsgType type) { + this.type = type.getCode(); + } + + + public String getType() { + return type; + } + + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Msg.java b/src/main/java/com/gk/hotwork/Domain/Utils/Msg.java new file mode 100644 index 0000000..e27e3f0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Msg.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Domain.Utils; + +import com.gk.hotwork.Domain.Enum.ErrorCode; + +public class Msg { + private String code; + + private String message; + + private Object result; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Object getResult() { + return result; + } + + public void setResult(Object result) { + this.result = result; + } + + public Msg() { + } + + public Msg(String code, String message) { + this.code = code; + this.message = message; + } + + public Msg(boolean init){ + if (init){ + this.code = ErrorCode.SUCCESS.getCode(); + this.message = ErrorCode.SUCCESS.getMsg(); + }else { + this.code = ErrorCode.ERROR_999.getCode(); + this.message = ErrorCode.ERROR_999.getMsg(); + } + } + + public Msg(ErrorCode errorCode){ + this.setCode(errorCode.getCode()); + this.setMessage(errorCode.getMsg()); + } + + public Msg(ErrorCode errorCode,String msg){ + this.setCode(errorCode.getCode()); + this.setMessage(errorCode.getMsg()+":"+msg); + } + + public Msg(String code, String message, Object result) { + this.code = code; + this.message = message; + this.result = result; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/PageInfo.java b/src/main/java/com/gk/hotwork/Domain/Utils/PageInfo.java new file mode 100644 index 0000000..fda0833 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/PageInfo.java @@ -0,0 +1,143 @@ +package com.gk.hotwork.Domain.Utils; + +import java.util.List; +import java.util.Map; + +public class PageInfo { + private final static int PAGESIZE = 10; //默认显示的记录数 + + private List result; + + private Long totalCount; + + private Integer pageSize; + + private Integer pageIndex; + + private String sort; + + private String order; + + private int from; + + private int size; + + private Map<String, Object> condition; //查询条件 + + public PageInfo() {} + + //构造方法 + public PageInfo(int pageIndex, int pageSize) { + //计算当前页 + if (pageIndex < 0) { + this.pageIndex = 1; + } else { + //当前页 + this.pageIndex = pageIndex; + } + //记录每页显示的记录数 + if (pageSize < 0) { + this.pageSize = PAGESIZE; + } else { + this.pageSize = pageSize; + } + //计算开始的记录和结束的记录 + this.from = (this.pageIndex - 1) * this.pageSize; + this.size = this.pageSize; + } + + // 构造方法 + public PageInfo(int pageIndex, int pageSize, String sort, String order) { + // 计算当前页 + if (pageIndex < 0) { + this.pageIndex = 1; + } else { + // 当前页 + this.pageIndex = pageIndex; + } + // 记录每页显示的记录数 + if (pageSize < 0) { + this.pageSize = PAGESIZE; + } else { + this.pageSize = pageSize; + } + // 计算开始的记录和结束的记录 + this.from = (this.pageIndex - 1) * this.pageSize; + this.size = this.pageSize; + // 排序字段,正序还是反序 + this.sort = sort; + this.order = order; + } + + public List getResult() { + return result; + } + + public void setResult(List result) { + this.result = result; + } + + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getOrder() { + return order; + } + + public void setOrder(String order) { + this.order = order; + } + + public int getFrom() { + return from; + } + + public void setFrom(int from) { + this.from = from; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public Map<String, Object> getCondition() { + return condition; + } + + public void setCondition(Map<String, Object> condition) { + this.condition = condition; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/PageUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/PageUtil.java new file mode 100644 index 0000000..8182ebe --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/PageUtil.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.Domain.Utils; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 10:13 + */ +public class PageUtil { + + /** + * @param pageInfo:分页信息 + * @param column:默认排序列 + * @return Page<T> + */ + public static <T> Page<T> getPage(PageInfo pageInfo, String column) { + Page<T> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc("ascending".equalsIgnoreCase(pageInfo.getOrder())); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn(column); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + return page; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/PageUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/PageUtils.java new file mode 100644 index 0000000..9848501 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/PageUtils.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.Domain.Utils; + + +import com.gk.hotwork.Domain.Vo.PageQuery; + +public class PageUtils { + + + /** + * @Description: 校验pageIndex pageSize 并设置值 + * @date 2022/6/29 11:05 + */ + public static void checkCheck(PageQuery page) { + + if (page.getPageIndex() == null || page.getPageIndex() < 1L) { + page.setPageIndex(1L); + } + + if (page.getPageSize() == null || page.getPageSize() < 1L) { + page.setPageSize(10L); + } + + // pageSize 不能大于500 + if (page.getPageSize() > 500L) { + page.setPageSize(500L); + } + + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Properties.java b/src/main/java/com/gk/hotwork/Domain/Utils/Properties.java new file mode 100644 index 0000000..1fcb0d1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Properties.java @@ -0,0 +1,200 @@ +package com.gk.hotwork.Domain.Utils; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class Properties { + + + /** + * @Description: 企业信息的文件路径 + * @date 2021/4/2 14:14 + */ + public static String enterprisePath; + + public static String enterprise; + /** + * @Description: 运输证文件路径 + * @date 2021/4/2 14:14 + */ + public static String transportCertificatePath; + + public static String transportCertificate; + + /** + * @Description: 自检报告中 重大隐患文件存储路径 + * @date 2021/4/8 16:12 + */ + public static String hiddenDangerPath; + + public static String hiddenDanger; + + /** + * @Description: 导入的文件路径 + * @date 2021/4/19 9:20 + */ + public static String filePath; + + /** + * @Description: 安全生产标准化路径 + * @date 2021/4/30 9:22 + */ + public static String standardPath; + + public static String standard; + + /** + * @Description: 合同申请的路径 + * @date 2021/5/10 9:27 + */ + public static String contractPath; + + public static String contract; + + /** + * @Description: + * @date 2021/7/5 13:46 + */ + public static String assessApplyPath; + + public static String assessApply; + + public static String workCertPath; + + public static String workCert; + + + public String getEnterprisePath() { + return enterprisePath; + } + + @Value("${enterprisePath}") + public void setEnterprisePath(String enterprisePath) { + Properties.enterprisePath = enterprisePath; + } + + + public String getEnterprise() { + return enterprise; + } + + @Value("${enterprise}") + public void setEnterprise(String enterprise) { + Properties.enterprise = enterprise; + } + + + public String getTransportCertificatePath() { + return transportCertificatePath; + } + + @Value("${transportCertificatePath}") + public void setTransportCertificatePath(String transportCertificatePath) { + Properties.transportCertificatePath = transportCertificatePath; + } + + public String getTransportCertificate() { + return transportCertificate; + } + + @Value("${transportCertificate}") + public void setTransportCertificate(String transportCertificate) { + Properties.transportCertificate = transportCertificate; + } + + public String getHiddenDangerPath() { + return hiddenDangerPath; + } + @Value("${hiddenDangerPath}") + public void setHiddenDangerPath(String hiddenDangerPath) { + Properties.hiddenDangerPath = hiddenDangerPath; + } + + public String getHiddenDanger() { + return hiddenDanger; + } + + @Value("${hiddenDanger}") + public void setHiddenDanger(String hiddenDanger) { + Properties.hiddenDanger = hiddenDanger; + } + + public String getFilePath() { + return filePath; + } + @Value("${filePath}") + public void setFilePath(String filePath) { + Properties.filePath = filePath; + } + + public String getStandardPath() { + return standardPath; + } + + @Value("${standardPath}") + public void setStandardPath(String standardPath) { + Properties.standardPath = standardPath; + } + + public String getStandard() { + return standard; + } + + @Value("${standard}") + public void setStandard(String standard) { + Properties.standard = standard; + } + + public String getContractPath() { + return contractPath; + } + @Value("${contractPath}") + public void setContractPath(String contractPath) { + Properties.contractPath = contractPath; + } + + public String getContract() { + return contract; + } + + @Value("${contract}") + public void setContract(String contract) { + Properties.contract = contract; + } + + public String getAssessApplyPath() { + return assessApplyPath; + } + + @Value("${assessApplyPath}") + public void setAssessApplyPath(String assessApplyPath) { + Properties.assessApplyPath = assessApplyPath; + } + + public String getAssessApply() { + return assessApply; + } + + @Value("${assessApply}") + public void setAssessApply(String assessApply) { + Properties.assessApply = assessApply; + } + + public String getWorkCertPath() { + return workCertPath; + } + + @Value("${workCertPath}") + public void setWorkCertPath(String workCertPath) { + Properties.workCertPath = workCertPath; + } + + public String getWorkCert(){ return workCert;} + + @Value("workCert") + public void setWorkCert(String workCert) { + Properties.workCert = workCert; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/QRCode.java b/src/main/java/com/gk/hotwork/Domain/Utils/QRCode.java new file mode 100644 index 0000000..f59b35b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/QRCode.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Domain.Utils; + +import com.spire.barcode.*; + +import java.awt.*; + +class QRCode { + + /** + * @Description: 生成二维码 + * @date 2021/5/13 8:48 + */ + public static Image generateQRCode(String info) + { + BarcodeSettings settings = new BarcodeSettings(); + settings.setType(BarCodeType.QR_Code); + settings.setData(info); + settings.setData2D(info); + settings.setLeftMargin(0); + settings.setRightMargin(0); + settings.setTopMargin(0); + settings.setBottomMargin(0); + settings.setShowText(false); + settings.setQRCodeECL(QRCodeECL.Q); + settings.setQRCodeDataMode(QRCodeDataMode.Numeric); + BarCodeGenerator generator = new BarCodeGenerator(settings); + return generator.generateImage(); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/RPCUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/RPCUtils.java new file mode 100644 index 0000000..c60e53b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/RPCUtils.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.Domain.Utils; + +import java.util.ArrayList; +import java.util.List; + +public class RPCUtils { + /** + * @Description: 检查是否正常返回 + */ + + public static <T> List<T> castList(Object obj, Class<T> clazz) + { + List<T> result = new ArrayList<T>(); + if(obj instanceof List<?>) + { + for (Object o : (List<?>) obj) + { + result.add(clazz.cast(o)); + } + + } + return result; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Result.java b/src/main/java/com/gk/hotwork/Domain/Utils/Result.java new file mode 100644 index 0000000..b05d8b3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Result.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.Domain.Utils; + +import java.io.Serializable; + +/** + * @description:操作结果集 + * @author:zhixuan.wang + * @date:2015/10/1 14:51 + */ +public class Result implements Serializable { + + public static final int SUCCESS = 1; + public static final int FAILURE = -1; + + private static final long serialVersionUID = 5576237395711742681L; + + private boolean success = false; + + private String msg = ""; + + private Object obj = null; + + private String data = ""; + + private String sub = ""; + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getObj() { + return obj; + } + + public void setObj(Object obj) { + this.obj = obj; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public String getSub() { + return sub; + } + + public void setSub(String sub) { + this.sub = sub; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/SignUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/SignUtils.java new file mode 100644 index 0000000..95c097d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/SignUtils.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.Domain.Utils; + +import java.util.Map; +import java.util.Random; +import java.util.TreeMap; + +import static com.gk.hotwork.Domain.Utils.StringUtils.MD5Encoder; + + +public class SignUtils { + + public static String getTimestamp() { + //生成时间戳 + + long timestampLong =System.currentTimeMillis(); + + String timestampStr = String.valueOf(timestampLong); + + return timestampStr; + } + + public static String getNonceStr(int length){ + + //生成随机字符串 + + String str="zxcvbnmlkjhgfdsaqwertyuiopQWERTYUIOPASDFGHJKLZXCVBNM1234567890"; + + Random random=new Random(); + + StringBuffer randomStr=new StringBuffer(); + + // 设置生成字符串的长度,用于循环 + + for(int i=0; i<length; ++i){ + //从62个的数字或字母中选择 + + int number=random.nextInt(62); + + //将产生的数字通过length次承载到sb中 + + randomStr.append(str.charAt(number)); + } + + //将承载的字符转换成字符串 + + return randomStr.toString(); + } + + //类似微信接口的签名生成方法 + public static String createSign(Map<String, String> params, String privateKey){ + StringBuilder sb = new StringBuilder(); + // 将参数以参数名的字典升序排序 + Map<String, String> sortParams = new TreeMap<String, String>(params); + // 遍历排序的字典,并拼接"key=value"格式 + for (Map.Entry<String, String> entry : sortParams.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue().trim(); + if (!StringUtils.isEmpty(value)) + sb.append("&").append(key).append("=").append(value); + } + String stringA = sb.toString().replaceFirst("&",""); + String stringSignTemp = stringA + "&"+"appkey="+privateKey; + //将签名使用MD5加密并全部字母变为大写 + String signValue = MD5Encoder(stringSignTemp,"utf-8").toUpperCase(); + System.out.println("stringA+privateKey后MD5加密+转换全部大写生成sign为: "+signValue); + return signValue; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/SpringBeanUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/SpringBeanUtil.java new file mode 100644 index 0000000..d3fb783 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/SpringBeanUtil.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.Domain.Utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +@Component +public class SpringBeanUtil implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + SpringBeanUtil.applicationContext = applicationContext; + } + + + /** + * 获取applicationContext + * + * @return + */ + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * 通过name获取 Bean. + * + * @param name + * @return + */ + + public static Object getBean(String name) { + return getApplicationContext().getBean(name); + } + + /** + * 通过class获取Bean. + * + * @param clazz + * @param <T> + * @return + */ + + public static <T> T getBean(Class<T> clazz) { + return getApplicationContext().getBean(clazz); + } + + + /** + * 通过name,以及Clazz返回指定的Bean + * + * @param name + * @param clazz + * @param <T> + * @return + */ + public static <T> T getBean(String name, Class<T> clazz) { + return getApplicationContext().getBean(name, clazz); + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/StringUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/StringUtils.java new file mode 100644 index 0000000..99c5d05 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/StringUtils.java @@ -0,0 +1,219 @@ +package com.gk.hotwork.Domain.Utils; + +import sun.misc.BASE64Encoder; + +import java.math.BigInteger; +import java.nio.charset.Charset; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 继承自Spring util的工具类,减少jar依赖 + * @author L.cm + */ +public class StringUtils extends org.springframework.util.StringUtils { + /** + * Check whether the given {@code CharSequence} contains actual <em>text</em>. + * <p>More specifically, this method returns {@code true} if the + * {@code CharSequence} is not {@code null}, its length is greater than + * 0, and it contains at least one non-whitespace character. + * <p><pre class="code"> + * StringUtils.isBlank(null) = true + * StringUtils.isBlank("") = true + * StringUtils.isBlank(" ") = true + * StringUtils.isBlank("12345") = false + * StringUtils.isBlank(" 12345 ") = false + * </pre> + * @param str the {@code CharSequence} to check (may be {@code null}) + * @return {@code true} if the {@code CharSequence} is not {@code null}, + * its length is greater than 0, and it does not contain whitespace only + * @see Character#isWhitespace + */ + public static boolean isBlank(final CharSequence cs) { + return !StringUtils.isNotBlank(cs); + } + + /** + * <p>Checks if a CharSequence is not empty (""), not null and not whitespace only.</p> + * + * <pre> + * StringUtils.isNotBlank(null) = false + * StringUtils.isNotBlank("") = false + * StringUtils.isNotBlank(" ") = false + * StringUtils.isNotBlank("bob") = true + * StringUtils.isNotBlank(" bob ") = true + * </pre> + * + * @param cs the CharSequence to check, may be null + * @return {@code true} if the CharSequence is + * not empty and not null and not whitespace + * @see Character#isWhitespace + */ + public static boolean isNotBlank(final CharSequence cs) { + return StringUtils.hasText(cs); + } + + /** + * Convert a {@code Collection} into a delimited {@code String} (e.g. CSV). + * <p>Useful for {@code toString()} implementations. + * @param coll the {@code Collection} to convert + * @param delim the delimiter to use (typically a ",") + * @return the delimited {@code String} + */ + public static String join(Collection<?> coll, String delim) { + return StringUtils.collectionToDelimitedString(coll, delim); + } + + /** + * Convert a {@code String} array into a delimited {@code String} (e.g. CSV). + * <p>Useful for {@code toString()} implementations. + * @param arr the array to display + * @param delim the delimiter to use (typically a ",") + * @return the delimited {@code String} + */ + public static String join(Object[] arr, String delim) { + return StringUtils.arrayToDelimitedString(arr, delim); + } + + public static List<String> toList(String id) { + List<String> list = new ArrayList<String>(); + String[] str = id.split(","); + for (int i = 0; i < str.length; i++) { + list.add(str[i]); + } + return list; + } + + public static String todbstr(String str) { + return "'"+ str +"'"; + } + + public static String MD5Encoder(String s,String charset){ + try{ + byte[] btInput = s.getBytes(charset); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + + byte[] md = mdInst.digest(); + StringBuffer sb = new StringBuffer(); + for(int i =0 ;i<md.length;i++) + { + int val = ((int)md[i]) & 0xff; + if(val<16){ + sb.append("0"); + } + sb.append(Integer.toHexString(val)); + } + return sb.toString(); + } + catch (Exception e) + { + return null; + } + } + + public static String getMD5(String str) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + return ""; + } + } + + public static String MD5OpenApiEncoder(String s,String charset){ + try{ + byte[] btInput = s.getBytes(charset); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + + byte[] md = mdInst.digest(); + StringBuffer sb = new StringBuffer(); + for(int i =0 ;i<md.length;i++) + { + int val = ((int)md[i]) & 0xff; + if(val<16){ + sb.append("0"); + } + sb.append(Integer.toHexString(val)); + } + return sb.toString(); + } + catch (Exception e) + { + return null; + } + } + + public static String md5(String message) { + try { + MessageDigest md; + + md = MessageDigest.getInstance("md5"); + byte m5[] = md.digest(message.getBytes()); + BASE64Encoder encoder = new BASE64Encoder(); + return encoder.encode(m5); + } catch (Exception e) { + // TODO Auto-generated catch block + return ""; + } + } + + public static Boolean isSame(String str1,String str2) + { + + if(StringUtils.isNotBlank(str1) && StringUtils.isBlank(str2)) + { + return false; + } + else if(StringUtils.isBlank(str1) && StringUtils.isNotBlank(str2)) + { + return false; + } + else if(StringUtils.isBlank(str1) && StringUtils.isBlank(str2)) + { + return true; + } + else { + if(!str1.equals(str2)) { + return false; + } + else { + return true; + } + } + } + + public static boolean isContainChinese(String str){ + + if (StringUtils.isBlank(str)) { + return false; + } + Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]"); + Matcher m = p.matcher(str); + if (m.find()) { + return true; + } + return false; + } + + public static String ytoMd5(String sourceStr) { + String result = ""; + try { + MessageDigest md5 = MessageDigest.getInstance("MD5"); + byte[] bytes = md5.digest((sourceStr).getBytes(Charset.forName("utf-8"))); + result = new String(org.apache.commons.codec.binary.Base64.encodeBase64(bytes),"utf-8"); + + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/Tree.java b/src/main/java/com/gk/hotwork/Domain/Utils/Tree.java new file mode 100644 index 0000000..41de034 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/Tree.java @@ -0,0 +1,104 @@ +package com.gk.hotwork.Domain.Utils; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.util.List; + +public class Tree implements java.io.Serializable { + + private static final long serialVersionUID = 980682543891282923L; + private Long id; + private String text; + // open,closed + private String state = "open"; + private boolean checked = false; + private Object attributes; + + /** null不输出 **/ + @JsonInclude(Include.NON_NULL) + private List<Tree> children; + private String iconCls; + private Long pid; + /** + * ajax,iframe, + */ + private String openMode; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public void setState(Byte opened) { + this.state = (null != opened && opened == 1) ? "open" : "closed"; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public Object getAttributes() { + return attributes; + } + + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + public List<Tree> getChildren() { + return children; + } + + public void setChildren(List<Tree> children) { + this.children = children; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public Long getPid() { + return pid; + } + + public void setPid(Long pid) { + this.pid = pid; + } + + public String getOpenMode() { + return openMode; + } + + public void setOpenMode(String openMode) { + this.openMode = openMode; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/UploadUtil.java b/src/main/java/com/gk/hotwork/Domain/Utils/UploadUtil.java new file mode 100644 index 0000000..e3bd240 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/UploadUtil.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Domain.Utils; + +import org.springframework.web.multipart.MultipartFile; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class UploadUtil { + + public static String uploadFile(MultipartFile file,String filePath) throws Exception { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String oldName = file.getOriginalFilename(); + if (StringUtils.isBlank(oldName)) { + return "null"; + } + String newName = sdf.format(new Date()) + oldName.substring(oldName.lastIndexOf(".")); + File dest = new File(filePath, newName); + String url = newName; + if (!dest.getParentFile().exists()) { + boolean rel = dest.getParentFile().mkdirs(); + if (!rel) { + throw new Exception("文件夹创建失败"); + } + } + InputStream is = file.getInputStream(); + OutputStream os = new FileOutputStream(dest); + try { + byte[] buffer = new byte[8 * 1024]; + int bytesRead; + while ((bytesRead = is.read(buffer)) != -1) { + os.write(buffer, 0, bytesRead); + } + } catch (Exception e) { + throw e; + } finally { + if (is != null) { + is.close(); + } + if (os != null) { + os.close(); + } + } + + return url; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/WebSocketClientManager.java b/src/main/java/com/gk/hotwork/Domain/Utils/WebSocketClientManager.java new file mode 100644 index 0000000..e23d596 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/WebSocketClientManager.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.Domain.Utils; + +import java.net.URI; + +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.drafts.Draft; +import org.java_websocket.handshake.ServerHandshake; + +public class WebSocketClientManager extends WebSocketClient { + private String msg; + + public WebSocketClientManager(URI serverUri, Draft draft) { + super(serverUri, draft); + } + + @Override + public void onOpen(ServerHandshake serverHandshake) { +// //获取打印机列表 +// String getPrinterListCmd = "{\"requestID\":\"984641221345311287\",\"verson\":\"1.0\",\"cmd\":\"getPrinters\"}"; +// webSocket.send(getPrinterListCmd); +// +// //发送打印任务 +// String printCmd = "打印任务报文,内容过长此处不粘贴"; +// webSocket.send(printCmd); +// System.out.println("websocket已连接"); + } + + //WebSocket回调函数 + @Override + public void onMessage(String message) { +// //TODO 对打印服务返回的数据进行处理 +// System.out.println(message); + setMsg(message); + } + + @Override + public void onClose(int i, String s, boolean b) { + + } + + @Override + public void onError(Exception e) { + + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/WebUtils.java b/src/main/java/com/gk/hotwork/Domain/Utils/WebUtils.java new file mode 100644 index 0000000..12a425a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/WebUtils.java @@ -0,0 +1,197 @@ +package com.gk.hotwork.Domain.Utils; + +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.method.HandlerMethod; + +import javax.net.ssl.*; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.security.SecureRandom; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.Iterator; +import java.util.Map; + +/** + * Miscellaneous utilities for web applications. + * @author L.cm + */ +public class WebUtils extends org.springframework.web.util.WebUtils { + /** + * 判断是否ajax请求 + * spring ajax 返回含有 ResponseBody 或者 RestController注解 + * @param handlerMethod HandlerMethod + * @return 是否ajax请求 + */ + + private static final String DEFAULT_CHARSET = "UTF-8"; + private static boolean ignoreSSLCheck = true; + private static boolean ignoreHostCheck = true; + + public static boolean isAjax(HandlerMethod handlerMethod) { + ResponseBody responseBody = handlerMethod.getMethodAnnotation(ResponseBody.class); + if (null != responseBody) { + return true; + } + RestController restAnnotation = handlerMethod.getBean().getClass().getAnnotation(RestController.class); + if (null != restAnnotation) { + return true; + } + return false; + } + + private static HttpURLConnection getConnection(URL url, String method, String ctype, Map<String, String> headerMap) throws IOException { + Object conn = (HttpURLConnection)url.openConnection(); + if(conn instanceof HttpsURLConnection) { + HttpsURLConnection i$ = (HttpsURLConnection)conn; + if(ignoreSSLCheck) { + try { + SSLContext entry = SSLContext.getInstance("TLS"); + entry.init((KeyManager[])null, new TrustManager[]{new TrustAllTrustManager()}, new SecureRandom()); + i$.setSSLSocketFactory(entry.getSocketFactory()); + i$.setHostnameVerifier(new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + } catch (Exception var7) { + throw new IOException(var7.toString()); + } + } else if(ignoreHostCheck) { + i$.setHostnameVerifier(new HostnameVerifier() { + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + } + + conn = i$; + } + + ((HttpURLConnection)conn).setRequestMethod(method); + ((HttpURLConnection)conn).setDoInput(true); + ((HttpURLConnection)conn).setDoOutput(true); + if(headerMap != null && headerMap.get("TOP_HTTP_DNS_HOST") != null) { + ((HttpURLConnection)conn).setRequestProperty("Host", (String)headerMap.get("TOP_HTTP_DNS_HOST")); + } else { + ((HttpURLConnection)conn).setRequestProperty("Host", url.getHost()); + } + + ((HttpURLConnection)conn).setRequestProperty("Accept", "text/xml,text/javascript"); + ((HttpURLConnection)conn).setRequestProperty("Content-Type", ctype); + if(headerMap != null) { + Iterator i$1 = headerMap.entrySet().iterator(); + + while(i$1.hasNext()) { + Map.Entry entry1 = (Map.Entry)i$1.next(); + if(!"TOP_HTTP_DNS_HOST".equals(entry1.getKey())) { + ((HttpURLConnection)conn).setRequestProperty((String)entry1.getKey(), (String)entry1.getValue()); + } + } + } + + return (HttpURLConnection)conn; + } + + public static String getStreamAsString(InputStream stream, String charset) throws IOException { + try { + InputStreamReader reader = new InputStreamReader(stream, charset); + StringBuilder response = new StringBuilder(); + char[] buff = new char[1024]; + boolean read = false; + + int read1; + while((read1 = reader.read(buff)) > 0) { + response.append(buff, 0, read1); + } + + String var6 = response.toString(); + return var6; + } finally { + if(stream != null) { + stream.close(); + } + + } + } + + public static class TrustAllTrustManager implements X509TrustManager { + public TrustAllTrustManager() { + } + + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { + } + } + + public static String ytoSendPost(String url, Map<String, String> params) + { + OutputStreamWriter out = null; + BufferedReader in = null; + StringBuilder result = new StringBuilder(); + try { + URL realUrl = new URL(url); + HttpURLConnection conn =(HttpURLConnection) realUrl.openConnection(); + // 发送POST请求必须设置如下两行 + conn.setDoOutput(true); + conn.setDoInput(true); + // POST方法 + conn.setRequestMethod("POST"); + // 设置通用的请求属性 + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + conn.connect(); + // 获取URLConnection对象对应的输出流 + out = new OutputStreamWriter(conn.getOutputStream(), "UTF-8"); + // 发送请求参数 + if (params != null) { + StringBuilder param = new StringBuilder(); + for (Map.Entry<String, String> entry : params.entrySet()) { + if(param.length()>0){ + param.append("&"); + } + param.append(entry.getKey()); + param.append("="); + param.append(entry.getValue()); + } + out.write(param.toString()); + } + // flush输出流的缓冲 + out.flush(); + // 定义BufferedReader输入流来读取URL的响应 + in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); + String line; + while ((line = in.readLine()) != null) { + result.append(line); + } + } catch (Exception e) { + e.printStackTrace(); + } + //使用finally块来关闭输出流、输入流 + finally{ + try{ + if(out!=null){ + out.close(); + } + if(in!=null){ + in.close(); + } + } + catch(IOException ex){ + ex.printStackTrace(); + } + } + return result.toString(); + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Utils/WordTemplate.java b/src/main/java/com/gk/hotwork/Domain/Utils/WordTemplate.java new file mode 100644 index 0000000..2dbc7ae --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Utils/WordTemplate.java @@ -0,0 +1,1222 @@ +package com.gk.hotwork.Domain.Utils; + +import com.google.common.collect.ImmutableMap; +import org.apache.poi.ooxml.POIXMLDocumentPart; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.util.Units; +import org.apache.poi.xwpf.usermodel.*; +import org.apache.xmlbeans.XmlException; +import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject; +import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.RenderedImage; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.List; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class WordTemplate { + + private XWPFDocument document; + + private static final String replace_flag_left = "#{"; + private static final String replace_flag_right = "}#"; + public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分"); + public static final SimpleDateFormat sdf_dhms = new SimpleDateFormat("dd日HH时mm分"); + + + + + //模板里的table + public static class Table{ + //字段 + public String[] fields; + //数据 + public List<String[]> data; + //<数据,索引> + public HashMap<String, Integer> index; + + public Table(String[] fields, List<String[]> data) { + this.fields = fields; + this.data = data; + this.index = new HashMap<>(); + for (int i = 0; i < fields.length; i++) { + this.index.put(fields[i], i); + } + } + + } + + public static class Attribute{ + + public String attribute; + + public String value; + + public Attribute(String attribute, String value) { + this.attribute = attribute; + this.value = value; + } + } + + public static class FontCustomize { + public int fontSize; + public String fontFamily; + + public FontCustomize(int fontSize, String fontFamily) { + this.fontSize = fontSize; + this.fontFamily = fontFamily; + } + } + + + public static class MergeTable extends Table{ + + public String[] mergeFields; + + public MergeTable(String[] fields, List<String[]> data) { + super(fields, data); + } + + public MergeTable(String[] fields, String[] mergeFields, List<String[]> data) { + super(fields, data); + this.mergeFields = mergeFields; + } + } + + //加载,file的加载何,流的加载 二选1 + public void loadTemplate(File file,InputStream in) throws IOException{ + InputStream target = null; + if (file != null) { + target = new FileInputStream(file); + }else{ + target = in; + } + try{ + document = new XWPFDocument(target); + target.close(); + } catch(IOException ex){ + target.close(); + throw ex; + } + } + + + public void saveFile(String fileName) throws IOException { + File f=new File(fileName); + String a=""; + if(!f.exists()){//判断outputFile文件夹下是否存在name文件,不存在,创建 + f.createNewFile(); + } + FileOutputStream fos = new FileOutputStream(f); + try{ + document.write(fos); + fos.close(); + }catch (IOException ex){ + fos.close(); + throw ex; + } + } + + + + + + + public void replaceDocument(Map<String, Table> tableMap,Map<String,String> paraMap) { + List<IBodyElement> bodyElements = document.getBodyElements(); + int templateBodySize = bodyElements.size(); + int curT = 0; + int curP = 0; + for (int a = 0; a < templateBodySize; a++) { + + IBodyElement body = bodyElements.get(a); + // System.out.println( body.getElementType()); + if (BodyElementType.TABLE.equals(body.getElementType())) { + // + XWPFTable table = body.getBody().getTableArray(curT); + List<XWPFTable> tables = body.getBody().getTables(); + table = tables.get(curT); + if (table != null) { + List<XWPFTableCell> tableCells = table.getRows().get(0).getTableCells(); + // 获取到模板表格第一行,用来判断表格类型 + String tableText = table.getText(); + if (tableText.indexOf("##{foreach") > -1) { + if (tableCells.size() != 2 + || tableCells.get(0).getText().indexOf("##{foreach") < 0 + || tableCells.get(0).getText().trim().length() == 0) { + throw new RuntimeException("need two cell in row."); + } + + String tableType = tableCells.get(0).getText(); + String dataSource = tableCells.get(1).getText(); + + if (!tableMap.containsKey(dataSource)) { + throw new RuntimeException("need table:" + dataSource); + } + Table tableData = tableMap.get(dataSource); + + if ("##{foreachTable}##".equals(tableType)) { + // System.out.println("循环生成表格"); + addTableInDocFooterByTable(table, tableData); + + } else if ("##{foreachTableRow}##".equals(tableType)) { + // System.out.println("循环生成表格内部的行"); + addTableInDocFooterByRow(table, tableData, paraMap); + } + + } else if (tableText.indexOf("{") > -1) { + addTableInDocFooterByParas(table, paraMap); + + } else { + // 没有查找到任何标签,该表格是一个静态表格,仅需要复制一个即可。 + addTableInDocFooterByOrigin(table); + } + curT++; + + } + } else if (BodyElementType.PARAGRAPH.equals(body.getElementType())) {// 处理段落 + XWPFParagraph ph = body.getBody().getParagraphArray(curP); + if (ph != null) { + // htmlText = htmlText+readParagraphX(ph); + addParagraphInDocFooter(ph, null, paraMap); + curP++; + } + } else if (BodyElementType.CONTENTCONTROL.equals(body.getElementType())) { + IBodyElement bodyElement = bodyElements.get(curP); + IBody body1 = bodyElement.getBody(); + } + } + + for (int a = 0; a < templateBodySize; a++) { + document.removeBodyElement(0); + } + + } + + // + public void replaceDocument2(Map<String, Table> cellMap,Map<String,String> params) throws IOException, XmlException { + List<IBodyElement> bodyElements = document.getBodyElements(); + int templateBodySize = bodyElements.size(); + int curT = 0; + for (int a = 0; a < templateBodySize; a++) { + + IBodyElement body = bodyElements.get(a); + // System.out.println( body.getElementType()); + if (BodyElementType.TABLE.equals(body.getElementType())) { + // + XWPFTable table = body.getBody().getTableArray(curT); + List<XWPFTable> tables = body.getBody().getTables(); + POIXMLDocumentPart part = body.getBody().getPart(); + table = tables.get(curT); + Table mainTable = cellMap.get("mainTable"); + List<String[]> data = mainTable.data; + int remove = 0; + + List<XWPFTableRow> rows = table.getRows(); + for (int i = 0; i < rows.size(); i++) { + XWPFTableRow row = rows.get(i); + List<XWPFTableCell> tableCells = row.getTableCells(); + for (int j = 0; j < tableCells.size(); j++) { + XWPFTableCell cell = tableCells.get(j); + String text = cell.getText(); + if (params.get(text) != null) { + cell.removeParagraph(0); + cell.setText(params.get(text)); + } + //生成表内容 + if ("##foreachRows##".equals(cell.getText())) { + //从下面一行开始循环生成单元格 + XWPFTableRow infoRow = rows.get(i + 1); + for (int k = 0; k < mainTable.data.size(); k++) { + CTRow ctrow = CTRow.Factory.parse(infoRow.getCtRow().newInputStream()); + XWPFTableRow newRow = new XWPFTableRow(ctrow, table); + String[] strings = data.get(k); + for (int m = 0; m < strings.length; m++) + { + XWPFTableCell cellSS = newRow.getTableCells().get(m);// 在新增的行上面创建cell + //cell.setText(fields.get(k));//不能使用该方法直接加内容,这样会在原内容后面追加,并且不能保证跟原字体样式一致 + for (XWPFParagraph p : cellSS.getParagraphs()) + { + for (XWPFRun r : p.getRuns()) + { + r.setText(strings[m], 0);//要深入到原cell中的run替换内容才能保证样式一致 + } + } + } + table.addRow(newRow, i + k); + } + //删除####foreachRows##这一行 + table.removeRow(i + mainTable.data.size()); + //删除type specification num 这一行 + table.removeRow(i + mainTable.data.size()); + } + } + } + + + } + } + + } + + private void addTableInDocFooterByTable(XWPFTable templateTable, Table data) { + for (String[] row: data.data) { + List<XWPFTableRow> templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 1; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + replaceTable(newCreateTable, getMap(data.index,row));//替换标签 + } + } + + private HashMap getMap(HashMap<String,Integer> key,String[] row){ + HashMap<String,String> r = new HashMap<String,String>(); + Iterator<Entry<String, Integer>> it =key.entrySet().iterator(); + while(it.hasNext()){ + Entry<String, Integer> en =it.next(); + r.put(en.getKey(),row[en.getValue()]); + } + return r; + } + private void addTableInDocFooterByRow(XWPFTable templateTable, Table data , Map<String, String> parametersMap) { + + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + List<XWPFTableRow> TempTableRows = templateTable.getRows();// 获取模板表格所有行 + int tagRowsIndex = 0;// 标签行indexs + for (int i = 0, size = TempTableRows.size(); i < size; i++) { + String rowText = TempTableRows.get(i).getCell(0).getText();// 获取到表格行的第一个单元格 + if (rowText.indexOf("##{foreachRows}##") > -1) { + tagRowsIndex = i; + break; + } + } + + /* 复制模板行和标签行之前的行 */ + for (int i = 1; i < tagRowsIndex; i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, TempTableRows.get(i));// 复制行 + replaceTableRow(newCreateRow, parametersMap);// 处理不循环标签的替换 + } + + /* 循环生成模板行 */ + XWPFTableRow tempRow = TempTableRows.get(tagRowsIndex + 1);// 获取到模板行 + for (String[] row: data.data) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, tempRow);// 复制模板行 + replaceTable(newCreateTable, getMap(data.index,row));//替换标签 + } + + /* 复制模板行和标签行之后的行 */ + for (int i = tagRowsIndex + 2; i < TempTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, TempTableRows.get(i));// 复制行 + replaceTableRow(newCreateRow, parametersMap);// 处理不循环标签的替换 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + + } + + private void addTableInDocFooterByOrigin(XWPFTable templateTable + ) { + List<XWPFTableRow> templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 0; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + } + + + private void addTableInDocFooterByParas(XWPFTable templateTable, + Map<String, String> parametersMap) { + //表格不循环仅简单替换标签 + List<XWPFTableRow> templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 0; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + // document.createParagraph();// 添加回车换行 + replaceTable(newCreateTable, parametersMap); + } + + + + private void addParagraphInDocFooter(XWPFParagraph templateParagraph, + List<Map<String, String>> list, Map<String, String> parametersMap) { + XWPFParagraph createParagraph = document.createParagraph(); + // 设置段落样式 + createParagraph.getCTP().setPPr(templateParagraph.getCTP().getPPr()); + // 移除原始内容 + for (int pos = 0; pos < createParagraph.getRuns().size(); pos++) { + createParagraph.removeRun(pos); + } + // 添加Run标签 + for (XWPFRun s : templateParagraph.getRuns()) { + XWPFRun targetrun = createParagraph.createRun(); + CopyRun(targetrun, s); + } + + replaceParagraph(createParagraph, parametersMap); + } + + private void replaceParagraph(XWPFParagraph xWPFParagraph, Map<String, String> parametersMap) { + List<XWPFRun> runs = xWPFParagraph.getRuns(); + String xWPFParagraphText = xWPFParagraph.getText(); + String regEx = "\\{.+?\\}"; + Pattern pattern = Pattern.compile(regEx); + Matcher matcher = pattern.matcher(xWPFParagraphText);//正则匹配字符串{****} + + if (matcher.find()) { + // 查找到有标签才执行替换 + int beginRunIndex = xWPFParagraph.searchText("{", new PositionInParagraph()).getBeginRun();// 标签开始run位置 + int endRunIndex = xWPFParagraph.searchText("}", new PositionInParagraph()).getEndRun();// 结束标签 + StringBuffer key = new StringBuffer(); + + if (beginRunIndex == endRunIndex) { + // {**}在一个run标签内 + XWPFRun beginRun = runs.get(beginRunIndex); + String beginRunText = beginRun.text(); + + int beginIndex = beginRunText.indexOf("{"); + int endIndex = beginRunText.indexOf("}"); + int length = beginRunText.length(); + + if (beginIndex == 0 && endIndex == length - 1) { + // 该run标签只有{**} + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + key.append(beginRunText.substring(1, endIndex)); + insertNewRun.setText(getValueBykey(key.toString(),parametersMap)); + xWPFParagraph.removeRun(beginRunIndex + 1); + } else { + // 该run标签为**{**}** 或者 **{**} 或者{**}**,替换key后,还需要加上原始key前后的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + key.append(beginRunText.substring(beginRunText.indexOf("{")+1, beginRunText.indexOf("}"))); + String textString=beginRunText.substring(0, beginIndex) + getValueBykey(key.toString(),parametersMap) + + beginRunText.substring(endIndex + 1); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(beginRunIndex + 1); + } + + }else { + // {**}被分成多个run + + //先处理起始run标签,取得第一个{key}值 + XWPFRun beginRun = runs.get(beginRunIndex); + String beginRunText = beginRun.text(); + int beginIndex = beginRunText.indexOf("{"); + if (beginRunText.length()>1 ) { + key.append(beginRunText.substring(beginIndex+1)); + } + ArrayList<Integer> removeRunList = new ArrayList<>();//需要移除的run + //处理中间的run + for (int i = beginRunIndex + 1; i < endRunIndex; i++) { + XWPFRun run = runs.get(i); + String runText = run.text(); + key.append(runText); + removeRunList.add(i); + } + + // 获取endRun中的key值 + XWPFRun endRun = runs.get(endRunIndex); + String endRunText = endRun.text(); + int endIndex = endRunText.indexOf("}"); + //run中**}或者**}** + if (endRunText.length()>1 && endIndex!=0) { + key.append(endRunText.substring(0,endIndex)); + } + + + + //******************************************************************* + //取得key值后替换标签 + + //先处理开始标签 + if (beginRunText.length()==2 ) { + // run标签内文本{ + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + insertNewRun.setText(getValueBykey(key.toString(),parametersMap)); + xWPFParagraph.removeRun(beginRunIndex + 1);//移除原始的run + }else { + // 该run标签为**{**或者 {** ,替换key后,还需要加上原始key前的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + String textString=beginRunText.substring(0,beginRunText.indexOf("{"))+getValueBykey(key.toString(),parametersMap); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(beginRunIndex + 1);//移除原始的run + } + + //处理结束标签 + if (endRunText.length()==1 ) { + // run标签内文本只有} + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(endRunIndex); + insertNewRun.getCTR().setRPr(endRun.getCTR().getRPr()); + // 设置文本 + insertNewRun.setText(""); + xWPFParagraph.removeRun(endRunIndex + 1);//移除原始的run + + }else { + // 该run标签为**}**或者 }** 或者**},替换key后,还需要加上原始key后的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(endRunIndex); + insertNewRun.getCTR().setRPr(endRun.getCTR().getRPr()); + // 设置文本 + String textString=endRunText.substring(endRunText.indexOf("}")+1); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(endRunIndex + 1);//移除原始的run + } + + //处理中间的run标签 + for (int i = 0; i < removeRunList.size(); i++) { + XWPFRun xWPFRun = runs.get(removeRunList.get(i));//原始run + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(removeRunList.get(i)); + insertNewRun.getCTR().setRPr(xWPFRun.getCTR().getRPr()); + insertNewRun.setText(""); + xWPFParagraph.removeRun(removeRunList.get(i) + 1);//移除原始的run + } + + }// 处理${**}被分成多个run + + replaceParagraph( xWPFParagraph, parametersMap); + + }//if 有标签 + + } + + + + + + + + + /** + * 复制表格行XWPFTableRow格式 + * + * @param target + * 待修改格式的XWPFTableRow + * @param source + * 模板XWPFTableRow + */ + private void CopyTableRow(XWPFTableRow target, XWPFTableRow source) { + + int tempRowCellsize = source.getTableCells().size();// 模板行的列数 + for (int i = 0; i < tempRowCellsize - 1; i++) { + target.addNewTableCell();// 为新添加的行添加与模板表格对应行行相同个数的单元格 + } + // 复制样式 + target.getCtRow().setTrPr(source.getCtRow().getTrPr()); + // 复制单元格 + for (int i = 0; i < target.getTableCells().size(); i++) { + copyTableCell(target.getCell(i), source.getCell(i)); + } + } + + + + + + /** + * 复制单元格XWPFTableCell格式 + * + * @author Juveniless + * @date 2017年11月27日 下午3:41:02 + * @param newTableCell + * 新创建的的单元格 + * @param templateTableCell + * 模板单元格 + * + */ + private void copyTableCell(XWPFTableCell newTableCell, XWPFTableCell templateTableCell) { + // 列属性 + newTableCell.getCTTc().setTcPr(templateTableCell.getCTTc().getTcPr()); + + if(templateTableCell.getText().indexOf("{noborder}")>-1){ + CTTcBorders tblBorders = newTableCell.getCTTc().getTcPr().addNewTcBorders(); + tblBorders.addNewLeft().setVal(STBorder.NIL); + tblBorders.addNewRight().setVal(STBorder.NIL); + tblBorders.addNewTop().setVal(STBorder.NIL); + newTableCell.getCTTc().getTcPr().setTcBorders(tblBorders); + } + + // 删除目标 targetCell 所有文本段落 + for (int pos = 0; pos < newTableCell.getParagraphs().size(); pos++) { + newTableCell.removeParagraph(pos); + } + // 添加新文本段落 + for (XWPFParagraph sp : templateTableCell.getParagraphs()) { + XWPFParagraph targetP = newTableCell.addParagraph(); + copyParagraph(targetP, sp); + } + } + + /** + * 复制文本段落XWPFParagraph格式 + * + * @author Juveniless + * @date 2017年11月27日 下午3:43:08 + * @param newParagraph + * 新创建的的段落 + * @param templateParagraph + * 模板段落 + * + */ + private void copyParagraph(XWPFParagraph newParagraph, XWPFParagraph templateParagraph) { + // 设置段落样式 + newParagraph.getCTP().setPPr(templateParagraph.getCTP().getPPr()); + // 添加Run标签 + for (int pos = 0; pos < newParagraph.getRuns().size(); pos++) { + newParagraph.removeRun(pos); + + } + for (XWPFRun s : templateParagraph.getRuns()) { + XWPFRun targetrun = newParagraph.createRun(); + CopyRun(targetrun, s); + } + + } + + /** + * 复制文本节点run + * @author Juveniless + * @date 2017年11月27日 下午3:47:17 + * @param newRun + * 新创建的的文本节点 + * @param templateRun + * 模板文本节点 + * + */ + private void CopyRun(XWPFRun newRun, XWPFRun templateRun) { + newRun.getCTR().setRPr(templateRun.getCTR().getRPr()); + // 设置文本 + newRun.setText(templateRun.text()); + } + + + + private void replaceTableRow(XWPFTableRow tableRow, Map<String, String> parametersMap) { + + List<XWPFTableCell> tableCells = tableRow.getTableCells(); + for (XWPFTableCell xWPFTableCell : tableCells) { + List<XWPFParagraph> paragraphs = xWPFTableCell.getParagraphs(); + for (XWPFParagraph xwpfParagraph : paragraphs) { + + replaceParagraph(xwpfParagraph, parametersMap); + } + } + + } + + + private void replaceTable(XWPFTable xwpfTable, Map<String, String> parametersMap){ + List<XWPFTableRow> rows = xwpfTable.getRows(); + for (XWPFTableRow xWPFTableRow : rows ) { + List<XWPFTableCell> tableCells = xWPFTableRow.getTableCells(); + for (XWPFTableCell xWPFTableCell : tableCells ) { + List<XWPFParagraph> paragraphs2 = xWPFTableCell.getParagraphs(); + for (XWPFParagraph xWPFParagraph : paragraphs2) { + replaceParagraph(xWPFParagraph, parametersMap); + } + } + } + + } + + private String getValueBykey(String key, Map<String, String> map) { + String returnValue=""; + if (key != null) { + key = key.trim(); + try { + returnValue=map.get(key)!=null ? map.get(key).toString() : ""; + } catch (Exception e) { + + returnValue=""; + } + } + // System.out.println(key+":" + returnValue); + return returnValue; + } + + public static XWPFTableRow insertRow(XWPFTable table, int copyrowIndex, int newrowIndex,int fontSize,String fontFamily) { + // 在表格中指定的位置新增一行 + XWPFTableRow targetRow = table.insertNewTableRow(newrowIndex); + // 获取需要复制行对象 + XWPFTableRow copyRow = table.getRow(copyrowIndex); + //复制行对象 + targetRow.getCtRow().setTrPr(copyRow.getCtRow().getTrPr()); + //或许需要复制的行的列 + List<XWPFTableCell> copyCells = copyRow.getTableCells(); + //复制列对象 + XWPFTableCell targetCell = null; + for (int i = 0; i < copyCells.size(); i++) { + XWPFTableCell copyCell = copyCells.get(i); + targetCell = targetRow.addNewTableCell(); + targetCell.getCTTc().setTcPr(copyCell.getCTTc().getTcPr()); + if (copyCell.getParagraphs() != null && copyCell.getParagraphs().size() > 0) { + targetCell.getParagraphs().get(0).getCTP().setPPr(copyCell.getParagraphs().get(0).getCTP().getPPr()); + if (copyCell.getParagraphs().get(0).getRuns() != null + && copyCell.getParagraphs().get(0).getRuns().size() > 0) { + XWPFRun cellR = targetCell.getParagraphs().get(0).createRun(); + cellR.setText(copyCell.getParagraphs().get(0).getText()); + cellR.setBold(copyCell.getParagraphs().get(0).getRuns().get(0).isBold()); + cellR.setFontSize(fontSize); + cellR.setFontFamily(fontFamily); + } + } + } + return targetRow; + + } + + + public static void setCell(XWPFTableCell targetCell, String wrapped_keyword,String content, int fontSize, String fontFamily,boolean isCenter) { + + List<XWPFParagraph> paragraphs = targetCell.getParagraphs(); + + for (int i = 0; i < paragraphs.size(); i++) { + XWPFParagraph paragraph = paragraphs.get(i); + String text = paragraph.getText(); + + if (text.contains(wrapped_keyword)) { + String after_replace = text.replace(wrapped_keyword, StringUtils.isBlank(content)?"":content); + targetCell.removeParagraph(i); + XWPFParagraph newP = targetCell.addParagraph(); + if (isCenter) + newP.setAlignment(ParagraphAlignment.CENTER); + XWPFRun run = newP.createRun(); + run.setText(after_replace); + run.setFontSize(fontSize); + run.setFontFamily(fontFamily); + } + } + + } + + + public XWPFDocument getDocument() { + return document; + } + + public void setDocument(XWPFDocument document) { + this.document = document; + } + + +// public void wordConvertPdf(String fileURI) throws IOException { +// ByteArrayOutputStream baos = new ByteArrayOutputStream(); +// document.write(baos); +// ByteArrayInputStream in = new ByteArrayInputStream(baos.toByteArray()); +// +// FileOutputStream fileOutputStream = new FileOutputStream(fileURI); +// +// IConverter converter = LocalConverter.builder().build(); +// converter.convert(in).as(DocumentType.DOCX).to(fileOutputStream).as(DocumentType.PDF).execute(); +// fileOutputStream.close(); +// +// } +// +// +// public void wordConvertPdf(String docxPath,String savePdfPath) throws IOException { +// try { +//// InputStream inputStream = WordTemplate.class.getClassLoader().getResourceAsStream ("license.xml"); +// License license = new License(); +// ClassPathResource resource = new ClassPathResource("license.xml"); +// InputStream inputStream = resource.getInputStream(); +// license.setLicense(inputStream); +// com.aspose.words.Document document = new com.aspose.words.Document(docxPath); +// FileOutputStream fileOutputStream = new FileOutputStream(new File(savePdfPath)); +// document.deepClone().save(fileOutputStream, SaveFormat.PDF); +// inputStream.close(); +// fileOutputStream.close(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// +// +// } + + + /** + * @Description: 替换指定索引表单,指定字体和字体大小 + * @date 2021/8/30 8:49 + */ + public void replace(int targetTable,Map<String, WordTemplate.Table> tables,Map<String,WordTemplate.MergeTable> mergeTables, Map<String, String> simpleData,int fontSize,String fontFamily) { + + //table标识集合 + Set<String> tableFlags = tables.keySet(); + Set<String> mergeTableFlags = mergeTables.keySet(); + List<IBodyElement> bodyElements = document.getBodyElements(); + for (IBodyElement bodyElement : bodyElements) { + if (bodyElement.getElementType() == BodyElementType.TABLE) { + IBody body = bodyElement.getBody(); + //第一表单 + XWPFTable table = body.getTableArray(targetTable); + List<XWPFTableRow> rows = table.getRows(); + for (int i = 0; i < rows.size(); i++) { + XWPFTableRow currentRow = rows.get(i); + List<XWPFTableCell> currentRowCells = currentRow.getTableCells(); + for (XWPFTableCell currentCell : currentRowCells) { + String text = currentCell.getText(); + for (int k = 0; k < text.length(); k++) { + int left_flag = text.indexOf(replace_flag_left,k); + int right_flag = text.indexOf(replace_flag_right,k); + if (left_flag != -1 && right_flag != -1) { + String keyword = text.substring(left_flag + replace_flag_left.length(), right_flag); + String wrapped_keyword = replace_flag_left + keyword + replace_flag_right; + if (simpleData.containsKey(keyword)) { + String content = simpleData.get(keyword); + WordTemplate.setCell(currentCell,wrapped_keyword,content,fontSize,fontFamily,false); + } + k = right_flag; + } + } + + + + if (tableFlags.contains(text)) { + int templateRowIndex = i + 1; + WordTemplate.Table workerTable = tables.get(text); + List<String[]> tableData = workerTable.data; + String[] fields = workerTable.fields; + Map<String, Integer> index = workerTable.index; + for (int j = 0; j < tableData.size(); j++) { + //行数据 + String[] tableRowData = tableData.get(j); + //新增行为数据替换行 + XWPFTableRow targetRow = WordTemplate + .insertRow(table, templateRowIndex, templateRowIndex + 1, fontSize,fontFamily); + //单独替换数据 + for (XWPFTableCell targetCell : targetRow.getTableCells()) { + String wordText = targetCell.getText(); + + for (int m = 0; m < wordText.length(); m++) { + int left_flag = wordText.indexOf(replace_flag_left,m); + int right_flag = wordText.indexOf(replace_flag_right,m); + if (left_flag != -1 && right_flag != -1) { + String keyword = wordText.substring(left_flag + replace_flag_left.length(), right_flag); + String wrapped_keyword = replace_flag_left + keyword + replace_flag_right; + if (index.get(keyword) != null) { + Integer fieldIndex = index.get(keyword); + String content = tableRowData[fieldIndex]; + WordTemplate.setCell(targetCell,wrapped_keyword,content,fontSize,fontFamily,true); + } + } + } + } + } + //table标识行函数删除 + table.removeRow(i); + //模板行删除 + table.removeRow(i); + } + //合并表 + if (mergeTableFlags.contains(text)) { + int templateRowIndex = i + 1; + MergeTable mergeTable = mergeTables.get(text); + List<String[]> tableData = mergeTable.data; + String[] fields = mergeTable.fields; + String[] mergeFields = mergeTable.mergeFields; + HashSet<String> set = new HashSet<>(Arrays.asList(mergeFields)); + Map<String, Integer> index = mergeTable.index; + for (int l = 0; l < tableData.size(); l++) { + //行数据 + String[] tableRowData = tableData.get(l); + //新增行为数据替换行 + XWPFTableRow targetRow = WordTemplate + .insertRow(table, templateRowIndex, templateRowIndex + 1, fontSize,fontFamily); + //单独替换数据 + for (XWPFTableCell targetCell : targetRow.getTableCells()) { + String wordText = targetCell.getText(); + + for (int m = 0; m < wordText.length(); m++) { + int left_flag = wordText.indexOf(replace_flag_left,m); + int right_flag = wordText.indexOf(replace_flag_right,m); + if (left_flag != -1 && right_flag != -1) { + String keyword = wordText.substring(left_flag + replace_flag_left.length(), right_flag); + //合并项 + if (set.contains(keyword)) { + //因为是头插,所以合并的restart为最后一个 + if (l == tableData.size()-1 ) + targetCell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.RESTART); + else + targetCell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); + } + //替换 + String wrapped_keyword = replace_flag_left + keyword + replace_flag_right; + if (index.get(keyword) != null) { + Integer fieldIndex = index.get(keyword); + String content = tableRowData[fieldIndex]; + WordTemplate.setCell(targetCell,wrapped_keyword,content,fontSize,fontFamily,false); + } + } + } + } + } + //table标识行函数删除 + table.removeRow(i); + //模板行删除 + table.removeRow(i); + } + } + } + + } + } + } + + public void replaceQRCode(String qrCodeSavePath,String info,int width,int height,int leftOffset,int topOffset) throws IOException, InvalidFormatException, InterruptedException { + Image image = QRCode.generateQRCode(info); + String QRCodeUrl = qrCodeSavePath + info + "_" + "QRCode.png"; + File file = new File(QRCodeUrl); + if (!file.exists()) {file.createNewFile();} + ImageIO.write((RenderedImage) image, "png", file); + FileInputStream in = new FileInputStream(file); + List<XWPFParagraph> paragraphs = document.getParagraphs(); + for (int i = 0; i < paragraphs.size(); i++) { + XWPFParagraph paragraph = paragraphs.get(i); + List<XWPFRun> runs = paragraph.getRuns(); + for (int l = 0; l < runs.size(); l++) { + XWPFRun run = runs.get(l); + String text = run.text(); + if (text.equals("#{qrcode}#")) { + paragraph.removeRun(l);//同时把正文两字移除 + XWPFRun xwpfRun = paragraph.insertNewRun(l); + xwpfRun.addPicture(in, XWPFDocument.PICTURE_TYPE_PNG, "QRCode.png", Units.toEMU(width), Units.toEMU(height)); + //浮于文字上方 + CTDrawing drawing= xwpfRun.getCTR().getDrawingArray(0); + CTGraphicalObject go= drawing.getInlineArray(0).getGraphic(); + Random random= new Random(); + int number = random.nextInt(999) + 1; + + CTAnchor anchor1 = getAnchorWithGraphic(go, "Seal" +number, + + Units.toEMU(width), Units.toEMU(height),//图片大小 + + Units.toEMU(leftOffset), Units.toEMU(topOffset), false); + + drawing.setAnchorArray(new CTAnchor[]{anchor1});//添加浮动属性 + drawing.removeInline(0);//删除行内属性//添加签名图片 + + } + } + } + in.close(); + } + public static String formatTime(Date date, SimpleDateFormat sdf) { + String dateStr = " 年 月 日 时 分"; + if (sdf == null) { + sdf = WordTemplate.sdf; + } + if (date != null) + dateStr = sdf.format(date); + return dateStr; + } + + public static CTAnchor getAnchorWithGraphic(CTGraphicalObject ctGraphicalObject, + + String deskFileName,int width, int height,int leftOffset, int topOffset, boolean behind) { + String anchorXML = + "<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " + + "simplePos=\"0\" relativeHeight=\"0\" behindDoc=\"" + ((behind) ? 1 : 0) + "\" locked=\"0\" layoutInCell=\"1\" allowOverlap=\"1\">" + + "<wp:simplePos x=\"0\" y=\"0\"/>" + + "<wp:positionH relativeFrom=\"column\">" + + "<wp:posOffset>" + leftOffset + "</wp:posOffset>" + + "</wp:positionH>" + + "<wp:positionV relativeFrom=\"paragraph\">" + + "<wp:posOffset>" + topOffset + "</wp:posOffset>" + + "</wp:positionV>" + + "<wp:extent cx=\"" + width + "\" cy=\"" + height + "\"/>" + + "<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>" + + "<wp:wrapNone/>" + + "<wp:docPr id=\"1\" name=\"Drawing 0\" descr=\"" + deskFileName + "\"/><wp:cNvGraphicFramePr/>" + + "</wp:anchor>"; + + + CTDrawing drawing= null; + try{ + drawing= CTDrawing.Factory.parse(anchorXML); + + }catch(XmlException e) { + e.printStackTrace(); + + } + + assert drawing != null; + CTAnchor anchor= drawing.getAnchorArray(0); + + anchor.setGraphic(ctGraphicalObject); + return anchor; + + } + + + public void generateSelfCheckTableParam(int targetTable,Map<String,Map<String, List<String>>> taskTypeMergeMap ,int fontSize,String fontFamily) { + Set<String> templateTasktypeFlag = taskTypeMergeMap.keySet(); + List<IBodyElement> bodyElements = document.getBodyElements(); + for (IBodyElement bodyElement : bodyElements) { + if (bodyElement.getElementType() == BodyElementType.TABLE) { + IBody body = bodyElement.getBody(); + //第一表单 + XWPFTable table = body.getTableArray(targetTable); + List<XWPFTableRow> rows = table.getRows(); + for (int i = 0; i < rows.size(); i++) { + XWPFTableRow currentRow = rows.get(i); + List<XWPFTableCell> currentRowCells = currentRow.getTableCells(); + for (XWPFTableCell currentCell : currentRowCells) { + String text = currentCell.getText(); + if (templateTasktypeFlag.contains(text)) { + Map<String, List<String>> mergeTableMap = taskTypeMergeMap.get(text); + //如果包tasktype 做一件事(循环生成多个作业table) 规则为tasktype所在行和下面3行 + //总体规则:往第一个模板后面插,最后把第一个模板删除 + //当前行:i行 + int targetRowPosition = i + 4; + for (Map.Entry<String, List<String>> entry : mergeTableMap.entrySet()) { + String currentTaskType = entry.getKey(); + List<String> mergeTableFlags = entry.getValue(); + for (int j = mergeTableFlags.size() - 1; j >= 0; j--) { + String mergeTableFlag = mergeTableFlags.get(j); + //生成一个作业的4行表格 + for (int m = 3; m >= 2; m--) { + WordTemplate + .insertRow(table, i + m, targetRowPosition, fontSize, fontFamily); + + XWPFTableRow targetRow = rows.get(targetRowPosition); + List<XWPFTableCell> tableCells = targetRow.getTableCells(); + for (XWPFTableCell cell : tableCells) { + String mergeTableFlagOriginal = "mergeTable"; + if (mergeTableFlagOriginal.equals(cell.getText())) { + WordTemplate.setCell(cell,mergeTableFlagOriginal,mergeTableFlag,fontSize,fontFamily,false); + } + } + } + } + for (int k = 1; k >= 0; k--) { + WordTemplate + .insertRow(table, i + k, targetRowPosition, fontSize, fontFamily); + XWPFTableRow targetTitleRow = rows.get(targetRowPosition); + List<XWPFTableCell> tableCells = targetTitleRow.getTableCells(); + for (XWPFTableCell cell : tableCells) { + if (text.equals(cell.getText())) { + WordTemplate.setCell(cell,text,currentTaskType,fontSize,fontFamily,false); + } + } + } + + } + + + + //模板行删除 4行 + { + table.removeRow(i); + table.removeRow(i); + table.removeRow(i); + table.removeRow(i); + + } + } + } + + } + } + } + + } + + public void generateOwnTypeAndAttrs(int targetTable, Map<String, Map<String, List<Attribute>>> typeMap, int fontSize, String fontFamily) { + + Set<String> typeFlagSet = typeMap.keySet(); + List<IBodyElement> bodyElements = document.getBodyElements(); + for (IBodyElement bodyElement : bodyElements) { + if (bodyElement.getElementType() == BodyElementType.TABLE) { + IBody body = bodyElement.getBody(); + XWPFTable table = body.getTableArray(targetTable); + List<XWPFTableRow> rows = table.getRows(); + for (int i = 0; i < rows.size(); i++) { + XWPFTableRow currentRow = rows.get(i); + List<XWPFTableCell> currentTableCells = currentRow.getTableCells(); + for (XWPFTableCell currentCell : currentTableCells) { + String text = currentCell.getText(); + if (typeFlagSet.contains(text)) { + currentCell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); + //模板行位置 + int templateRowPosition = i + 1; + //生成行位置 + int targetRowPosition = i + 2; + Map<String, List<Attribute>> allTypeMap = typeMap.get(text); + for (Map.Entry<String, List<Attribute>> entry : allTypeMap.entrySet()) { + String currentType = entry.getKey(); + List<Attribute> currentTypeAttrList = entry.getValue(); + //计算要生成几行 每行两个属性 + int rowLength = new Double(Math.ceil((double) currentTypeAttrList.size() / 2)).intValue(); + //如果是奇数个属性就补全 + if (currentTypeAttrList.size() % 2 == 1) + currentTypeAttrList.add(currentTypeAttrList.size()-1,new Attribute("", "")); + + for (int m = 0; m < rowLength ; m++) { + WordTemplate.insertRow(table, templateRowPosition, targetRowPosition, fontSize, fontFamily); + XWPFTableRow targetRow = rows.get(targetRowPosition); + //首个单元格设置作业类型 + List<XWPFTableCell> targetTableCells = targetRow.getTableCells(); + for (int j = 0; j < targetTableCells.size(); j++) { + assert targetTableCells.size()%2 == 1; + XWPFTableCell targetCell = targetTableCells.get(j); + if (j == 0) { + setContent(targetCell, currentType,fontSize,fontFamily); + } + if (j%2 == 1){ + setContent(targetCell, currentTypeAttrList.get(currentTypeAttrList.size() - 1).attribute, fontSize, fontFamily); + setContent(targetTableCells.get(j+1), currentTypeAttrList.get(currentTypeAttrList.size() - 1).value, fontSize, fontFamily); + currentTypeAttrList.remove(currentTypeAttrList.size() - 1); + } + } + } + + //合并cell的第一个type + //合并行第一行 就是生成行位置 + //合并行末尾行 + int lastMergePosition = templateRowPosition + rowLength; + for (int n = targetRowPosition; n <= lastMergePosition; n++) { + XWPFTableRow xwpfTableRow = rows.get(n); + XWPFTableCell targetCell = xwpfTableRow.getCell(0); + if (n == targetRowPosition ) + targetCell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.RESTART); + else + targetCell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); + } + + } + //删除模板行 + table.removeRow(i); + table.removeRow(i); + } + + } + } + } + + } + + } + + public void replaceAutoGraph(String taskPathPrefix , Map<String, String> nameMapGraph, int width, int height,int leftOffset, int topOffset) throws IOException, InvalidFormatException { + Set<String> keys = nameMapGraph.keySet(); + List<IBodyElement> bodyElements = document.getBodyElements(); + for (IBodyElement bodyElement : bodyElements) { + if (bodyElement.getElementType() == BodyElementType.TABLE) { + IBody body = bodyElement.getBody(); + List<XWPFTable> tables = body.getTables(); + for (XWPFTable table : tables) { + List<XWPFTableRow> rows = table.getRows(); + for (XWPFTableRow row : rows) { + for (XWPFTableCell cell : row.getTableCells()) { + List<XWPFParagraph> paragraphs = cell.getParagraphs(); + for (int i = 0; i < paragraphs.size(); i++) { + XWPFParagraph paragraph = paragraphs.get(i); + List<XWPFRun> runs = paragraph.getRuns(); + for (int j = 0; j < runs.size(); j++) { + XWPFRun run = runs.get(j); + String text = run.text(); + if (keys.contains(text)) { + if (StringUtils.isNotBlank(nameMapGraph.get(text))) { + String url = taskPathPrefix + nameMapGraph.get(text); + FileInputStream in = new FileInputStream(url); + paragraph.removeRun(j);//同时把正文两字移除 + paragraph.setAlignment(ParagraphAlignment.CENTER); + XWPFRun xwpfRun = paragraph.insertNewRun(j); + xwpfRun.addPicture(in, getPictureFormat(url), url, Units.toEMU(width), Units.toEMU(height)); + //浮于文字上方 + CTDrawing drawing= xwpfRun.getCTR().getDrawingArray(0); + CTGraphicalObject go= drawing.getInlineArray(0).getGraphic(); + Random random= new Random(); + int number = random.nextInt(999) + 1; + + CTAnchor anchor1 = getAnchorWithGraphic(go, "Seal" +number, + + Units.toEMU(width), Units.toEMU(height),//图片大小 + + 0, 0, true); + + drawing.setAnchorArray(new CTAnchor[]{anchor1});//添加浮动属性 + drawing.removeInline(0);//删除行内属性//添加签名图片 + in.close(); + }else{ + paragraph.removeRun(j);//同时把正文两字移除 + paragraph.setAlignment(ParagraphAlignment.CENTER); + XWPFRun xwpfRun = paragraph.insertNewRun(j); + xwpfRun.setText(" "); + + } + + } + } + + } + } + + } + } + } + + + } + + } + + private void setContent(XWPFTableCell targetCell, String content, int fontSize, String fontFamily) { + XWPFRun run = targetCell.getParagraphs().get(0).createRun(); + run.setText(content); + run.setFontFamily(fontFamily); + run.setFontSize(fontSize); + } + + + public static int getPictureFormat(String imgFile) { + int format; + if (imgFile.endsWith(".emf")) format = XWPFDocument.PICTURE_TYPE_EMF; + else if (imgFile.endsWith(".wmf")) format = XWPFDocument.PICTURE_TYPE_WMF; + else if (imgFile.endsWith(".pict")) format = XWPFDocument.PICTURE_TYPE_PICT; + else if (imgFile.endsWith(".jpeg") || imgFile.endsWith(".jpg")) format = XWPFDocument.PICTURE_TYPE_JPEG; + else if (imgFile.endsWith(".png")) format = XWPFDocument.PICTURE_TYPE_PNG; + else if (imgFile.endsWith(".dib")) format = XWPFDocument.PICTURE_TYPE_DIB; + else if (imgFile.endsWith(".gif")) format = XWPFDocument.PICTURE_TYPE_GIF; + else if (imgFile.endsWith(".tiff")) format = XWPFDocument.PICTURE_TYPE_TIFF; + else if (imgFile.endsWith(".eps")) format = XWPFDocument.PICTURE_TYPE_EPS; + else if (imgFile.endsWith(".bmp")) format = XWPFDocument.PICTURE_TYPE_BMP; + else if (imgFile.endsWith(".wpg")) format = XWPFDocument.PICTURE_TYPE_WPG; + else { + System.err.println("Unsupported picture: " + imgFile + + ". Expected emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg"); + System.err.println("不支持的图片格式: " + imgFile + + ". 仅支持 emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg 格式的图片"); + format = -1; + } + return format; + } +} + + + + diff --git a/src/main/java/com/gk/hotwork/Domain/VideoInfo.java b/src/main/java/com/gk/hotwork/Domain/VideoInfo.java new file mode 100644 index 0000000..a645551 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/VideoInfo.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("video") +public class VideoInfo implements Serializable { + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** appkey **/ + private String appkey; + + /** secret **/ + private String secret; + + /** token token **/ + private String token; + + /** 到期时间 expiretime **/ + private Date expiretime; + + /** 更新时间 updatetime **/ + private Date updatetime; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** appkey **/ + public String getAppkey() { + return appkey; + } + + /** appkey **/ + public void setAppkey(String appkey) { + this.appkey = appkey == null ? null : appkey.trim(); + } + + /** secret **/ + public String getSecret() { + return secret; + } + + /** secret **/ + public void setSecret(String secret) { + this.secret = secret == null ? null : secret.trim(); + } + + /** token token **/ + public String getToken() { + return token; + } + + /** token token **/ + public void setToken(String token) { + this.token = token == null ? null : token.trim(); + } + + /** 到期时间 expiretime **/ + public Date getExpiretime() { + return expiretime; + } + + /** 到期时间 expiretime **/ + public void setExpiretime(Date expiretime) { + this.expiretime = expiretime; + } + + /** 更新时间 updatetime **/ + public Date getUpdatetime() { + return updatetime; + } + + /** 更新时间 updatetime **/ + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/AccountUserVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/AccountUserVo.java new file mode 100644 index 0000000..0f508bc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/AccountUserVo.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Domain.Vo; + + +/** + * 账户VO + */ +public class AccountUserVo { + + private String username; + + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/AppFileVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/AppFileVo.java new file mode 100644 index 0000000..9d9627b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/AppFileVo.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.AppFileInfo; +import org.springframework.web.multipart.MultipartFile; + +public class AppFileVo extends AppFileInfo { + + private MultipartFile file; + + public MultipartFile getFile() { + return file; + } + + public void setFile(MultipartFile file) { + this.file = file; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/ApprovalVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/ApprovalVo.java new file mode 100644 index 0000000..b53d37a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/ApprovalVo.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.Enum.ApplyStatus; + +import java.io.Serializable; + +public class ApprovalVo implements Serializable { + + private ApplyStatus applyStatus; + + private String applyId; + + public ApplyStatus getApplyStatus() { + return applyStatus; + } + + public void setApplyStatus(ApplyStatus applyStatus) { + this.applyStatus = applyStatus; + } + + public String getApplyId() { + return applyId; + } + + public void setApplyId(String applyId) { + this.applyId = applyId; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/AssessApplyAppealVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/AssessApplyAppealVo.java new file mode 100644 index 0000000..81a4a48 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/AssessApplyAppealVo.java @@ -0,0 +1,169 @@ +package com.gk.hotwork.Domain.Vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gk.hotwork.Domain.Enum.AssessAppealStatus; +import com.gk.hotwork.Domain.Enum.AssessPunishment; + +import java.io.Serializable; +import java.util.Date; + +public class AssessApplyAppealVo implements Serializable { + + private Long id; + private String code; + private String enterprisename; + private AssessPunishment punishmentmeasure; + //自己申诉的材料 + private String path2; + //协会提交的材料 + private String path1; + private String punishmentreason; + private boolean ispunish; + private Date approvetime; + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") + private Date deadline; + private String approvenote; + private boolean whetherCanAppeal; + private String appealcontent; + private AssessAppealStatus appealstatus; + private String appealapprover; + private Date appealapprovetime; + //7天内截止的单子是否需要提示 + private boolean iswarn; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getEnterprisename() { + return enterprisename; + } + + public void setEnterprisename(String enterprisename) { + this.enterprisename = enterprisename; + } + + public AssessPunishment getPunishmentmeasure() { + return punishmentmeasure; + } + + public void setPunishmentmeasure(AssessPunishment punishmentmeasure) { + this.punishmentmeasure = punishmentmeasure; + } + + public String getPath2() { + return path2; + } + + public void setPath2(String path2) { + this.path2 = path2; + } + + public boolean isIspunish() { + return ispunish; + } + + public void setIspunish(boolean ispunish) { + this.ispunish = ispunish; + } + + public Date getApprovetime() { + return approvetime; + } + + public void setApprovetime(Date approvetime) { + this.approvetime = approvetime; + } + + public Date getDeadline() { + return deadline; + } + + public void setDeadline(Date deadline) { + this.deadline = deadline; + } + + public String getApprovenote() { + return approvenote; + } + + public void setApprovenote(String approvenote) { + this.approvenote = approvenote; + } + + public String getPunishmentreason() { + return punishmentreason; + } + + public void setPunishmentreason(String punishmentreason) { + this.punishmentreason = punishmentreason; + } + + public boolean isWhetherCanAppeal() { + return whetherCanAppeal; + } + + public void setWhetherCanAppeal(boolean whetherCanAppeal) { + this.whetherCanAppeal = whetherCanAppeal; + } + + public String getAppealcontent() { + return appealcontent; + } + + public void setAppealcontent(String appealcontent) { + this.appealcontent = appealcontent; + } + + public AssessAppealStatus getAppealstatus() { + return appealstatus; + } + + public void setAppealstatus(AssessAppealStatus appealstatus) { + this.appealstatus = appealstatus; + } + + public String getAppealapprover() { + return appealapprover; + } + + public void setAppealapprover(String appealapprover) { + this.appealapprover = appealapprover; + } + + public Date getAppealapprovetime() { + return appealapprovetime; + } + + public void setAppealapprovetime(Date appealapprovetime) { + this.appealapprovetime = appealapprovetime; + } + + public String getPath1() { + return path1; + } + + public void setPath1(String path1) { + this.path1 = path1; + } + + public boolean isIswarn() { + return iswarn; + } + + public void setIswarn(boolean iswarn) { + this.iswarn = iswarn; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/CheckReportVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/CheckReportVo.java new file mode 100644 index 0000000..8cf2e03 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/CheckReportVo.java @@ -0,0 +1,47 @@ +package com.gk.hotwork.Domain.Vo; + + +import java.io.Serializable; + +public class CheckReportVo implements Serializable { + + private String report; + + private String applyperson; + + private String reportcode; + + private Long reportid; + + public String getReport() { + return report; + } + + public void setReport(String report) { + this.report = report; + } + + public String getApplyperson() { + return applyperson; + } + + public void setApplyperson(String applyperson) { + this.applyperson = applyperson; + } + + public String getReportcode() { + return reportcode; + } + + public void setReportcode(String reportcode) { + this.reportcode = reportcode; + } + + public Long getReportid() { + return reportid; + } + + public void setReportid(Long reportid) { + this.reportid = reportid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/CityDataVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/CityDataVo.java new file mode 100644 index 0000000..4d01ddd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/CityDataVo.java @@ -0,0 +1,86 @@ +package com.gk.hotwork.Domain.Vo; + +import java.math.BigDecimal; + +/** + * @author : jingjy + * @date : 2021/5/14 16:34 + */ +public class CityDataVo { + private String cityName; + private String dateRange; + private BigDecimal saleNumber; + private BigDecimal entryNumber; + private String dateRange2; + private BigDecimal saleNumber2; + private BigDecimal entryNumber2; + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public BigDecimal getSaleNumber() { + return saleNumber; + } + + public void setSaleNumber(BigDecimal saleNumber) { + this.saleNumber = saleNumber; + } + + public BigDecimal getEntryNumber() { + return entryNumber; + } + + public void setEntryNumber(BigDecimal entryNumber) { + this.entryNumber = entryNumber; + } + + public BigDecimal getSaleNumber2() { + return saleNumber2; + } + + public void setSaleNumber2(BigDecimal saleNumber2) { + this.saleNumber2 = saleNumber2; + } + + public BigDecimal getEntryNumber2() { + return entryNumber2; + } + + public void setEntryNumber2(BigDecimal entryNumber2) { + this.entryNumber2 = entryNumber2; + } + + public String getDateRange() { + return dateRange; + } + + public void setDateRange(String dateRange) { + this.dateRange = dateRange; + } + + public String getDateRange2() { + return dateRange2; + } + + public void setDateRange2(String dateRange2) { + this.dateRange2 = dateRange2; + } + + public CityDataVo() { + } + + public CityDataVo(String cityName, String dateRange, BigDecimal saleNumber, BigDecimal entryNumber, String dateRange2, BigDecimal saleNumber2, BigDecimal entryNumber2) { + this.cityName = cityName; + this.dateRange = dateRange; + this.saleNumber = saleNumber; + this.entryNumber = entryNumber; + this.dateRange2 = dateRange2; + this.saleNumber2 = saleNumber2; + this.entryNumber2 = entryNumber2; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/ContractStatus.java b/src/main/java/com/gk/hotwork/Domain/Vo/ContractStatus.java new file mode 100644 index 0000000..b7b5634 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/ContractStatus.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Domain.Vo; + +public class ContractStatus { + + public static final String WAIT_SUBMIT = "待提交"; + + public static final String WAIT_CONFIRM = "待确认"; + + public static final String Confirm_Product = "确认生产"; + + public static final String Refuse_Product = "拒绝生产"; + + public static final String Generated = "已生成"; + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/DailySaleReport.java b/src/main/java/com/gk/hotwork/Domain/Vo/DailySaleReport.java new file mode 100644 index 0000000..5bb9ec4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/DailySaleReport.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Domain.Vo; + +import java.math.BigDecimal; + +/** + * @author : jingjy + * @date : 2021/4/23 14:19 + */ +public class DailySaleReport { + /** 流向码 **/ + private String itemCode; + /** 商品名称 **/ + private String itemName; + /** 销售数量 **/ + private Integer saleNum; + /** 销售金额 **/ + private BigDecimal saleAmount; + /** 退货数量 **/ + private Integer returnNum; + /** 退货金额 **/ + private BigDecimal returnAmount; + /** 营业额 **/ + private BigDecimal turnover; + + public String getItemCode() { + return itemCode; + } + + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Integer getSaleNum() { + return saleNum; + } + + public void setSaleNum(Integer saleNum) { + this.saleNum = saleNum; + } + + public BigDecimal getSaleAmount() { + return saleAmount; + } + + public void setSaleAmount(BigDecimal saleAmount) { + this.saleAmount = saleAmount; + } + + public Integer getReturnNum() { + return returnNum; + } + + public void setReturnNum(Integer returnNum) { + this.returnNum = returnNum; + } + + public BigDecimal getReturnAmount() { + return returnAmount; + } + + public void setReturnAmount(BigDecimal returnAmount) { + this.returnAmount = returnAmount; + } + + public BigDecimal getTurnover() { + return turnover; + } + + public void setTurnover(BigDecimal turnover) { + this.turnover = turnover; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/DealingRangeVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/DealingRangeVo.java new file mode 100644 index 0000000..1aeb6da --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/DealingRangeVo.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Domain.Vo; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/5/14 8:37 + */ +public class DealingRangeVo { + private Integer sn; + + private Boolean checked; + + private List<String> checkMore; + + private String name; + + public Boolean getChecked() { + return checked; + } + + public void setChecked(Boolean checked) { + this.checked = checked; + } + + public List<String> getCheckMore() { + return checkMore; + } + + public void setCheckMore(List<String> checkMore) { + this.checkMore = checkMore; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSn() { + return sn; + } + + public void setSn(Integer sn) { + this.sn = sn; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/DepartmentVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/DepartmentVo.java new file mode 100644 index 0000000..c626af6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/DepartmentVo.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Domain.Vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.gk.hotwork.Domain.DepartmentInfo; + +import java.io.Serializable; +import java.util.Date; + +public class DepartmentVo extends DepartmentInfo { + + /** 是否为涉及部门 isinvolve **/ + private Byte isinvolve; + + public Byte getIsinvolve() { + return isinvolve; + } + + public void setIsinvolve(Byte isinvolve) { + this.isinvolve = isinvolve; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/DirectionDetail.java b/src/main/java/com/gk/hotwork/Domain/Vo/DirectionDetail.java new file mode 100644 index 0000000..5525a0f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/DirectionDetail.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.Domain.Vo; + +/** + * @author : jingjy + * @date : 2021/3/19 9:15 + * 流向码解析结果接收 + */ +public class DirectionDetail { + + /** 产品条码 */ + private String itemCode ; + /** 日期码*/ + private String dateCode ; + /** 序列号 */ + private String serialNo; + /** 箱码 */ + private String boxNo ; + /** 解析之前的编码 */ + private String originalCode; + /** 长度 */ + private Integer length; + + public String getItemCode() { + return itemCode; + } + + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getDateCode() { + return dateCode; + } + + public void setDateCode(String dateCode) { + this.dateCode = dateCode; + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo; + } + + public String getBoxNo() { + return boxNo; + } + + public void setBoxNo(String boxNo) { + this.boxNo = boxNo; + } + + public String getOriginalCode() { + return originalCode; + } + + public void setOriginalCode(String originalCode) { + this.originalCode = originalCode; + } + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/EquipmentVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/EquipmentVo.java new file mode 100644 index 0000000..a3d53c4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/EquipmentVo.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.EquipmentInfo; + +public class EquipmentVo extends EquipmentInfo { + + private String token; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/ExamScoreVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/ExamScoreVo.java new file mode 100644 index 0000000..427357a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/ExamScoreVo.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.ExamScoreInfo; + +public class ExamScoreVo extends ExamScoreInfo { + + private Byte ispass; + + public Byte getIspass() { + return ispass; + } + + public void setIspass(Byte ispass) { + this.ispass = ispass; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/GenerateCode.java b/src/main/java/com/gk/hotwork/Domain/Vo/GenerateCode.java new file mode 100644 index 0000000..c1d5e34 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/GenerateCode.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.Domain.Vo; + +import java.util.Calendar; + +public class GenerateCode { + + public static String generateProduct(){ + String code = ""; + Calendar calendar = Calendar.getInstance(); + String year = String.valueOf(calendar.get(Calendar.YEAR)); + int month = calendar.get(Calendar.MONTH)+1; + int day = calendar.get(Calendar.DATE); + String two = year.substring(year.length()-2); + String four = changeMd(month,day); + code = two + four; + return code; + } + + private static String changeMd(int month, int day) { + String three = ""; + String four = ""; + + if (month < 10){ + three = String.valueOf(month); + }else { + three = String.valueOf(ConvetInt2Char(month - 10)); + } + + if (day < 10){ + four = String.valueOf(day); + }else { + four = String.valueOf(ConvetInt2Char(day - 10)); + } + + return three + four; + } + + private static char ConvetInt2Char(int i){ + return (char)(i + 'A'); + } + + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/HelpDocVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/HelpDocVo.java new file mode 100644 index 0000000..b04275a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/HelpDocVo.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.HelpDocInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * @author : jingjy + * @date : 2021/6/16 13:53 + */ +public class HelpDocVo extends HelpDocInfo { + private MultipartFile file; + + public MultipartFile getFile() { + return file; + } + + public void setFile(MultipartFile file) { + this.file = file; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerAppVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerAppVo.java new file mode 100644 index 0000000..a83bc51 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerAppVo.java @@ -0,0 +1,99 @@ +package com.gk.hotwork.Domain.Vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; +import com.gk.hotwork.Domain.HiddenDangerResource; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +public class HiddenDangerAppVo implements Serializable { + + private Long id; + + /** 隐患级别 level **/ + private HiddenDangerLevel level; + + + private List<String> urls; + + private String note; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private Date rectifydeadline; + + /** 整改措施 rectifymeasure **/ + private String rectifymeasure; + + /** 整改人 rectifier **/ + private String rectifier; + + /** 整改人id rectifyid **/ + private Long rectifierid; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public HiddenDangerLevel getLevel() { + return level; + } + + public void setLevel(HiddenDangerLevel level) { + this.level = level; + } + + public List<String> getUrls() { + return urls; + } + + public void setUrls(List<String> urls) { + this.urls = urls; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + public Date getRectifydeadline() { + return rectifydeadline; + } + + public void setRectifydeadline(Date rectifydeadline) { + this.rectifydeadline = rectifydeadline; + } + + public String getRectifymeasure() { + return rectifymeasure; + } + + public void setRectifymeasure(String rectifymeasure) { + this.rectifymeasure = rectifymeasure; + } + + public String getRectifier() { + return rectifier; + } + + public void setRectifier(String rectifier) { + this.rectifier = rectifier; + } + + public Long getRectifierid() { + return rectifierid; + } + + public void setRectifierid(Long rectifierid) { + this.rectifierid = rectifierid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerBySafeCheckVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerBySafeCheckVo.java new file mode 100644 index 0000000..09185b0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerBySafeCheckVo.java @@ -0,0 +1,90 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +public class HiddenDangerBySafeCheckVo { + + + /** 隐患级别 level **/ + private HiddenDangerLevel level; + + /** 整改截止时间 rectifydeadline **/ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date rectifydeadline; + + /** 整改措施 rectifymeasure **/ + private String rectifymeasure; + + /** 整改人 rectifier **/ + private String rectifier; + + /** 整改人id rectifyid **/ + private Long rectifierid; + + /** 相对文件路径 urls **/ + private List<String> urls; + + /** 备注 urls **/ + private String note; + + public HiddenDangerLevel getLevel() { + return level; + } + + public void setLevel(HiddenDangerLevel level) { + this.level = level; + } + + public Date getRectifydeadline() { + return rectifydeadline; + } + + public void setRectifydeadline(Date rectifydeadline) { + this.rectifydeadline = rectifydeadline; + } + + public String getRectifymeasure() { + return rectifymeasure; + } + + public void setRectifymeasure(String rectifymeasure) { + this.rectifymeasure = rectifymeasure; + } + + public String getRectifier() { + return rectifier; + } + + public void setRectifier(String rectifier) { + this.rectifier = rectifier; + } + + public Long getRectifierid() { + return rectifierid; + } + + public void setRectifierid(Long rectifierid) { + this.rectifierid = rectifierid; + } + + public List<String> getUrls() { + return urls; + } + + public void setUrls(List<String> urls) { + this.urls = urls; + } + + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerVo.java new file mode 100644 index 0000000..57d44a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/HiddenDangerVo.java @@ -0,0 +1,102 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.multipart.MultipartFile; + +import java.io.Serializable; +import java.util.Date; + +public class HiddenDangerVo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + /** 隐患级别 level **/ + private HiddenDangerLevel level; + + /** 整改截止时间 rectifydeadline **/ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + private Date rectifydeadline; + + /** 整改措施 rectifymeasure **/ + private String rectifymeasure; + + /** 整改人 rectifier **/ + private String rectifier; + + /** 整改人id rectifyid **/ + private Long rectifierid; + + private MultipartFile[] files; + + private String note; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public HiddenDangerLevel getLevel() { + return level; + } + + public void setLevel(HiddenDangerLevel level) { + this.level = level; + } + + + public MultipartFile[] getFiles() { + return files; + } + + public void setFiles(MultipartFile[] files) { + this.files = files; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + public Date getRectifydeadline() { + return rectifydeadline; + } + + public void setRectifydeadline(Date rectifydeadline) { + this.rectifydeadline = rectifydeadline; + } + + + public String getRectifymeasure() { + return rectifymeasure; + } + + public void setRectifymeasure(String rectifymeasure) { + this.rectifymeasure = rectifymeasure; + } + + public String getRectifier() { + return rectifier; + } + + public void setRectifier(String rectifier) { + this.rectifier = rectifier; + } + + + public Long getRectifierid() { + return rectifierid; + } + + public void setRectifierid(Long rectifierid) { + this.rectifierid = rectifierid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/Menu.java b/src/main/java/com/gk/hotwork/Domain/Vo/Menu.java new file mode 100644 index 0000000..0918c43 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/Menu.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.PermissionInfo; + +import java.util.List; + +public class Menu extends PermissionInfo { + + private List<Menu> children; + + public List<Menu> getChildren() { + return children; + } + + public void setChildren(List<Menu> children) { + this.children = children; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/PageInfoExtension.java b/src/main/java/com/gk/hotwork/Domain/Vo/PageInfoExtension.java new file mode 100644 index 0000000..4ccf57a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/PageInfoExtension.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Domain.Vo; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +public class PageInfoExtension<T> extends Page { + + public PageInfoExtension(Page pageInfo) { + this.records = pageInfo.getRecords(); + this.current = pageInfo.getCurrent(); + this.size = pageInfo.getSize(); + this.total = pageInfo.getTotal(); + } + + private T extension; + + public T getExtension() { + return extension; + } + + public void setExtension(T extension) { + this.extension = extension; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/PageQuery.java b/src/main/java/com/gk/hotwork/Domain/Vo/PageQuery.java new file mode 100644 index 0000000..51b1fa5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/PageQuery.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.Domain.Vo; + +public class PageQuery<T> { + + private Long pageSize; + + private Long pageIndex; + + private T searchParams; + + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } + + public Long getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + } + + public T getSearchParams() { + return searchParams; + } + + public void setSearchParams(T searchParams) { + this.searchParams = searchParams; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RegisterVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RegisterVo.java new file mode 100644 index 0000000..e697c43 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RegisterVo.java @@ -0,0 +1,88 @@ +package com.gk.hotwork.Domain.Vo; + +import java.io.Serializable; + +public class RegisterVo implements Serializable { + + //手机号 + private String username; + //密码 + private String password; + //真实姓名 + private String realname; + //身份证 + private String idcard; + //单位 + private String company; + //单位id + private Long companyid; + //部门 + private Long department; + //职位 + private String job; + + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public Long getDepartment() { + return department; + } + + public void setDepartment(Long department) { + this.department = department; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public Long getCompanyid() { + return companyid; + } + + public void setCompanyid(Long companyid) { + this.companyid = companyid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/ResultVO.java b/src/main/java/com/gk/hotwork/Domain/Vo/ResultVO.java new file mode 100644 index 0000000..caf84ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/ResultVO.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.Domain.Vo; + + +import com.gk.hotwork.Domain.Enum.ResultCodes; + +import java.io.Serializable; + +public class ResultVO<T> implements Serializable { + + private String code; + + private Integer count; + + private String msg; + + private T data; + + public static ResultVO success(){ + ResultVO resultVO = new ResultVO(); + resultVO.setCode(ResultCodes.OK.getCode()); + return resultVO; + } + + public ResultVO() { + } + + + public ResultVO(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public ResultVO(ResultCodes code, T data) { + this.code = code.getCode(); + this.msg = code.getDesc(); + this.data = data; + } + + + public ResultVO(ResultCodes code) { + this.code = code.getCode(); + this.msg = code.getDesc(); + } + + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskAnaUintExoprtVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskAnaUintExoprtVo.java new file mode 100644 index 0000000..f939456 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskAnaUintExoprtVo.java @@ -0,0 +1,67 @@ +package com.gk.hotwork.Domain.Vo; + + +public class RiskAnaUintExoprtVo { + + /** + * 危险源编码 hazard_code + **/ + private String hazardCode; + + /** + * 安全风险分析对象所属部门 hazard_dep + **/ + private String hazardDep; + + /** + * 安全风险分析对象所属部分负责人姓名 hazard_liable_person + **/ + private String hazardLiablePerson; + + /** + * 安全风险分析单元名称 risk_uint_name + **/ + private String riskUnitName; + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getHazardDep() { + return hazardDep; + } + + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep; + } + + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public RiskAnaUintExoprtVo() { + } + + public RiskAnaUintExoprtVo(String hazardCode, String hazardDep, String hazardLiablePerson, String riskUnitName) { + this.hazardCode = hazardCode; + this.hazardDep = hazardDep; + this.hazardLiablePerson = hazardLiablePerson; + this.riskUnitName = riskUnitName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskControlMeasureExportVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskControlMeasureExportVo.java new file mode 100644 index 0000000..a25eb86 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskControlMeasureExportVo.java @@ -0,0 +1,136 @@ +package com.gk.hotwork.Domain.Vo; + + + +public class RiskControlMeasureExportVo { + + /** 安全风险事件名称 risk_event_name **/ + private String riskEventName; + + /** + * 自动化监控:1;隐患排查2 data_src + **/ + private String dataSrc; + + /** + * 管控措施描述 risk_measure_desc + **/ + private String riskMeasureDesc; + + /** + * classify1 + **/ + private String classify1; + + /** + * classify2 + **/ + private String classify2; + + /** + * 企业自己定义 classify3 + **/ + private String classify3; + + /** + * 隐患排查内容 troubleshoot_content + **/ + private String troubleshootContent; + + /** + * --周期时间数值 time_effect + **/ + private String timeEffect; + + /** + * --周期时间单位 time_unit + **/ + private String timeUnit; + + public String getTimeEffect() { + return timeEffect; + } + + public void setTimeEffect(String timeEffect) { + this.timeEffect = timeEffect; + } + + public String getTimeUnit() { + return timeUnit; + } + + public void setTimeUnit(String timeUnit) { + this.timeUnit = timeUnit; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getDataSrc() { + return dataSrc; + } + + public void setDataSrc(String dataSrc) { + this.dataSrc = dataSrc; + } + + public String getRiskMeasureDesc() { + return riskMeasureDesc; + } + + public void setRiskMeasureDesc(String riskMeasureDesc) { + this.riskMeasureDesc = riskMeasureDesc; + } + + public String getClassify1() { + return classify1; + } + + public void setClassify1(String classify1) { + this.classify1 = classify1; + } + + public String getClassify2() { + return classify2; + } + + public void setClassify2(String classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public RiskControlMeasureExportVo() { + } + + public RiskControlMeasureExportVo(String riskEventName, String dataSrc, String riskMeasureDesc, String classify1, String classify2, String classify3, String troubleshootContent, String timeEffect, String timeUnit) { + this.riskEventName = riskEventName; + this.dataSrc = dataSrc; + this.riskMeasureDesc = riskMeasureDesc; + this.classify1 = classify1; + this.classify2 = classify2; + this.classify3 = classify3; + this.troubleshootContent = troubleshootContent; + this.timeEffect = timeEffect; + this.timeUnit = timeUnit; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskEventExportVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskEventExportVo.java new file mode 100644 index 0000000..3caf76f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskEventExportVo.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.Domain.Vo; + +public class RiskEventExportVo { + + /** 安全风险事件名称 risk_event_name **/ + private String riskEventName; + + /** + * 安全风险分析单元名称 risk_uint_name + **/ + private String riskUnitName; + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public RiskEventExportVo() { + } + + public RiskEventExportVo(String riskEventName, String riskUnitName) { + this.riskEventName = riskEventName; + this.riskUnitName = riskUnitName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskMapVO.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskMapVO.java new file mode 100644 index 0000000..d536dc3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskMapVO.java @@ -0,0 +1,113 @@ +package com.gk.hotwork.Domain.Vo; + +import java.util.Date; + +public class RiskMapVO { + private Long id; + + //状态 0-正常 1-物理删除 + private Byte status; + + //图片路径 + private String img; + + //创建人ID + private Long createUid; + + //创建时间 + private Date createTime; + + private Long editUid; + + //最后编辑时间 + private Date editTime; + + //创建人名字 + private String createUname; + + //最后编辑人名字 + private String editUname; + + //描述 + private String descInfo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getEditUid() { + return editUid; + } + + public void setEditUid(Long editUid) { + this.editUid = editUid; + } + + public Date getEditTime() { + return editTime; + } + + public void setEditTime(Date editTime) { + this.editTime = editTime; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public String getEditUname() { + return editUname; + } + + public void setEditUname(String editUname) { + this.editUname = editUname; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceSearchVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceSearchVo.java new file mode 100644 index 0000000..1551464 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceSearchVo.java @@ -0,0 +1,127 @@ +package com.gk.hotwork.Domain.Vo; + +import java.util.Date; + +/** + * 风险源综合查询条件 + */ +public class RiskSourceSearchVo { + + //风险源名称 + private String name; + + //风险源类型,1-设施设备,2-作业活动 + private Byte type; + + //风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险 + private Byte level; + + //状态,1-有效,2-无效,3-删除 + private Byte status; + + //区域位置 + private String location; + + //所属部门ID + private Long depId; + + //所属部门名称 + private String depName; + + + private Date startTime; + + private Date endTime; + + private Long pageIndex; + + private Long pageSize; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + } + + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceVo.java new file mode 100644 index 0000000..496e4fb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/RiskSourceVo.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.Domain.Vo; + +public class RiskSourceVo { + + //风险源名称 + private String name; + + //风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险 + private Byte level; + + //可能导致的事故描述 + private String accidentDesc; + + //区域位置 + private String location; + + //所属部门名称 + private String depName; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public String getAccidentDesc() { + return accidentDesc; + } + + public void setAccidentDesc(String accidentDesc) { + this.accidentDesc = accidentDesc; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/SearchResultVO.java b/src/main/java/com/gk/hotwork/Domain/Vo/SearchResultVO.java new file mode 100644 index 0000000..8a42a4e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/SearchResultVO.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Domain.Vo; + + +import com.gk.hotwork.Domain.Enum.ResultCodes; + +public class +SearchResultVO<T> extends ResultVO<T>{ + + private boolean usePage; + + private Long total; + + private Long pages; + + private Long pageSize; + + private Long pageIndex; + + + public SearchResultVO() { + } + + public static SearchResultVO success(){ + SearchResultVO searchResultVO = new SearchResultVO(); + searchResultVO.setCode(ResultCodes.OK.getCode()); + return searchResultVO; + } + + public SearchResultVO(boolean usePage, Long pageIndex, Long pageSize, Long pages, Long total , T data, ResultCodes resultCode) { + super(resultCode, data); + this.usePage = usePage; + this.total = total; + this.pages = pages; + this.pageSize = pageSize; + this.pageIndex = pageIndex; + } + + + + + public boolean isUsePage() { + return usePage; + } + + public void setUsePage(boolean usePage) { + this.usePage = usePage; + } + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } + + public Long getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + } + + public Long getPages() { + return pages; + } + + public void setPages(Long pages) { + this.pages = pages; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/SelfCheckVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/SelfCheckVo.java new file mode 100644 index 0000000..074f264 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/SelfCheckVo.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.SelfCheckInfo; + +/** + * @author : jingjy + * @date : 2021/8/26 13:59 + */ +public class SelfCheckVo extends SelfCheckInfo { + private Byte checked; + + private Integer num; + + public Byte getChecked() { + return checked; + } + + public void setChecked(Byte checked) { + this.checked = checked; + } + + public Integer getNum() { + return num; + } + + public void setNum(Integer num) { + this.num = num; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/SortData.java b/src/main/java/com/gk/hotwork/Domain/Vo/SortData.java new file mode 100644 index 0000000..e1bfd1a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/SortData.java @@ -0,0 +1,65 @@ +package com.gk.hotwork.Domain.Vo; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.lang.reflect.Field; +import java.util.Comparator; + + +public class SortData { + public List<?> sortByInt(List<?> list, final String param ,Byte order){ + //自定义Comparator对象,自定义排序 + Comparator c = new Comparator() { + @Override + public int compare(Object o1, Object o2) { + try { + Field field1 = o1.getClass().getDeclaredField(param); + Field field2 = o2.getClass().getDeclaredField(param); + field1.setAccessible(true); + field2.setAccessible(true); +// if(null == field1.get(o1) || null == field2.get(o2)){ +// return 0; +// } + if((Integer)field1.get(o1)<(Integer)field2.get(o2)){ + return 1; + }else if((Integer)field1.get(o1)>(Integer)field2.get(o2)){ + return -1; + }else { + return 0; + } + //注意!!返回值必须是一对相反数,否则无效。jdk1.7以后就是这样。 + } catch (Exception e) { + e.printStackTrace(); + } + return 1; + } + }; + if(order == 1){ + Collections.sort(list, c); + }else { + Collections.sort(list, c.reversed()); + } + + return list; + } + + public List<?> Pagination(Integer pageNum, Integer pageSize, List<?> dataList) { + Integer totalCount = dataList.size(); + List<?> result = new ArrayList<>(); + if (pageSize != null) { + // 默认页面大小为10 + pageSize = pageSize > 0 ? pageSize : 10; + } + if (pageNum != null) { + pageNum = pageNum > 0 ? pageNum : 0; + } + + Integer beginindex = (pageNum-1)*pageSize; + Integer endindex = pageNum * pageSize < totalCount ? pageNum * pageSize : totalCount; + + result = dataList.subList(beginindex,endindex); + return result; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/SortTime.java b/src/main/java/com/gk/hotwork/Domain/Vo/SortTime.java new file mode 100644 index 0000000..69b21c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/SortTime.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.Domain.Vo; + +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.lang.reflect.Field; +import java.util.Comparator; + + +public class SortTime { + public List<?> sortByInt(List<?> list, final String param ,Byte order){ + //自定义Comparator对象,自定义排序 + Comparator c = new Comparator() { + @Override + public int compare(Object o1, Object o2) { + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Field field1 = o1.getClass().getDeclaredField(param); + Field field2 = o2.getClass().getDeclaredField(param); + field1.setAccessible(true); + field2.setAccessible(true); + Date date1 = null; + Date date2 = null; + try { + date1 = (Date)field1.get(o1); + }catch (Exception e){ + e.printStackTrace(); + } + try { + date2 = (Date) field2.get(o2); + }catch (Exception e){ + e.printStackTrace(); + } + + if((int)date1.getTime() < (int) date2.getTime()){ + return 1; + }else if((int)date1.getTime() > (int) date2.getTime()){ + return -1; + }else { + return 0; + } + //注意!!返回值必须是一对相反数,否则无效。jdk1.7以后就是这样。 + } catch (Exception e) { + e.printStackTrace(); + } + return 1; + } + }; + if(order == 1){ + Collections.sort(list, c); + }else { + Collections.sort(list, c.reversed()); + } + + return list; + } + +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/TaskCheck.java b/src/main/java/com/gk/hotwork/Domain/Vo/TaskCheck.java new file mode 100644 index 0000000..97a47e6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/TaskCheck.java @@ -0,0 +1,76 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.TaskEnclosure; +import com.gk.hotwork.Domain.TaskReview; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/9/1 17:00 + */ +public class TaskCheck { + @NotBlank(message = "任务编码不能为空") + private String code; + + private List<EquipmentInfo> equipments; + + private TaskReview taskReview; + + private String content; + + private List<TaskEnclosure>resources; + + private String checkDeviceList; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public TaskReview getTaskReview() { + return taskReview; + } + + public void setTaskReview(TaskReview taskReview) { + this.taskReview = taskReview; + } + + public List<EquipmentInfo> getEquipments() { + return equipments; + } + + public void setEquipments(List<EquipmentInfo> equipments) { + this.equipments = equipments; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public List<TaskEnclosure> getResources() { + return resources; + } + + public void setResources(List<TaskEnclosure> resources) { + this.resources = resources; + } + + public String getCheckDeviceList() { + return checkDeviceList; + } + + public void setCheckDeviceList(String checkDeviceList) { + this.checkDeviceList = checkDeviceList; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/TaskEnclosureVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/TaskEnclosureVo.java new file mode 100644 index 0000000..f3da77b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/TaskEnclosureVo.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.TaskEnclosure; +import org.springframework.web.multipart.MultipartFile; + +/** + * @author : jingjy + * @date : 2021/8/27 14:39 + */ +public class TaskEnclosureVo extends TaskEnclosure { + private MultipartFile[] file; + + public MultipartFile[] getFile() { + return file; + } + + public void setFile(MultipartFile[] file) { + this.file = file; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/TaskStatistics.java b/src/main/java/com/gk/hotwork/Domain/Vo/TaskStatistics.java new file mode 100644 index 0000000..9680d8c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/TaskStatistics.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Domain.Vo; + +/** + * @author : jingjy + * @date : 2021/10/20 16:23 + */ +public class TaskStatistics { + private Integer countNum; + + private String type; + + private String constructionunit; + + public Integer getCountNum() { + return countNum; + } + + public void setCountNum(Integer countNum) { + this.countNum = countNum; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getConstructionunit() { + return constructionunit; + } + + public void setConstructionunit(String constructionunit) { + this.constructionunit = constructionunit; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/TaskVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/TaskVo.java new file mode 100644 index 0000000..907f557 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/TaskVo.java @@ -0,0 +1,111 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.*; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/19 16:55 + */ +public class TaskVo extends TaskInfo{ + private List<TaskWorkerVo>taskWorkers; + + private List<TaskAnalysis>taskAnalyses; + + private List<TaskSecurity>taskSecurities; + + private List<TaskEquipment> taskEquipments; + + private List<TaskEnclosure> resources; + + private List<TaskInvolveDepartment> departments; + + private List<SubTaskInfo> subTaskInfos; + + private List<TaskReview> taskReviews; + + private TaskRisk taskRisk; + + private List<EquipmentInfo>supervisorEquipments; + + public List<TaskWorkerVo> getTaskWorkers() { + return taskWorkers; + } + + public void setTaskWorkers(List<TaskWorkerVo> taskWorkers) { + this.taskWorkers = taskWorkers; + } + + public List<TaskAnalysis> getTaskAnalyses() { + return taskAnalyses; + } + + public void setTaskAnalyses(List<TaskAnalysis> taskAnalyses) { + this.taskAnalyses = taskAnalyses; + } + + public List<TaskSecurity> getTaskSecurities() { + return taskSecurities; + } + + public void setTaskSecurities(List<TaskSecurity> taskSecurities) { + this.taskSecurities = taskSecurities; + } + + public List<TaskEnclosure> getResources() { + return resources; + } + + public void setResources(List<TaskEnclosure> resources) { + this.resources = resources; + } + + public List<TaskInvolveDepartment> getDepartments() { + return departments; + } + + public void setDepartments(List<TaskInvolveDepartment> departments) { + this.departments = departments; + } + + public TaskRisk getTaskRisk() { + return taskRisk; + } + + public void setTaskRisk(TaskRisk taskRisk) { + this.taskRisk = taskRisk; + } + + public List<TaskEquipment> getTaskEquipments() { + return taskEquipments; + } + + public void setTaskEquipments(List<TaskEquipment> taskEquipments) { + this.taskEquipments = taskEquipments; + } + + public List<EquipmentInfo> getSupervisorEquipments() { + return supervisorEquipments; + } + + public void setSupervisorEquipments(List<EquipmentInfo> supervisorEquipments) { + this.supervisorEquipments = supervisorEquipments; + } + + public List<SubTaskInfo> getSubTaskInfos() { + return subTaskInfos; + } + + public void setSubTaskInfos(List<SubTaskInfo> subTaskInfos) { + this.subTaskInfos = subTaskInfos; + } + + public List<TaskReview> getTaskReviews() { + return taskReviews; + } + + public void setTaskReviews(List<TaskReview> taskReviews) { + this.taskReviews = taskReviews; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/TaskWorkerVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/TaskWorkerVo.java new file mode 100644 index 0000000..e0b8db7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/TaskWorkerVo.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.TaskWorker; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/9/2 14:43 + */ +public class TaskWorkerVo extends TaskWorker { + private List<EquipmentInfo>equipments; + + private String longitude; + + private String latitude; + + private String photoAddress; + + public List<EquipmentInfo> getEquipments() { + return equipments; + } + + public void setEquipments(List<EquipmentInfo> equipments) { + this.equipments = equipments; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getPhotoAddress() { + return photoAddress; + } + + public void setPhotoAddress(String photoAddress) { + this.photoAddress = photoAddress; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/UserVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/UserVo.java new file mode 100644 index 0000000..98e69fc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/UserVo.java @@ -0,0 +1,184 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.AuthorizationInfo; +import com.gk.hotwork.Domain.CompanyInfo; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class UserVo extends UserInfo { + private String token; + + private Long tokenexpired; + + private Object roles; + + private String roleType; + + private Long logintime; + + private String auth; + + private Byte isMainCompany; + + private List<AuthorizationInfo> authorizationCodes; + /** 是否通过考试 **/ + private Byte ispass; + /** 考试有效期开始时间 **/ + private Date starttime; + /** 考试有效期结束时间 **/ + private Date endtime; + + private Object exam; + + private String branch; + + private String number; + + private String code; + + private String roleSign; + + private CompanyInfo companyInfo; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Object getRoles() { + return roles; + } + + public void setRoles(Object roles) { + this.roles = roles; + } + + public Long getTokenexpired() { + return tokenexpired; + } + + public void setTokenexpired(Long tokenexpired) { + this.tokenexpired = tokenexpired; + } + + public String getRoleType() { + return roleType; + } + + public void setRoleType(String roleType) { + this.roleType = roleType; + } + + public Long getLogintime() { + return logintime; + } + + public void setLogintime(Long logintime) { + this.logintime = logintime; + } + + public String getAuth() { + return auth; + } + + public void setAuth(String auth) { + this.auth = auth; + } + + public List<AuthorizationInfo> getAuthorizationCodes() { + return authorizationCodes; + } + + public void setAuthorizationCodes(List<AuthorizationInfo> authorizationCodes) { + this.authorizationCodes = authorizationCodes; + } + + public Byte getIspass() { + return ispass; + } + + public void setIspass(Byte ispass) { + this.ispass = ispass; + } + + public Date getStarttime() { + return starttime; + } + + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + public Date getEndtime() { + return endtime; + } + + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + public Object getExam() { + return exam; + } + + public void setExam(Object exam) { + this.exam = exam; + } + + public Byte getIsMainCompany() { + return isMainCompany; + } + + public void setIsMainCompany(Byte isMainCompany) { + this.isMainCompany = isMainCompany; + } + + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + @Override + public String getRoleSign() { + return roleSign; + } + + @Override + public void setRoleSign(String roleSign) { + this.roleSign = roleSign; + } + + public CompanyInfo getCompanyInfo() { + return companyInfo; + } + + public void setCompanyInfo(CompanyInfo companyInfo) { + this.companyInfo = companyInfo; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/WorkCertVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/WorkCertVo.java new file mode 100644 index 0000000..cc4a109 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/WorkCertVo.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Domain.Vo; + +import com.gk.hotwork.Domain.WorkCertInfo; +import org.springframework.web.multipart.MultipartFile; + +public class WorkCertVo extends WorkCertInfo { + + private MultipartFile file; + + + public MultipartFile getFile() { + return file; + } + + public void setFile(MultipartFile file) { + this.file = file; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/WorkShowTaskVo.java b/src/main/java/com/gk/hotwork/Domain/Vo/WorkShowTaskVo.java new file mode 100644 index 0000000..41bbded --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/WorkShowTaskVo.java @@ -0,0 +1,144 @@ +package com.gk.hotwork.Domain.Vo; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.util.Date; + +public class WorkShowTaskVo implements Serializable { + + /** 申请单位 unit **/ + private String unit; + + /** 申请人部门 unit **/ + private String department; + + /** 申请人 applicant **/ + private String applicant; + + /** 作业证编号 code **/ + private String code; + + /** 动火作业级别(特级、一级、二级) level **/ + private Byte level; + + /** 动火地点 area **/ + private String area; + + /** 动火方式 mode **/ + private String mode; + + /** 负责人 director **/ + private String director; + + /** 开始时间 starttime **/ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date starttime; + + /** 结束时间 endtime **/ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date endtime; + + /** 涉及的其他特殊作业 othertask **/ + private String othertask; + + /** 危害辨识(火灾、触电) hazard **/ + private String hazard; + + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getApplicant() { + return applicant; + } + + public void setApplicant(String applicant) { + this.applicant = applicant; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public String getDirector() { + return director; + } + + public void setDirector(String director) { + this.director = director; + } + + public Date getStarttime() { + return starttime; + } + + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + public Date getEndtime() { + return endtime; + } + + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + public String getOthertask() { + return othertask; + } + + public void setOthertask(String othertask) { + this.othertask = othertask; + } + + public String getHazard() { + return hazard; + } + + public void setHazard(String hazard) { + this.hazard = hazard; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskInfo.java b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskInfo.java new file mode 100644 index 0000000..6a0155f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskInfo.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Domain.Vo.specTask; + +public class ActiveTaskInfo { + private Long id; + + private String code; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskLocationDto.java b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskLocationDto.java new file mode 100644 index 0000000..c686108 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/ActiveTaskLocationDto.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.Domain.Vo.specTask; + +import java.util.List; + +public class ActiveTaskLocationDto { + + private Long id; + + private String code; + + private String lon; + + private String lat; + + private List<String> taskTypeList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getLon() { + return lon; + } + + public void setLon(String lon) { + this.lon = lon; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public List<String> getTaskTypeList() { + return taskTypeList; + } + + public void setTaskTypeList(List<String> taskTypeList) { + this.taskTypeList = taskTypeList; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/Vo/specTask/TaskLocation.java b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/TaskLocation.java new file mode 100644 index 0000000..ab05db0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/Vo/specTask/TaskLocation.java @@ -0,0 +1,54 @@ +package com.gk.hotwork.Domain.Vo.specTask; + +public class TaskLocation { + + private Long id; + + private Long taskId; + + private String code; + + private String lon; + + private String lat; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getLon() { + return lon; + } + + public void setLon(String lon) { + this.lon = lon; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/WarningInfo.java b/src/main/java/com/gk/hotwork/Domain/WarningInfo.java new file mode 100644 index 0000000..d7be47e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/WarningInfo.java @@ -0,0 +1,171 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("warning") +public class WarningInfo { + //预警 + public static Byte EARLY_WARNING = 2; + //报警 + public static Byte WARNING = 3; + //故障 + public static Byte FAULT = 1; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 告警类型(1.故障;2.预警;3.报警) type **/ + private Byte type; + + /** 告警内容 content **/ + private String content; + + /** 告警发生时间 createdat **/ + private Date createdat; + + /** 告警对应任务编号 taskcode **/ + private String taskcode; + + /** 告警对应动火人 worker **/ + private String worker; + + /** 是否处理(0.否;1.是) isdeal **/ + private Byte isdeal; + + /** 处理时间 dealat **/ + private Date dealat; + + /** 处理人 dealby **/ + private String dealby; + + /** 标记 flag **/ + private Byte flag; + + /** 是否发送短信 issms **/ + private Byte issms; + + private Byte tasktype; + + /** id **/ + public Long getId() { + return id; + } + + /** id **/ + public void setId(Long id) { + this.id = id; + } + + /** 告警类型(1.故障;2.预警;3.报警) type **/ + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + /** 告警内容 content **/ + public String getContent() { + return content; + } + + /** 告警内容 content **/ + public void setContent(String content) { + this.content = content == null ? null : content.trim(); + } + + /** 告警发生时间 createdat **/ + public Date getCreatedat() { + return createdat; + } + + /** 告警发生时间 createdat **/ + public void setCreatedat(Date createdat) { + this.createdat = createdat; + } + + /** 告警对应任务编号 taskcode **/ + public String getTaskcode() { + return taskcode; + } + + /** 告警对应任务编号 taskcode **/ + public void setTaskcode(String taskcode) { + this.taskcode = taskcode == null ? null : taskcode.trim(); + } + + public String getWorker() { + return worker; + } + + public void setWorker(String worker) { + this.worker = worker; + } + + /** 是否处理(0.否;1.是) isdeal **/ + public Byte getIsdeal() { + return isdeal; + } + + /** 是否处理(0.否;1.是) isdeal **/ + public void setIsdeal(Byte isdeal) { + this.isdeal = isdeal; + } + + /** 处理时间 dealat **/ + public Date getDealat() { + return dealat; + } + + /** 处理时间 dealat **/ + public void setDealat(Date dealat) { + this.dealat = dealat; + } + + /** 处理人 dealby **/ + public String getDealby() { + return dealby; + } + + /** 处理人 dealby **/ + public void setDealby(String dealby) { + this.dealby = dealby == null ? null : dealby.trim(); + } + + /** 标记 flag **/ + public Byte getFlag() { + return flag; + } + + /** 标记 flag **/ + public void setFlag(Byte flag) { + this.flag = flag; + } + + /** 是否发送短信 issms **/ + public Byte getIssms() { + return issms; + } + + /** 是否发送短信 issms **/ + public void setIssms(Byte issms) { + this.issms = issms; + } + + public Byte getTasktype() { + return tasktype; + } + + public void setTasktype(Byte tasktype) { + this.tasktype = tasktype; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/WorkCertInfo.java b/src/main/java/com/gk/hotwork/Domain/WorkCertInfo.java new file mode 100644 index 0000000..ed1a86e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/WorkCertInfo.java @@ -0,0 +1,187 @@ +package com.gk.hotwork.Domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +@TableName("workcert") +public class WorkCertInfo implements Serializable { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + /** 姓名 realname **/ + private String realname; + + /** 手机号 mobile **/ + private String mobile; + + /** 身份证 idcard **/ + private String idcard; + + /** 文件名 certname **/ + private String certname; + + /** 文件路径 certpath **/ + private String certpath; + + private String branch; + + /** 是否健康证 ishealth **/ + private Byte ishealth; + + /** 有效期开始时间 starttime **/ + @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8") + private Date starttime; + + /** 有效期结束时间 endtime **/ + @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8") + private Date endtime; + + /** 创建人 createby **/ + private String createby; + + /** 创建时间 createtime **/ + @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8") + private Date createtime; + + /** 是否删除 isdel **/ + private Byte isdel; + + /** id id **/ + public Long getId() { + return id; + } + + /** id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 姓名 realname **/ + public String getRealname() { + return realname; + } + + /** 姓名 realname **/ + public void setRealname(String realname) { + this.realname = realname == null ? null : realname.trim(); + } + + /** 手机号 mobile **/ + public String getMobile() { + return mobile; + } + + /** 手机号 mobile **/ + public void setMobile(String mobile) { + this.mobile = mobile == null ? null : mobile.trim(); + } + + /** 身份证 idcard **/ + public String getIdcard() { + return idcard; + } + + /** 身份证 idcard **/ + public void setIdcard(String idcard) { + this.idcard = idcard == null ? null : idcard.trim(); + } + + /** 文件名 certname **/ + public String getCertname() { + return certname; + } + + /** 文件名 certname **/ + public void setCertname(String certname) { + this.certname = certname == null ? null : certname.trim(); + } + + /** 文件路径 certpath **/ + public String getCertpath() { + return certpath; + } + + /** 文件路径 certpath **/ + public void setCertpath(String certpath) { + this.certpath = certpath == null ? null : certpath.trim(); + } + + /** 有效期开始时间 starttime **/ + public Date getStarttime() { + return starttime; + } + + /** 有效期开始时间 starttime **/ + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + /** 有效期结束时间 endtime **/ + public Date getEndtime() { + return endtime; + } + + /** 有效期结束时间 endtime **/ + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + /** 创建人 createby **/ + public String getCreateby() { + return createby; + } + + /** 创建人 createby **/ + public void setCreateby(String createby) { + this.createby = createby == null ? null : createby.trim(); + } + + /** 创建时间 createtime **/ + public Date getCreatetime() { + return createtime; + } + + /** 创建时间 createtime **/ + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + /** 是否删除 isdel **/ + public Byte getIsdel() { + return isdel; + } + + /** 是否删除 isdel **/ + public void setIsdel(Byte isdel) { + this.isdel = isdel; + } + + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + public Byte getIshealth() { + return ishealth; + } + + public void setIshealth(Byte ishealth) { + this.ishealth = ishealth; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/co/ContextCacheUser.java b/src/main/java/com/gk/hotwork/Domain/co/ContextCacheUser.java new file mode 100644 index 0000000..1b4e6f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/co/ContextCacheUser.java @@ -0,0 +1,156 @@ +package com.gk.hotwork.Domain.co; + + +import java.io.Serializable; + +public class ContextCacheUser implements Serializable{ + + private static final long serialVersionUID = 8969168986972657466L; + + private Long uid; + + private String username; + + private String realName; + + private String accessToken; + + private Long roleId; + + private String roleCode; + + private Long depId; + + private String depName; + + private String positionId; + + private String positionCode; + + private String phone; + + private String email; + + private Byte type; + + public ContextCacheUser() { + } + + public ContextCacheUser(Long uid, String username, String realName, String phone, String email, Long roleId, String roleCode, Long depId, String depName, Byte type, String accessToken) { + this.uid = uid; + this.username = username; + this.realName = realName; + this.accessToken = accessToken; + this.roleId = roleId; + this.roleCode = roleCode; + this.depId = depId; + this.depName = depName; + this.phone = phone; + this.email = email; + this.type = type; + } + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getRoleCode() { + return roleCode; + } + + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getPositionId() { + return positionId; + } + + public void setPositionId(String positionId) { + this.positionId = positionId; + } + + public String getPositionCode() { + return positionCode; + } + + public void setPositionCode(String positionCode) { + this.positionCode = positionCode; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/DepInfoRPCRespDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/DepInfoRPCRespDTO.java new file mode 100644 index 0000000..177f952 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/DepInfoRPCRespDTO.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class DepInfoRPCRespDTO implements Serializable { + + private Long depId; + + private String depName; + + private String depInfo; + + private Byte status; + + private String statusDesc; + + private Long parentDepId; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getDepInfo() { + return depInfo; + } + + public void setDepInfo(String depInfo) { + this.depInfo = depInfo; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public Long getParentDepId() { + return parentDepId; + } + + public void setParentDepId(Long parentDepId) { + this.parentDepId = parentDepId; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/DepartmentDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/DepartmentDTO.java new file mode 100644 index 0000000..433a0ca --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/DepartmentDTO.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class DepartmentDTO implements Serializable { + + private Long id; + + private String name; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/FourColorMapDto.java b/src/main/java/com/gk/hotwork/Domain/dto/FourColorMapDto.java new file mode 100644 index 0000000..2243f9b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/FourColorMapDto.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.Domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +@ApiModel +public class FourColorMapDto { + + @ApiModelProperty(value = "四色图ID") + private String id; + + @ApiModelProperty(value = "企业类型 1 - 60万吨 , 2 - 130万吨") + private Integer etype; + + @ApiModelProperty(value = "四色图名称") + private String name; + + @ApiModelProperty(value = "四色图类型") + private String type; + + @ApiModelProperty(value = "四色图样式 - 显示文字") + private String text; + + @ApiModelProperty(value = "四色图形状") + private String shapeType; + + @ApiModelProperty(value = "四色图样式 - clampToGround") + private boolean clampToGround; + + @ApiModelProperty(value = "四色图样式 - 颜色") + private String color; + + @ApiModelProperty(value = "绘图形状") + private String geoType; + + @ApiModelProperty(value = "坐标数组数组") + private List<FourColorPointLocateDto> locations; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getEtype() { + return etype; + } + + public void setEtype(Integer etype) { + this.etype = etype; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getShapeType() { + return shapeType; + } + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + public boolean isClampToGround() { + return clampToGround; + } + + public void setClampToGround(boolean clampToGround) { + this.clampToGround = clampToGround; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public String getGeoType() { + return geoType; + } + + public void setGeoType(String geoType) { + this.geoType = geoType; + } + + public List<FourColorPointLocateDto> getLocations() { + return locations; + } + + public void setLocations(List<FourColorPointLocateDto> locations) { + this.locations = locations; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/FourColorPointLocateDto.java b/src/main/java/com/gk/hotwork/Domain/dto/FourColorPointLocateDto.java new file mode 100644 index 0000000..af41d20 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/FourColorPointLocateDto.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.Domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel +public class FourColorPointLocateDto { + + @ApiModelProperty(value = "经度") + private Float lon; + + @ApiModelProperty(value = "纬度") + private Float lat; + + @ApiModelProperty(value = "高度") + private Float hei; + + public Float getLon() { + return lon; + } + + public void setLon(Float lon) { + this.lon = lon; + } + + public Float getLat() { + return lat; + } + + public void setLat(Float lat) { + this.lat = lat; + } + + public Float getHei() { + return hei; + } + + public void setHei(Float hei) { + this.hei = hei; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceDto.java b/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceDto.java new file mode 100644 index 0000000..fa6a752 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceDto.java @@ -0,0 +1,174 @@ +package com.gk.hotwork.Domain.dto; + +import java.util.Date; + +/** + * 风险源 + */ +public class RiskSourceDto{ + + //ID,主键 + private Long id; + + //风险源名称 + private String name; + + //风险源类型,1-设施设备,2-作业活动 + private Byte type; + + //风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险 + private Byte level; + + //状态,1-有效,2-无效,3-删除 + private Byte status; + + //可能导致的事故描述 + private String accidentDesc; + + //区域位置 + private String location; + + //所属部门ID + private Long depId; + + //所属部门名称 + private String depName; + + //创建时间 + private Date createTime; + + //创建人ID + private Long createUid; + + //创建人姓名 + private String createUname; + + //最新编辑时间 + private Date editTime; + + //最新编辑人ID + private Long editUid; + + //最新编辑人姓名 + private String editUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getAccidentDesc() { + return accidentDesc; + } + + public void setAccidentDesc(String accidentDesc) { + this.accidentDesc = accidentDesc; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Date getEditTime() { + return editTime; + } + + public void setEditTime(Date editTime) { + this.editTime = editTime; + } + + public Long getEditUid() { + return editUid; + } + + public void setEditUid(Long editUid) { + this.editUid = editUid; + } + + public String getEditUname() { + return editUname; + } + + public void setEditUname(String editUname) { + this.editUname = editUname; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceUpdateDto.java b/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceUpdateDto.java new file mode 100644 index 0000000..e96f44f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/RiskSourceUpdateDto.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.Domain.dto; + +/** + * 风险源 + */ +public class RiskSourceUpdateDto { + + //ID,主键 + private Long id; + + //风险源名称 + private String name; + + //风险源类型,1-设施设备,2-作业活动 + private Byte type; + + //风险等级,1-低风险,2-一般风险,3-较大风险,4-重大风险 + private Byte level; + + //可能导致的事故描述 + private String accidentDesc; + + //区域位置 + private String location; + + private Long editUid; + + //所属部门ID + private Long depId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public String getAccidentDesc() { + return accidentDesc; + } + + public void setAccidentDesc(String accidentDesc) { + this.accidentDesc = accidentDesc; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getEditUid() { + return editUid; + } + + public void setEditUid(Long editUid) { + this.editUid = editUid; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/UserDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/UserDTO.java new file mode 100644 index 0000000..3066ffa --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/UserDTO.java @@ -0,0 +1,151 @@ +package com.gk.hotwork.Domain.dto; + +import com.baomidou.mybatisplus.annotation.TableField; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class UserDTO implements Serializable { + + private Long id; + + /** 用户名:手机号 username **/ + private String username; + + /** 真实姓名 password **/ + private String realname; + + /** 身份证号 idcard **/ + private String idcard; + + /** 邮箱 email **/ + private String email; + + /** 单位 company **/ + private String company; + + private Long companyid; + + /** 部门 department **/ + private String departmentname; + + private Long department; + + /** 职务 job **/ + private String job; + + /** # 1超级管理员,2管理员,3普通用户 **/ + private Integer type; + + /** + * @Description: 橘色 + */ + private Long roleId; + + private String roleName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public Long getCompanyid() { + return companyid; + } + + public void setCompanyid(Long companyid) { + this.companyid = companyid; + } + + public String getDepartmentname() { + return departmentname; + } + + public void setDepartmentname(String departmentname) { + this.departmentname = departmentname; + } + + public Long getDepartment() { + return department; + } + + public void setDepartment(Long department) { + this.department = department; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/UserDepRPCRespDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/UserDepRPCRespDTO.java new file mode 100644 index 0000000..be889d2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/UserDepRPCRespDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class UserDepRPCRespDTO implements Serializable { + + private static final long serialVersionUID = -1456762388127764076L; + + private Long depId; + + private String depName; + + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/UserEnterpriseRPCRespDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/UserEnterpriseRPCRespDTO.java new file mode 100644 index 0000000..f2b9fb9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/UserEnterpriseRPCRespDTO.java @@ -0,0 +1,68 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class UserEnterpriseRPCRespDTO implements Serializable { + + private static final long serialVersionUID = 7326773787001873585L; + + private Long id; + + private String eid; + + private String uuid; + + private String name; + + private String ownerUid; + + private Byte type; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getEid() { + return eid; + } + + public void setEid(String eid) { + this.eid = eid; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOwnerUid() { + return ownerUid; + } + + public void setOwnerUid(String ownerUid) { + this.ownerUid = ownerUid; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/UserInfoRPCRespDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/UserInfoRPCRespDTO.java new file mode 100644 index 0000000..a3b09cc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/UserInfoRPCRespDTO.java @@ -0,0 +1,138 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class UserInfoRPCRespDTO implements Serializable { + + private static final long serialVersionUID = -525680225326665888L; + + private Long uid; + + private String uuid; + + private String username; + + private String realName; + + private Byte gender; + + private Byte type; + + private Byte status; + + private String phone; + + private String identify; + + private String email; + + private Long depId; + + private Long roleId; + + private Long positionId; + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public Byte getGender() { + return gender; + } + + public void setGender(Byte gender) { + this.gender = gender; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getIdentify() { + return identify; + } + + public void setIdentify(String identify) { + this.identify = identify; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Long getPositionId() { + return positionId; + } + + public void setPositionId(Long positionId) { + this.positionId = positionId; + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/dto/UserRPCRespDTO.java b/src/main/java/com/gk/hotwork/Domain/dto/UserRPCRespDTO.java new file mode 100644 index 0000000..e9cd5d0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/dto/UserRPCRespDTO.java @@ -0,0 +1,87 @@ +package com.gk.hotwork.Domain.dto; + +import java.io.Serializable; + +public class UserRPCRespDTO implements Serializable { + + private String uid; + + private String uuid; + + private String username; + + private String realName; + + private String phone; + + private String email; + + private UserEnterpriseRPCRespDTO enterprise; + + private UserDepRPCRespDTO department; + + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public UserEnterpriseRPCRespDTO getEnterprise() { + return enterprise; + } + + public void setEnterprise(UserEnterpriseRPCRespDTO enterprise) { + this.enterprise = enterprise; + } + + public UserDepRPCRespDTO getDepartment() { + return department; + } + + public void setDepartment(UserDepRPCRespDTO department) { + this.department = department; + } +} diff --git a/src/main/java/com/gk/hotwork/HotworkApplication.java b/src/main/java/com/gk/hotwork/HotworkApplication.java new file mode 100644 index 0000000..e460c44 --- /dev/null +++ b/src/main/java/com/gk/hotwork/HotworkApplication.java @@ -0,0 +1,54 @@ +package com.gk.hotwork; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import org.springframework.transaction.annotation.EnableTransactionManagement; +import org.springframework.web.bind.annotation.CrossOrigin; + +import java.lang.management.ManagementFactory; + + +@EnableScheduling +@CrossOrigin +@EnableAsync +@SpringBootApplication +@EnableTransactionManagement +public class HotworkApplication { + + + + public static void main(String[] args) { + System.setProperty("rocketmq.client.logLevel","ERROR"); + SpringApplication.run(HotworkApplication.class, args); + /** 20220817 此处捕获异常,在启动异常时使用,方便定位启动出错问题 */ +// try { +// SpringApplication.run(HotworkApplication.class, args); +// } catch (Exception e) { +// e.printStackTrace(); +// } + System.out.println("【进程ID】"+ ManagementFactory.getRuntimeMXBean().getName().split("@")[0]); + } + + /** + * 分页插件 + */ + @Bean + public PaginationInterceptor paginationInterceptor() { + return new PaginationInterceptor(); + } + + /**多任务时间调度**/ + @Bean + public TaskScheduler taskScheduler() { + ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); + taskScheduler.setPoolSize(50); + return taskScheduler; + } + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/AppFileInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/AppFileInfoMapper.java new file mode 100644 index 0000000..f0ead90 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/AppFileInfoMapper.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.AppFileInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface AppFileInfoMapper extends BaseMapper<AppFileInfo> { + int deleteByPrimaryKey(Long id); + + AppFileInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(AppFileInfo record); + + int updateByPrimaryKey(AppFileInfo record); + + List<AppFileInfo> selectDataGrid(Page<AppFileInfo> page, Map<String, Object> condition); + + AppFileInfo selectNew(@Param("filetype") String filetype); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/AuthorizationInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/AuthorizationInfoMapper.java new file mode 100644 index 0000000..bf105f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/AuthorizationInfoMapper.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.AuthorizationInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface AuthorizationInfoMapper extends BaseMapper<AuthorizationInfo> { + + AuthorizationInfo selectByUser(@Param("enterprisenumber") String enterprisenumber,@Param("authcode") String authcode); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/BlackListInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/BlackListInfoMapper.java new file mode 100644 index 0000000..117c41b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/BlackListInfoMapper.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.BlackListInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface BlackListInfoMapper extends BaseMapper<BlackListInfo> { + + List<BlackListInfo> selectDataGrid(Map<String, Object> condition, Page<BlackListInfo> page); +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/CompanyInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/CompanyInfoMapper.java new file mode 100644 index 0000000..e8d9ec6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/CompanyInfoMapper.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.CompanyInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface CompanyInfoMapper extends BaseMapper<CompanyInfo> { + + List<CompanyInfo> selectDataGrid(Page<CompanyInfo> page, Map<String, Object> condition); + + CompanyInfo selectExistByName(@Param("id") Long id,@Param("company") String company); + + List<CompanyInfo> selectByAll(); + + CompanyInfo selectExistMain(@Param("id") Long id); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DepartmentInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/DepartmentInfoMapper.java new file mode 100644 index 0000000..21cba15 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DepartmentInfoMapper.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface DepartmentInfoMapper extends BaseMapper<DepartmentInfo> { + + List<DepartmentVo> selectDataGrid(Page<DepartmentVo> page, Map<String, Object> condition); + + DepartmentInfo selectExistByName(@Param("id") Long id,@Param("department") String department); + + List<DepartmentVo> selectByAll(); + + DepartmentInfo selectSafety(@Param("id") Long id); + + Integer selectCountForExam(Map<String, Object> params); + + List<DepartmentInfo> selectPageForExam(Map<String, Object> params); + + DepartmentInfo getInfoByName(String departmentName); + + DepartmentInfo getDepartmentInfoById(Long depId); + + List<DepartmentInfo> listDepByDepIds(@Param("list") List<Long> depIds); + + List<DepartmentInfo> listDepartmentInfoById(); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DeviceLocationMapper.java b/src/main/java/com/gk/hotwork/Mapper/DeviceLocationMapper.java new file mode 100644 index 0000000..336dcc4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DeviceLocationMapper.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Mapper; + +import com.gk.hotwork.Domain.DeviceLocation; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +@Repository +public interface DeviceLocationMapper { + + int insertOne(@Param("slice") String table_slice, @Param("location") DeviceLocation location); + + DeviceLocation selectLatestUserLocation(@Param("slice") String slice, @Param("uid") String deviceNo); + + List<DeviceLocation> selectUserLocations( @Param("slice") String slice, + @Param("uid") String deviceNo, + @Param("starttime") Date starttime, + @Param("endtime")Date endtime); + + void deleteRecordBeforeDays(@Param("slice")String slice,@Param("days") Integer days); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DevicePingMapper.java b/src/main/java/com/gk/hotwork/Mapper/DevicePingMapper.java new file mode 100644 index 0000000..447d1f4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DevicePingMapper.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.DevicePing; +import org.springframework.stereotype.Repository; + +@Repository +public interface DevicePingMapper extends BaseMapper<DevicePing> { +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DevicePresskeyMapper.java b/src/main/java/com/gk/hotwork/Mapper/DevicePresskeyMapper.java new file mode 100644 index 0000000..a64a3af --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DevicePresskeyMapper.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.DevicePressKey; +import org.springframework.stereotype.Repository; + +@Repository +public interface DevicePresskeyMapper extends BaseMapper<DevicePressKey> { +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DictionaryItemInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/DictionaryItemInfoMapper.java new file mode 100644 index 0000000..bc03b68 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DictionaryItemInfoMapper.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DictionaryItemInfo; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface DictionaryItemInfoMapper extends BaseMapper<DictionaryItemInfo> { + + int deleteByPrimaryKey(Long id); + + int insert(DictionaryItemInfo record); + + int insertSelective(DictionaryItemInfo record); + + DictionaryItemInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DictionaryItemInfo record); + + int updateByPrimaryKey(DictionaryItemInfo record); + + List<DictionaryItemInfo> selectDataGrid(Page<DictionaryItemInfo> page, Map<String, Object> condition); + + List<DictionaryTypeInfo> selectExistInfo(@Param("id") Long id,@Param("value") String value,@Param("text") String text); + + List<DictionaryItemInfo> selectByType(@Param("dictionaryType") String dictionaryType); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DictionaryTypeInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/DictionaryTypeInfoMapper.java new file mode 100644 index 0000000..88930ce --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DictionaryTypeInfoMapper.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface DictionaryTypeInfoMapper extends BaseMapper<DictionaryTypeInfo> { + int deleteByPrimaryKey(Long id); + + int insert(DictionaryTypeInfo record); + + int insertSelective(DictionaryTypeInfo record); + + DictionaryTypeInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DictionaryTypeInfo record); + + int updateByPrimaryKey(DictionaryTypeInfo record); + + List<DictionaryTypeInfo> selectDataGrid(Page<DictionaryTypeInfo> page, Map<String, Object> condition); + + List<DictionaryTypeInfo> selectExistInfo(@Param("id") Long id,@Param("code") String code,@Param("text") String text); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/DistrictInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/DistrictInfoMapper.java new file mode 100644 index 0000000..237c72b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/DistrictInfoMapper.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.DistrictInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface DistrictInfoMapper extends BaseMapper<DistrictInfo> { + int deleteByPrimaryKey(Long id); + + DistrictInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DistrictInfo record); + + int updateByPrimaryKey(DistrictInfo record); + + List<DistrictInfo> selectDistrictInfo(@Param("type") String type,@Param("parentcode") String parentcode); + + List<DistrictInfo> selectDistrictByName(@Param("type") String type,@Param("parentname") String parentname,@Param("parenttype") String parenttype); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/ElementManagementMapper.java b/src/main/java/com/gk/hotwork/Mapper/ElementManagementMapper.java new file mode 100644 index 0000000..049b4e2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/ElementManagementMapper.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.ElementManagement; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface ElementManagementMapper extends BaseMapper<ElementManagement> { + + IPage<ElementManagement> selectPages(Page<ElementManagement> page, Map<String, Object> params); + + List<ElementManagement> getParentElement(); + + List<ElementManagement> getElementByType(@Param("type") Integer type); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanFileMapper.java b/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanFileMapper.java new file mode 100644 index 0000000..ae40fe1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanFileMapper.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.EmergencyPlanFile; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +@Repository +public interface EmergencyPlanFileMapper extends BaseMapper<EmergencyPlanFile> { + + List<EmergencyPlanFile> getByEmergencyPlanId(@Param("emergencyPlanId") Long emergencyPlanId); + + void deleteById(@Param("id") Long id ,@Param("updateBy") String updateBy ,@Param("updateTime") Date updateTime); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanMapper.java b/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanMapper.java new file mode 100644 index 0000000..5e11d20 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/EmergencyPlanMapper.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.EmergencyPlan; +import org.springframework.stereotype.Repository; + +import java.util.Map; + +@Repository +public interface EmergencyPlanMapper extends BaseMapper<EmergencyPlan> { + + IPage<EmergencyPlan> selectPages(Page<EmergencyPlan> page, Map<String, Object> params); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/EquipmentInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/EquipmentInfoMapper.java new file mode 100644 index 0000000..7e81454 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/EquipmentInfoMapper.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.EquipmentInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface EquipmentInfoMapper extends BaseMapper<EquipmentInfo> { + + List<EquipmentInfo> selectDataGrid(Page<EquipmentInfo> page, Map<String, Object> condition); + + EquipmentInfo selectExistByNumber(@Param("id") Long id,@Param("number") String number); + + EquipmentInfo selectByNumber(@Param("equipmentnumber") String equipmentnumber); + + List<EquipmentInfo> selectByTask(@Param("taskcode") String taskcode); + + List<EquipmentInfo> selectByTaskAndWorker(@Param("code")String code, @Param("worker")String worker); + + List<EquipmentInfo> selectUsingByTask(@Param("code") String code); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/ExamScoreInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/ExamScoreInfoMapper.java new file mode 100644 index 0000000..ec8dee9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/ExamScoreInfoMapper.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.Vo.ExamScoreVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface ExamScoreInfoMapper extends BaseMapper<ExamScoreInfo> { + + ExamScoreInfo selectByMobile(@Param("examtype") String examtype,@Param("mobile") String mobile); + + List<ExamScoreVo> selectByAll(@Param("username") String username); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/FourColorMap2Mapper.java b/src/main/java/com/gk/hotwork/Mapper/FourColorMap2Mapper.java new file mode 100644 index 0000000..17d3f5c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/FourColorMap2Mapper.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.FourColorMap2; +import org.springframework.stereotype.Repository; + +@Repository +public interface FourColorMap2Mapper extends BaseMapper<FourColorMap2> { +} diff --git a/src/main/java/com/gk/hotwork/Mapper/FourColorPointCoordMapper.java b/src/main/java/com/gk/hotwork/Mapper/FourColorPointCoordMapper.java new file mode 100644 index 0000000..fda8147 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/FourColorPointCoordMapper.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.FourColorPointCoord; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface FourColorPointCoordMapper extends BaseMapper<FourColorPointCoord> { + + List<FourColorPointCoord> findCoordListByPointId(String pointId); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/FourColorPointMapper.java b/src/main/java/com/gk/hotwork/Mapper/FourColorPointMapper.java new file mode 100644 index 0000000..ec39e90 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/FourColorPointMapper.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.FourColorPoint; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface FourColorPointMapper extends BaseMapper<FourColorPoint> { + + List<FourColorPoint> findPointListByEtype(int etype); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/GasWarnInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/GasWarnInfoMapper.java new file mode 100644 index 0000000..db19f42 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/GasWarnInfoMapper.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.GasWarnInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface GasWarnInfoMapper extends BaseMapper<GasWarnInfo> { + + List<GasWarnInfo> selectDataGrid(Page<GasWarnInfo> page, Map<String, Object> condition); + + GasWarnInfo selectExistByType(@Param("id") Long id,@Param("warntype") String warntype,@Param("gastype") String gastype); + + GasWarnInfo selectByType(@Param("gastype") String gastype,@Param("warntype") String warntype); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/HelpDocInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/HelpDocInfoMapper.java new file mode 100644 index 0000000..4c39408 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/HelpDocInfoMapper.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.HelpDocInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface HelpDocInfoMapper extends BaseMapper<HelpDocInfo> { + + List<HelpDocInfo> selectDataGrid(Page<HelpDocInfo> page, Map<String, Object> condition); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/HiddenDangerLogMapper.java b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerLogMapper.java new file mode 100644 index 0000000..66978a2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerLogMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.HiddenDangerLog; +import org.springframework.stereotype.Repository; + +@Repository +public interface HiddenDangerLogMapper extends BaseMapper<HiddenDangerLog> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/HiddenDangerMapper.java b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerMapper.java new file mode 100644 index 0000000..21dc87e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerMapper.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.HiddenDanger; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface HiddenDangerMapper extends BaseMapper<HiddenDanger> { + + Page<HiddenDanger> selectPages(Page<HiddenDanger> page, @Param("params") Map params); + + List<HiddenDanger> selectPages(@Param("params") Map params); + + List<HiddenDanger> selectDataGrid(Map<String, Object> condition, Page<HiddenDanger> page); + + List<HiddenDanger> selectStatisticsData(Map<String, Object> condition, Page<HiddenDanger> page); + + int countNumInMonth(Long id); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/HiddenDangerResourceMapper.java b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerResourceMapper.java new file mode 100644 index 0000000..703182a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/HiddenDangerResourceMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.HiddenDangerResource; +import org.springframework.stereotype.Repository; + +@Repository +public interface HiddenDangerResourceMapper extends BaseMapper<HiddenDangerResource> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/InvolveDepInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/InvolveDepInfoMapper.java new file mode 100644 index 0000000..f4a89e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/InvolveDepInfoMapper.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.InvolveDepInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository +public interface InvolveDepInfoMapper extends BaseMapper<InvolveDepInfo> { + + InvolveDepInfo selectByName(@Param("department") String department); + + void deleteByName(@Param("department") String department); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentAlarmMapper.java b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentAlarmMapper.java new file mode 100644 index 0000000..ecbfe16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentAlarmMapper.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.MajorEquipmentAlarm; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.Map; + +@Repository +public interface MajorEquipmentAlarmMapper extends BaseMapper<MajorEquipmentAlarm> { + + IPage<MajorEquipmentAlarm> selectPages(Page<MajorEquipmentAlarm> page, Map<String, Object> params); + + void deleteByEquipmentId(@Param("id") Long id , @Param("updateBy") String updateBy , @Param("updateTime") Date updateTime); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentDataMapper.java b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentDataMapper.java new file mode 100644 index 0000000..c5be7e7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentDataMapper.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.MajorEquipmentData; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.Map; + +@Repository +public interface MajorEquipmentDataMapper extends BaseMapper<MajorEquipmentData> { + + IPage<MajorEquipmentData> selectPages(Page<MajorEquipmentData> page, Map<String, Object> params); + + void deleteByEquipmentId(@Param("id") Long id , @Param("updateBy") String updateBy , @Param("updateTime") Date updateTime); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentMapper.java b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentMapper.java new file mode 100644 index 0000000..5207a51 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/MajorEquipmentMapper.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.MajorEquipment; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface MajorEquipmentMapper extends BaseMapper<MajorEquipment> { + + IPage<MajorEquipment> selectPages(Page<MajorEquipment> page, Map<String, Object> params); + + List<MajorEquipment> getMajorEquipment(); + + List<MajorEquipment> getBySerialNumber(MajorEquipment param); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/PermissionInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/PermissionInfoMapper.java new file mode 100644 index 0000000..e8a15a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/PermissionInfoMapper.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.PermissionInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PermissionInfoMapper extends BaseMapper<PermissionInfo> { + int deleteByPrimaryKey(Integer id); + + PermissionInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(PermissionInfo record); + + int updateByPrimaryKey(PermissionInfo record); + + List<PermissionInfo> selectAll(); + + List<PermissionInfo> selectByUserId(String userId); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/ReserveMapper.java b/src/main/java/com/gk/hotwork/Mapper/ReserveMapper.java new file mode 100644 index 0000000..bfc423f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/ReserveMapper.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Reserve; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Map; + +@Repository +public interface ReserveMapper extends BaseMapper<Reserve> { + + Page statistics(Page<Map> page, Map params); + + Map selectStatisticsTotal(@Param("params") Map params); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskAnaUintMapper.java b/src/main/java/com/gk/hotwork/Mapper/RiskAnaUintMapper.java new file mode 100644 index 0000000..2acfdcc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskAnaUintMapper.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.UserInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface RiskAnaUintMapper extends BaseMapper<RiskAnaUnit> { + + IPage<RiskAnaUnit> selectPages(Page<RiskAnaUnit> page, Map<String, Object> params, UserInfo user); + + List<Map> selectDepartmentAnalysis(); + + List<RiskAnaUnit> getInfo(); + + RiskAnaUnit getInfoByRiskUnitName(String riskUnitName); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskControlClassifyMapper.java b/src/main/java/com/gk/hotwork/Mapper/RiskControlClassifyMapper.java new file mode 100644 index 0000000..7fbcfeb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskControlClassifyMapper.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.UserInfo; +import org.springframework.stereotype.Repository; + +import java.util.Map; + + +@Repository +public interface RiskControlClassifyMapper extends BaseMapper<RiskControlClassify> { + + IPage<RiskControlClassify> selectPages(Page<RiskControlClassify> page, Map<String, Object> filter, UserInfo user); + + RiskControlClassify getByClassify1AndClassify12(String classify1, String classify2); + /** + * @Description: 查询 by 1、2分级 + */ + RiskControlClassify getByClassify1AndClassify2(String classify1, String classify2); + /** + * @Description: 查询 by 名字 + */ + RiskControlClassify getByClassify(String classify); + /** + * @Description: 查询 by 名字与parentid + */ + RiskControlClassify getByClassify2(Long id, String trim); + /** + * @Description: 查询 by id + */ + RiskControlClassify getByControlId(Byte classify2); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskControlMeasureMapper.java b/src/main/java/com/gk/hotwork/Mapper/RiskControlMeasureMapper.java new file mode 100644 index 0000000..8004c8c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskControlMeasureMapper.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.RiskControlMeasure; +import com.gk.hotwork.Domain.UserInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface RiskControlMeasureMapper extends BaseMapper<RiskControlMeasure> { + + IPage<RiskControlMeasure> selectPages(Page<RiskControlMeasure> page, Map<String, Object> params); + + List<RiskControlMeasure> getRiskControlMeasureList(); + + RiskControlMeasure getByDataSrc(String trim); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskEventMapper.java b/src/main/java/com/gk/hotwork/Mapper/RiskEventMapper.java new file mode 100644 index 0000000..a3c727f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskEventMapper.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.UserInfo; +import org.springframework.stereotype.Repository; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Repository +public interface RiskEventMapper extends BaseMapper<RiskEvent> { + + IPage<RiskEvent> selectPages(Page<RiskEvent> page, Map<String, Object> params); + + List<RiskEvent> getRiskEventList(); + + RiskEvent getByRiskEventName(String riskEventName); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskMapRepository.java b/src/main/java/com/gk/hotwork/Mapper/RiskMapRepository.java new file mode 100644 index 0000000..628a25a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskMapRepository.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.RiskMap; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface RiskMapRepository extends BaseMapper<RiskMap> { + + List<RiskMap> listByStatus(Byte status); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RiskSourceMapper.java b/src/main/java/com/gk/hotwork/Mapper/RiskSourceMapper.java new file mode 100644 index 0000000..85f3e6d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RiskSourceMapper.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.RiskSource; +import com.gk.hotwork.Domain.Vo.RiskSourceSearchVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface RiskSourceMapper extends BaseMapper<RiskSource> { + + IPage<RiskSource> findRiskSourceListByConditionsAndPage(Page<RiskSource> page, @Param("parm") RiskSourceSearchVo parm); + + List<RiskSource> getRiskSourceList(); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RoleInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/RoleInfoMapper.java new file mode 100644 index 0000000..8aea39f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RoleInfoMapper.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Config.Oauth2.OauthRole; +import com.gk.hotwork.Domain.RoleInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + + +@Repository +public interface RoleInfoMapper extends BaseMapper<RoleInfo> { + int deleteByPrimaryKey(Long id); + + RoleInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(RoleInfo record); + + int updateByPrimaryKey(RoleInfo record); + + List<RoleInfo> selectRoleByUser(Long id); + + List<RoleInfo> selectList(String name); + + List<RoleInfo> selectExistRole(@Param("id") Long id, @Param("name") String name); + + List<OauthRole> selectOauthRoleByUser(int i); + + int selectRoleCount(String name); + + List<RoleInfo> selectPageForRole(@Param("params") Map<String, Object> params); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/RolePermissionsInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/RolePermissionsInfoMapper.java new file mode 100644 index 0000000..04cbdf5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/RolePermissionsInfoMapper.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.RolePermissionsInfo; +import com.gk.hotwork.Domain.Vo.Menu; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface RolePermissionsInfoMapper extends BaseMapper<RolePermissionsInfo> { + int deleteByPrimaryKey(Long id); + + RolePermissionsInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(RolePermissionsInfo record); + + int updateByPrimaryKey(RolePermissionsInfo record); + + List<Menu> selectMenuList(String roleId); + + void delRolePermissionByRoleId(Long roleid); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemDeductionMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemDeductionMapper.java new file mode 100644 index 0000000..fbc3895 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemDeductionMapper.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.SafetyInspectionItemDeduction; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + + +@Repository +public interface SafetyInspectionItemDeductionMapper extends BaseMapper<SafetyInspectionItemDeduction> { + + + List<SafetyInspectionItemDeduction> getBySafetyInspectionItemId(@Param("safetyInspectionItemId") Long safetyInspectionItemId); + + void deleteById(@Param("id") Long id , @Param("updateBy") String updateBy , @Param("updateTime") Date updateTime); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java new file mode 100644 index 0000000..7c40412 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.SafetyInspectionItem; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface SafetyInspectionItemMapper extends BaseMapper<SafetyInspectionItem> { + + IPage<SafetyInspectionItem> selectPages(Page<SafetyInspectionItem> page, Map<String, Object> params); + + List<SafetyInspectionItem> infoElementA(@Param("id") Long id); + + SafetyInspectionItem getById(@Param("id")Long id); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemDeductionMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemDeductionMapper.java new file mode 100644 index 0000000..27e22f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemDeductionMapper.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.SafetySelfInspectionItemDeduction; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + + +@Repository +public interface SafetySelfInspectionItemDeductionMapper extends BaseMapper<SafetySelfInspectionItemDeduction> { + + + List<SafetySelfInspectionItemDeduction> getBySafetySelfInspectionItemId(@Param("safetySelfInspectionItemId")Long safetySelfInspectionItemId); + + void delBySafetySelfInspectionItemId(@Param("safetySelfInspectionItemId") Long safetySelfInspectionItemId ,@Param("updateBy") String updateBy ,@Param("updateTime") Date updateTime); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemMapper.java new file mode 100644 index 0000000..5fcae75 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionItemMapper.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.Do.SafetySelfInspectionItemQualifiedCountDO; +import com.gk.hotwork.Domain.SafetySelfInspectionItem; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +@Repository +public interface SafetySelfInspectionItemMapper extends BaseMapper<SafetySelfInspectionItem> { + + List<SafetySelfInspectionItem> getBySafetySelfInspectionId(@Param("safetySelfInspectionId") Long safetySelfInspectionId); + + void deleteById(@Param("id") Long id ,@Param("updateBy") String updateBy ,@Param("updateTime") Date updateTime); + + List<SafetySelfInspectionItem> getDetailBySafetySelfInspectionId(@Param("safetySelfInspectionId") Long safetySelfInspectionId,@Param("unqualified")String unqualified); + + SafetySelfInspectionItem getDetailById(@Param("id")Long id); + + SafetySelfInspectionItemQualifiedCountDO countQualifiedDataById(@Param("id") Long id); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionMapper.java new file mode 100644 index 0000000..6dd278e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetySelfInspectionMapper.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.SafetySelfInspection; +import org.springframework.stereotype.Repository; + +import java.util.Map; + +@Repository +public interface SafetySelfInspectionMapper extends BaseMapper<SafetySelfInspection> { + + IPage<SafetySelfInspection> selectPages(Page<SafetySelfInspection> page, Map<String, Object> params); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SelfCheckInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/SelfCheckInfoMapper.java new file mode 100644 index 0000000..157a5ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SelfCheckInfoMapper.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.SelfCheckInfo; +import com.gk.hotwork.Domain.Vo.SelfCheckVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface SelfCheckInfoMapper extends BaseMapper<SelfCheckInfo> { + + List<SelfCheckVo> selectByType(@Param("type") String type); + + List<SelfCheckInfo> selectDataGrid(Page<SelfCheckInfo> page, Map<String, Object> condition); + + List<SelfCheckInfo> selectByIds(@Param("idList") List<Long> idList); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SmsLogInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/SmsLogInfoMapper.java new file mode 100644 index 0000000..20908b9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SmsLogInfoMapper.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.SmsLogInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface SmsLogInfoMapper extends BaseMapper<SmsLogInfo> { + int deleteByPrimaryKey(Long id); + + SmsLogInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(SmsLogInfo record); + + int updateByPrimaryKey(SmsLogInfo record); + + SmsLogInfo selectByTel(String mobile, String starttime, String endtime, Byte type); + + void deleteByTime(String seventime); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SmsLogMapper.java b/src/main/java/com/gk/hotwork/Mapper/SmsLogMapper.java new file mode 100644 index 0000000..da73fec --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SmsLogMapper.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.SmsLog; +import org.springframework.stereotype.Repository; + +@Repository +public interface SmsLogMapper extends BaseMapper<SmsLog> { +} diff --git a/src/main/java/com/gk/hotwork/Mapper/SubTaskInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/SubTaskInfoMapper.java new file mode 100644 index 0000000..5a991a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SubTaskInfoMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.SubTaskInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface SubTaskInfoMapper extends BaseMapper<SubTaskInfo> { + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskAnalysisMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskAnalysisMapper.java new file mode 100644 index 0000000..709961b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskAnalysisMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskAnalysis; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskAnalysisMapper extends BaseMapper<TaskAnalysis> { + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskEnclosureMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskEnclosureMapper.java new file mode 100644 index 0000000..fec5dd2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskEnclosureMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskEnclosure; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskEnclosureMapper extends BaseMapper<TaskEnclosure> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentBindInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentBindInfoMapper.java new file mode 100644 index 0000000..63611cc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentBindInfoMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskEquipmentBindInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskEquipmentBindInfoMapper extends BaseMapper<TaskEquipmentBindInfo> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentMapper.java new file mode 100644 index 0000000..4ee3e1f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskEquipmentMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskEquipment; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskEquipmentMapper extends BaseMapper<TaskEquipment> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskGasInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskGasInfoMapper.java new file mode 100644 index 0000000..8713e87 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskGasInfoMapper.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.TaskGasInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface TaskGasInfoMapper extends BaseMapper<TaskGasInfo> { + + List<TaskGasInfo> selectDataGrid(Page<TaskGasInfo> page, Map<String, Object> condition); + + List<TaskGasInfo> selectLastGas(@Param("taskCode") String taskCode, @Param("worker") String worker); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskInfoMapper.java new file mode 100644 index 0000000..59a98df --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskInfoMapper.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.Vo.TaskVo; +import com.gk.hotwork.Domain.Vo.WorkShowTaskVo; +import com.gk.hotwork.Domain.Vo.specTask.ActiveTaskInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Repository +public interface TaskInfoMapper extends BaseMapper<TaskInfo> { + + List<TaskInfo> selectTaskDataGrid(Map<String, Object> condition, Page<TaskInfo> page); + + Integer getTotalByYear(Integer year); + + List<TaskInfo> selectTaskDataGridByDep(Map<String, Object> condition, Page<TaskInfo> page); + + List<ActiveTaskInfo> selectActiveTaskList(Date time,Byte type); + + List<TaskInfo> selectDataGridViewable(Map<String, Object> condition, Page<TaskInfo> page); + + List<TaskInfo> getWaitReviewDataGrid(Map<String, Object> condition, Page<TaskInfo> page); + + List<TaskVo> getPendingTask(@Param("type")String type, @Param("name") String name); + + List<TaskVo> getDoingTask(); + + List<WorkShowTaskVo> selectPageWorkTodayDetail(Page<WorkShowTaskVo> page, Map params); + + int selectCountWorkToday(Byte flag); + + int selectCountDoneInPeriod(Date startTime, Byte status); + + List<Map> selectCountWorkEverydayInMonth(@Param("days")int[] index,@Param("startTime") Date startTime,@Param("status") Byte status); + + List<TaskInfo> selectStatisticsData(Map<String, Object> condition, Page<TaskInfo> page); + + List<TaskInfo> selectDataGridTesting(Map<String, Object> condition, Page<TaskInfo> page); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskInvolveDepartmentMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskInvolveDepartmentMapper.java new file mode 100644 index 0000000..8ecf778 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskInvolveDepartmentMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskInvolveDepartment; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskInvolveDepartmentMapper extends BaseMapper<TaskInvolveDepartment> { + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskLocationInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskLocationInfoMapper.java new file mode 100644 index 0000000..54a66ff --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskLocationInfoMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskLocationInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskLocationInfoMapper extends BaseMapper<TaskLocationInfo> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskLogMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskLogMapper.java new file mode 100644 index 0000000..681ad20 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskLogMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskLog; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskLogMapper extends BaseMapper<TaskLog> { + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskReviewMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskReviewMapper.java new file mode 100644 index 0000000..dc6acd2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskReviewMapper.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskReview; +import com.gk.hotwork.Domain.Vo.specTask.TaskLocation; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface TaskReviewMapper extends BaseMapper<TaskReview> { + + List<TaskLocation> getTaskLocationListByTaskCodes(List<Long> taskIdList); + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskRiskMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskRiskMapper.java new file mode 100644 index 0000000..2930aee --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskRiskMapper.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskRisk; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskRiskMapper extends BaseMapper<TaskRisk> { + + TaskRisk getByTaskCode(String taskCode); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskSecurityMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskSecurityMapper.java new file mode 100644 index 0000000..4845f80 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskSecurityMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskSecurity; +import org.springframework.stereotype.Repository; + +@Repository +public interface TaskSecurityMapper extends BaseMapper<TaskSecurity> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/TaskWorkerMapper.java b/src/main/java/com/gk/hotwork/Mapper/TaskWorkerMapper.java new file mode 100644 index 0000000..cf9f4df --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/TaskWorkerMapper.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.TaskWorker; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface TaskWorkerMapper extends BaseMapper<TaskWorker> { + + List<TaskWorkerVo> getVoByTaskCode(String code); +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/UserFaceMapper.java b/src/main/java/com/gk/hotwork/Mapper/UserFaceMapper.java new file mode 100644 index 0000000..3bdf334 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/UserFaceMapper.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.UserFace; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserFaceMapper extends BaseMapper<UserFace> { + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/UserInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/UserInfoMapper.java new file mode 100644 index 0000000..3a60ae7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/UserInfoMapper.java @@ -0,0 +1,61 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Config.Oauth2.OauthRole; +import com.gk.hotwork.Domain.CompanyInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.AccountUserVo; +import com.gk.hotwork.Domain.Vo.UserVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Repository +public interface UserInfoMapper extends BaseMapper<UserInfo> { + int deleteByPrimaryKey(Long id); + + UserInfo selectByPrimaryKey(Long id); + + List<UserVo> selectUserDataGrid(Page<UserVo> page, Map<String, Object> record); + + List<UserInfo> selectUserInfo(@Param("id") Long id, @Param("username") String username); + + UserVo selectUserVoByName(@Param("examtype")String examtype,@Param("username") String username); + + UserInfo selectByRealName(@Param("id")Long id,@Param("realname") String realname); + + UserInfo selectByIdCard(@Param("id")Long id,@Param("idcard") String idcard); + + List<UserInfo> selectNotUpload(); + + List<UserVo> selectAll(@Param("record") Map<String, Object> record); + + List<UserVo> getUserList(); + + Integer selectCountForExam(Map<Object, Object> params); + + List<UserInfo> selectPageForExam(Map<Object, Object> params); + + UserInfo getByRealName(String realname, String depName); + + AccountUserVo getAccountByDepartment(@Param("department") String department); + + AccountUserVo getAccountByUsername(@Param("username")String username); + + /** + 查询by姓名 + */ + UserInfo getUserByRealName(String trim); + /** + 查询by姓名 and dep + */ + UserInfo getUserByRealNameAndDep(String name, Long dep); + /** + 查询by Id + */ + UserInfo getByUserId(Long userId); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/UserRolesInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/UserRolesInfoMapper.java new file mode 100644 index 0000000..1bf2948 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/UserRolesInfoMapper.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.UserRolesInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserRolesInfoMapper extends BaseMapper<UserRolesInfo> { + int deleteByPrimaryKey(Long id); + + UserRolesInfo selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(UserRolesInfo record); + + int updateByPrimaryKey(UserRolesInfo record); + + void deleteByUserId(Long userid); +} diff --git a/src/main/java/com/gk/hotwork/Mapper/VideoInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/VideoInfoMapper.java new file mode 100644 index 0000000..a089eec --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/VideoInfoMapper.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.VideoInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface VideoInfoMapper extends BaseMapper<VideoInfo> { + + List<VideoInfo> selectByTime(@Param("endtime") String endtime); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/WarningInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/WarningInfoMapper.java new file mode 100644 index 0000000..6421404 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/WarningInfoMapper.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.WarningInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface WarningInfoMapper extends BaseMapper<WarningInfo> { + + List<WarningInfo> selectTaskDataGrid(Map<String, Object> condition, Page<TaskInfo> page); +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/WorkCertInfoMapper.java b/src/main/java/com/gk/hotwork/Mapper/WorkCertInfoMapper.java new file mode 100644 index 0000000..4f2174f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/WorkCertInfoMapper.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.Domain.WorkCertInfo; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkCertInfoMapper extends BaseMapper<WorkCertInfo> { + + List<WorkCertInfo> selectByMobile(String mobile); + +} diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckContentMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckContentMapper.xml new file mode 100644 index 0000000..d3a6270 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckContentMapper.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerCheckContentRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent"> + <id property="id" column="id"/> + <result property="controlMeasureUuid" column="control_measure_uuid"/> + <result property="controlMeasureId" column="control_measure_id"/> + <result property="checkContent" column="check_content"/> + </resultMap> + + <select id="getCheckContentByMeasureId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent"> + select + id, + control_measure_id, + check_content + from prevent_danger_check_content + where control_measure_id = #{measureId} + </select> + + <!--PreventDangerCheckContent getCheckContentByTaskId(Long taskId);--> + <select id="getCheckContentByTaskId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent"> + select + id, + control_measure_id, + check_task_id, + check_content + from prevent_danger_check_content + where check_task_id = #{checkTaskId} + </select> + + <!--void updateDangerCheckContent(Long measureId, String checkContent);--> + <update id="updateDangerCheckContent" > + update prevent_danger_check_content set + check_content = #{checkContent} + where control_measure_id = #{measureId} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskMapper.xml new file mode 100644 index 0000000..3759a7d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskMapper.xml @@ -0,0 +1,510 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerCheckTaskRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="result" column="result"/> + <result property="taskStatus" column="task_status"/> + <result property="taskBelong" column="task_belong"/> + <result property="belongTime" column="belong_time"/> + <result property="taskType" column="task_type"/> + <result property="startTime" column="start_time"/> + <result property="validTime" column="valid_time"/> + <result property="noticeTime" column="notice_time"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="checkWorkId" column="check_work_id"/> + <result property="checkTaskUnitId" column="check_task_unit_id"/> + <result property="execUserId" column="exec_user_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="checkTaskUnitUuid" column="check_task_unit_uuid"/> + <result property="checkWorkUuid" column="check_work_uuid"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="taskCode" column="task_code"/> + <result property="execUserName" column="exec_user_name"/> + <result property="createUserName" column="create_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="execDepId" column="exec_dep_id"/> + <result property="execDepUuid" column="exec_dep_uuid"/> + <result property="desc" column="desc"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="report_switch" property="reportSwitch"/> + </resultMap> + + <resultMap id="PreventTaskRectifyDO" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO"> + <result property="manageId" column="manage_id"/> + <result property="manageUuid" column="manage_uuid"/> + <result property="registerTime" column="register_time"/> + <result property="dangerLevel" column="danger_level"/> + <result property="dangerType" column="danger_type"/> + <result property="dangerSource" column="danger_source"/> + <result property="dangerStatus" column="danger_status"/> + <result property="registantId" column="registant_id"/> + <result property="produceDeviceId" column="produce_device_id"/> + <result property="dangerCode" column="danger_code"/> + <result property="registantName" column="registant_name"/> + <result property="dangerDesc" column="danger_desc"/> + <result property="dangerReason" column="danger_reason"/> + <result property="dangerResult" column="danger_result"/> + <result property="depId" column="dep_id"/> + <result property="riskUnitId" column="risk_unit_id"/> + <result property="dangerReview" column="danger_review"/> + <result property="dangerCloseReason" column="danger_close_reason"/> + <result property="rectifyId" column="rectify_id"/> + <result property="rectifyType" column="rectify_type"/> + <result property="rectifyTime" column="rectify_time"/> + <result property="liablePersonId" column="liable_person_id"/> + <result property="checkAcceptTime" column="check_accept_time"/> + <result property="checkAcceptPersonId" column="check_accept_person_id"/> + <result property="liablePerson" column="liable_person"/> + <result property="checkAcceptPerson" column="check_accept_person"/> + <result property="rectifyDepId" column="rectify_dep_id"/> + <result property="rectifyDesc" column="rectify_desc"/> + <result property="cost" column="cost"/> + <result property="rectifyApplyTime" column="rectify_apply_time"/> + <result property="timeOutDesc" column="time_out_desc"/> + <result property="rectifyInfo" column="rectify_info"/> + </resultMap> + + <!--IPage<PreventDangerCheckTask> getTaskPage(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO);--> + <select id="getTaskPage" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + <where> + delete_status = 0 + <if test="taskQueryReqDTO.taskStatus != 3 and taskQueryReqDTO.taskStatus != null"> + and task_status = #{taskQueryReqDTO.taskStatus} + <if test="taskQueryReqDTO.result != null"> + and result = #{taskQueryReqDTO.result} + </if> + <if test="taskQueryReqDTO.taskType != null"> + and task_type = #{taskQueryReqDTO.taskType} + </if> + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if> + </if> + + <if test="taskQueryReqDTO.taskStatus == 3"> + and task_status = #{taskQueryReqDTO.taskStatus} and task_belong =2 + <if test="taskQueryReqDTO.result != null"> + and result = #{taskQueryReqDTO.result} + </if> + <if test="taskQueryReqDTO.taskType != null"> + and task_type = #{taskQueryReqDTO.taskType} + </if> + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if> + </if> + + <if test="taskQueryReqDTO.taskStatus == null"> + and (task_status !=3 + <if test="taskQueryReqDTO.result != null"> + and result = #{taskQueryReqDTO.result} + </if> + <if test="taskQueryReqDTO.taskType != null"> + and task_type = #{taskQueryReqDTO.taskType} + </if> + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if>) + or (task_status =3 and task_belong = 2 + <if test="taskQueryReqDTO.result != null"> + and result = #{taskQueryReqDTO.result} + </if> + <if test="taskQueryReqDTO.taskType != null"> + and task_type = #{taskQueryReqDTO.taskType} + </if> + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if>) + </if> + </where> + order by gmt_create desc + +<!-- select * from--> +<!-- (select * from prevent_danger_check_task where task_status !=3 or (task_status =3 and task_belong = 2))--> +<!-- as t--> +<!-- <where>--> +<!-- delete_status = 0--> +<!-- <if test="taskQueryReqDTO.result != null">--> +<!-- and result = #{taskQueryReqDTO.result}--> +<!-- </if>--> +<!-- <if test="taskQueryReqDTO.taskStatus != null">--> +<!-- and task_status = #{taskQueryReqDTO.taskStatus}--> +<!-- </if>--> +<!-- <if test="taskQueryReqDTO.taskType != null">--> +<!-- and task_type = #{taskQueryReqDTO.taskType}--> +<!-- </if>--> +<!-- <if test="taskQueryReqDTO.execDepId != null">--> +<!-- and exec_dep_id = #{taskQueryReqDTO.execDepId}--> +<!-- </if>--> +<!-- </where>--> +<!-- order by gmt_create desc--> + </select> + +<!-- IPage<PreventDangerCheckTask> getTaskPageForMobile(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO);--> + <select id="getTaskPageForMobile" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + <where> + delete_status = 0 + <if test="taskQueryReqDTO.taskStatus != 3"> + and task_status = #{taskQueryReqDTO.taskStatus} and task_type = #{taskQueryReqDTO.taskType} + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if> + </if> + <if test="taskQueryReqDTO.taskStatus == 3"> + and task_status = #{taskQueryReqDTO.taskStatus} and task_type = #{taskQueryReqDTO.taskType} and task_belong = 2 + <if test="taskQueryReqDTO.execDepId != null"> + and exec_dep_id = #{taskQueryReqDTO.execDepId} + </if> + </if> + </where> + order by gmt_create desc + </select> + + <!--PreventDangerCheckTask getTaskById(Long checkTaskId);--> + <select id="getTaskById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask"> + select * + from prevent_danger_check_task + where delete_status = 0 and id = #{checkTaskId} + </select> + + <!--PreventDangerCheckTask getTaskByCode(Long taskCode);--> + <select id="getTaskByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask"> + select + id, + uuid + from prevent_danger_check_task + where delete_status = 0 and task_code = #{taskCode} + </select> + + <!--int updateCheckTaskReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateCheckTaskReport"> + update prevent_danger_check_task set + report_switch = #{reportSwitch} + where id = #{id} + </update> + + + <!--PreventDangerCheckTask getTaskByCheckWorkId(Long checkWorkId)--> + <select id="getTaskByCheckWorkId" resultMap="BaseResultMap"> + select id, uuid, check_work_id, task_status,valid_time + from prevent_danger_check_task where delete_status = 0 and (task_status = 1 or task_status = 4) + </select> + + <!--boolean updateTaskStatus(Long taskId, Byte taskStatus);--> + <update id="updateTaskStatus"> + update prevent_danger_check_task set + task_status = #{taskStatus} + where delete_status = 0 and id = #{taskId} and (task_status = 1 or task_status = 4) + </update> + + <!--int resetTaskStatus(Long taskId);--> + <update id="resetTaskStatus"> + update prevent_danger_check_task set + task_status = 3, + result = 3 + where delete_status = 0 and task_status = 4 and id = #{taskId} + </update> + + + <!--int updateTaskUnitIdById(PreventDangerCheckTaskUpdateParams updateParams);--> + <update id="updateTask"> + update prevent_danger_check_task set + result = #{result}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + task_status = #{taskStatus} + where delete_status = 0 and id = #{id} + </update> + + <!--int deleteTask(PreventDeleteParams deleteParams);--> + <update id="deleteTask"> + update prevent_danger_check_task set + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + update_report_data_time = #{updateReportDataTime}, + delete_status = 1 + where delete_status = 0 and id = #{id} + </update> + + <!--int taskToUser(PreventTaskToUserParams taskToUserParams);--> + <update id="taskToUser"> + update prevent_danger_check_task set + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + exec_user_id= #{execUserId}, + exec_user_name= #{execUserName}, + task_belong = #{taskBelong}, + belong_time = #{belongTime} + where delete_status = 0 and id = #{id} + </update> + + + + <!--PreventDangerCheckTask getTaskByCheckWorkIdAndStartTime(Long workId, Date checkTime);--> + <select id="getTaskByCheckWorkIdAndStartTime" resultMap="BaseResultMap"> + select id,start_time + from prevent_danger_check_task + where delete_status = 0 and check_work_id = #{workId} and start_time = #{checkTime} + </select> + + <!--int updateTaskReportStatus(Long id, byte code);--> + <update id="updateTaskReportStatus"> + update prevent_danger_check_task set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--List<PreventDangerCheckTask> listReportTask();--> + <select id="listReportTask" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + where report_switch = 1 and task_belong = 2 and (update_report_data_time > report_time or report_time is null) + order by gmt_create + </select> + <select id="selectInspectorsStatistics" resultType="java.util.Map"> + + select + a.taskDate, + ifnull(b.num,0) num + from ( + <foreach collection="list" item="item" separator="union all" index="index"> + select #{item} + <if test="index == 0"> + as taskDate + </if> + </foreach> + ) as a left join ( + select + date_format(start_time,'%Y-%m-%d') taskDate, + count(0) num + from prevent_danger_check_task + where start_time >= #{startTime} + and start_time < #{endTime} + and task_belong is not null + and exec_dep_id = #{depId} + group by date_format(start_time,'%Y-%m-%d') + ) as b on a.taskDate = b.taskDate + + + </select> + <select id="selectInspectionCompleted" resultType="java.util.Map"> + + select + a.taskDate, + ifnull(b.num,0) num + from ( + <foreach collection="list" item="item" separator="union all" index="index"> + select #{item} + <if test="index == 0"> + as taskDate + </if> + </foreach> + ) as a left join ( + select + date_format(start_time,'%Y-%m-%d') taskDate, + count(0) num + from prevent_danger_check_task + where start_time >= #{startTime} + and start_time < #{endTime} + <if test="status != null"> + and task_type = #{status} + </if> + <if test="depId != null"> + and exec_dep_id = #{depId} + </if> + + group by date_format(start_time,'%Y-%m-%d') + ) as b on a.taskDate = b.taskDate + order by a.taskDate + </select> + +<!-- List<PreventDangerCheckTask> listOverTask(Date startTime, Date endTime);--> + <select id="listOverTask" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + where delete_status = 0 and valid_time > #{startTime} and #{endTime} > valid_time and task_status = 4 + </select> + +<!-- List<PreventDangerCheckTask> listWaitExecTask(Date endTime);--> + <select id="listWaitExecTask" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + where delete_status = 0 and valid_time > #{endTime} and #{endTime} > start_time and task_status = 1 + </select> + + + <!-- List<PreventDangerCheckTask> listTimeOutTask(Date endTime);--> + <select id="listTimeOutTask" resultMap="BaseResultMap"> + select * from prevent_danger_check_task + where delete_status = 0 and #{endTime} > valid_time and (task_status = 1 or task_status = 4) + </select> + + + + + + <select id="selectInspectionTask" resultType="java.util.Map"> + + + </select> + <select id="selectInspectionClaimedTask" resultType="java.util.Map"> + select + a.taskDate, + ifnull(b.num,0) num + from ( + <foreach collection="list" item="item" separator="union all" index="index"> + select #{item} + <if test="index == 0"> + as taskDate + </if> + </foreach> + ) as a left join ( + select + date_format(belong_time,'%Y-%m-%d') taskDate, + count(0) num + from prevent_danger_check_task + where belong_time >= #{startTime} + and belong_time < #{endTime} + and task_belong = 2 + and belong_time is not null + and exec_dep_id = #{depId} + group by date_format(belong_time,'%Y-%m-%d') + ) as b on a.taskDate = b.taskDate + order by a.taskDate + + + </select> + <select id="selectInspectionCompletedTask" resultType="java.util.Map"> + select + a.taskDate, + ifnull(b.num,0) num + from ( + <foreach collection="list" item="item" separator="union all" index="index"> + select #{item} + <if test="index == 0"> + as taskDate + </if> + </foreach> + ) as a left join ( + select + date_format(gmt_moditify,'%Y-%m-%d') taskDate, + count(0) num + from prevent_danger_check_task + where gmt_moditify >= #{startTime} + and gmt_moditify < #{endTime} + and task_status = 2 + and exec_dep_id = #{depId} + group by date_format(gmt_moditify,'%Y-%m-%d') + ) as b on a.taskDate = b.taskDate + order by a.taskDate + </select> + <select id="selectInspectionUnCompletedTask" resultType="java.util.Map"> + select + a.taskDate, + ifnull(b.num,0) num + from ( + <foreach collection="list" item="item" separator="union all" index="index"> + select #{item} + <if test="index == 0"> + as taskDate + </if> + </foreach> + ) as a left join ( + select + date_format(gmt_moditify,'%Y-%m-%d') taskDate, + count(0) num + from prevent_danger_check_task + where gmt_moditify >= #{startTime} + and gmt_moditify < #{endTime} + and task_status != 2 + and belong_time is not null + and exec_dep_id = #{depId} + group by date_format(gmt_moditify,'%Y-%m-%d') + ) as b on a.taskDate = b.taskDate + order by a.taskDate + + </select> + <select id="selectPreventDangerPage" + resultMap="PreventTaskRectifyDO"> + select + dangerManage.id manage_id, + dangerManage.uuid manage_uuid, + dangerManage.register_time register_time, + dangerManage.danger_level danger_level, + dangerManage.danger_type danger_type, + dangerManage.danger_source danger_source, + dangerManage.danger_status danger_status, + dangerManage.registant_id registant_id, + dangerManage.produce_device_id produce_device_id, + dangerManage.danger_code danger_code, + dangerManage.registant_name registant_name, + dangerManage.danger_desc danger_desc, + dangerManage.danger_reason danger_reason, + dangerManage.danger_result danger_result, + dangerManage.dep_id dep_id, + dangerManage.risk_unit_id risk_unit_id, + dangerManage.danger_review danger_review, + dangerManage.danger_close_reason danger_close_reason, + rectify.id rectify_id, + rectify.rectify_type rectify_type, + rectify.rectify_time rectify_time, + rectify.liable_person_id liable_person_id, + rectify.check_accept_time check_accept_time, + rectify.check_accept_person_id check_accept_person_id, + rectify.liable_person liable_person, + rectify.check_accept_person check_accept_person, + rectify.rectify_dep_id rectify_dep_id, + rectify.rectify_desc rectify_desc, + rectify.cost cost, + rectify.apply_time rectify_apply_time, + rectify.time_out_desc time_out_desc, + rectify.rectify_info rectify_info + from prevent_danger_manage as dangerManage + left join prevent_danger_rectify as rectify on rectify.danger_manager_id = dangerManage.id + where dangerManage.delete_status = 0 + <if test="query.serialCode != null and query.serialCode != ''"> + and dangerManage.serial_code like concat("%",#{query.serialCode},"%") + </if> + <if test="query.dangerLevel != null and query.dangerLevel != ''"> + and dangerManage.danger_level = #{query.dangerLevel} + </if> + <if test="query.dangerType != null and query.dangerType != ''"> + and dangerManage.danger_type = #{query.dangerType} + </if> + <if test="query.dangerSource != null and query.dangerSource != ''"> + and dangerManage.danger_source = #{query.dangerSource} + </if> + <if test="query.dangerStatus != null"> + and dangerManage.danger_status = #{query.dangerStatus} + </if> + <if test="query.registantName != null and query.registantName != ''"> + and dangerManage.registant_name like concat("%",#{query.registantName},"%") + </if> + <if test="query.liablePersonName != null and query.liablePersonName != ''"> + and rectify.liable_person like concat("%",#{query.liablePersonName},"%") + </if> + <if test="query.acceptPersonName != null and query.acceptPersonName != ''"> + and rectify.accept_person_name like concat("%",#{query.acceptPersonName},"%") + </if> + order by dangerManage.gmt_create desc + </select> + <select id="selectRectifyNum" resultType="java.util.Map"> + select + sum(dangerManage.danger_status = 0) rectifying, + sum(dangerManage.danger_status = 1) toAccept, + sum(dangerManage.danger_status = 2) postpone, + sum(dangerManage.danger_status = 3) overTime, + sum(dangerManage.danger_status = 9) accepted + from prevent_danger_manage as dangerManage + left join prevent_danger_rectify as rectify on rectify.danger_manager_id = dangerManage.id + where dangerManage.delete_status = 0 + + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskUnitMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskUnitMapper.xml new file mode 100644 index 0000000..b25da50 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckTaskUnitMapper.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerCheckTaskUnitRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="taskUnitName" column="task_unit_name"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="note" column="note"/> + </resultMap> + +<!-- IPage<PreventDangerCheckTaskUnit> getTaskUnitPage--> + <select id="getTaskUnitPage" resultMap="BaseResultMap"> + select + id, + task_unit_name, + gmt_create, + gmt_moditify, + create_by_user_name, + last_edit_user_name, + note + from prevent_danger_check_task_unit + <where> + delete_status = 0 + <if test="taskUnitQueryReqDTO.taskUnitId != null"> + and task_unit_id = #{taskUnitQueryReqDTO.taskUnitId} + </if> + <if test="taskUnitQueryReqDTO.taskUnitName != null"> + and task_unit_name like '%' #{taskUnitQueryReqDTO.taskUnitName} '%' + </if> + </where> + order by gmt_create desc + </select> + + <!--PreventDangerCheckTaskUnit getTaskUnitByName(String taskUnitName);--> + <select id="getTaskUnitByName" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit"> + select + id, + uuid, + task_unit_name + from prevent_danger_check_task_unit + where delete_status = 0 and task_unit_name = #{taskUnitName} + </select> + + <!--Long getTaskUnitByWorkId(Long workId);--> + <select id="getTaskUnitByWorkId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit"> + select + id, + task_unit_name + from prevent_danger_check_task_unit + where delete_status = 0 and check_work_id = #{workId} + </select> + +<!-- PreventDangerCheckTaskUnit getTaskUnitById(Long id)--> + <select id="getTaskUnitById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit"> + select + id, + uuid, + task_unit_name + from prevent_danger_check_task_unit + where delete_status = 0 and id = #{id} + </select> + + <!--List<PreventDangerCheckTaskUnit> listTaskUnit();--> + <select id="listTaskUnit" resultMap="BaseResultMap"> + select + id, + uuid, + task_unit_name + from prevent_danger_check_task_unit + where delete_status = 0 + </select> + + <!--int deleteWorkIdByUnitName(String taskUnitName);--> + <update id="deleteWorkIdByUnitName"> + update prevent_danger_check_task_unit set + check_work_id = null + where delete_status = 0 and task_unit_name = #{taskUnitName} + </update> + + <!--int updateTaskUnit(PreventDangerCheckTaskUnitUpdateParams updateParams);--> + <update id="updateTaskUnit"> + update prevent_danger_check_task_unit set + task_unit_name = #{taskUnitName}, + note = #{note}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName} + where delete_status = 0 and id = #{id} + </update> + + <!--int updateWorkIdByUnitId(String taskUnitId, long checkWorkId);--> + <update id="updateWorkIdByUnitId"> + update prevent_danger_check_task_unit set + check_work_id = #{checkWorkId}, + check_work_uuid = #{checkWorkUuid} + where delete_status = 0 and id = #{taskUnitId} + </update> + + <!--int deleteByWorkId(Long workId);--> + <update id="deleteByWorkId"> + update prevent_danger_check_task_unit set + check_work_id = null, + check_work_uuid = null + where delete_status = 0 and check_work_id = #{workId} + </update> + + <!--PreventDangerCheckTaskUnit updateWorkIdByUnitName(String taskUnitName, Long checkWorkId);--> + <update id="updateWorkIdByUnitName"> + update prevent_danger_check_task_unit set + check_work_id = #{checkWorkId} + where delete_status = 0 and task_unit_name = #{taskUnitName} + </update> + + <!--int updateTaskIdByUnitName(String taskUnitName, long taskId);--> + <update id="updateTaskIdByUnitName"> + update prevent_danger_check_task_unit set + check_task_id = #{taskId} + where delete_status = 0 and task_unit_name = #{taskUnitName} + </update> + +<!-- int deleteTaskUnit(PreventDangerCheckTaskUnitDeleteParams deleteParams);--> + <update id="deleteTaskUnit" > + update prevent_danger_check_task_unit set + delete_status = 1, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName} + where delete_status = 0 and id = #{id} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckWorkMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckWorkMapper.xml new file mode 100644 index 0000000..0846136 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerCheckWorkMapper.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerCheckWorkRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="checkWorkType" column="check_work_type"/> + <result property="checkWorkStatus" column="check_work_status"/> + <result property="checkCycle" column="check_cycle"/> + <result property="noticeTime" column="notice_time"/> + <result property="validTime" column="valid_time"/> + <result property="checkCycleUnit" column="check_cycle_unit"/> + <result property="validTimeUnit" column="valid_time_unit"/> + <result property="noticeTimeUnit" column="notice_time_unit"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="firstStartTime" column="first_start_time"/> + <result property="lastCheckTime" column="last_check_time"/> + <result property="nextCheckTime" column="next_check_time"/> + <result property="execDepId" column="exec_dep_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="execDepUuid" column="exec_dep_uuid"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="checkWorkName" column="check_work_name"/> + <result property="execDep" column="exec_dep"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="taskUnitId" column="task_unit_id"/> + <result property="taskUnitUuid" column="task_unit_uuid"/> + <result property="reportStatus" column="report_status"/> + <result property="reportTime" column="report_time"/> + <result property="updateReportDataTime" column="update_report_data_time"/> + <result property="reportSwitch" column="report_switch"/> + </resultMap> + + <!-- IPage<PreventDangerCheckWork> getCheckWorkPage(page,workQueryReqDTO);--> + <select id="getCheckWorkPage" resultMap="BaseResultMap"> + select * + from prevent_danger_check_work + <where> + delete_status = 0 + <if test="workQueryReqDTO.checkWorkType != null"> + and check_work_type = #{workQueryReqDTO.checkWorkType} + </if> + <if test="workQueryReqDTO.checkWorkStatus != null"> + and check_work_status = #{workQueryReqDTO.checkWorkStatus} + </if> + <if test="workQueryReqDTO.checkWorkId != null"> + and id = #{workQueryReqDTO.checkWorkId} + </if> + <if test="workQueryReqDTO.checkWorkName != null"> + and check_work_name like '%' #{workQueryReqDTO.checkWorkName} '%' + </if> + <if test="workQueryReqDTO.execDepId != null"> + and exec_dep_id = #{workQueryReqDTO.execDepId} + </if> + order by gmt_create desc + </where> + + </select> + + <!--PreventDangerCheckWork getWorkByName(String checkWorkName);--> + <select id="getWorkByName" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork"> + select id ,uuid + from prevent_danger_check_work + where delete_status = 0 and check_work_name = #{checkWorkName} + </select> + + <!--List<PreventDangerCheckWork> listCheckWork();--> + <select id="listCheckWork" resultMap="BaseResultMap"> + select * + from prevent_danger_check_work + where delete_status = 0 and check_work_status = 1 + order by gmt_create desc + </select> + + <!--PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId);--> + <select id="getWorkByTaskUnitId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork"> + select + id, + uuid, + check_work_name + from prevent_danger_check_work + where delete_status = 0 and task_unit_id = #{taskUnitId} + </select> + +<!-- PreventDangerCheckWork getWorkById(Long workId);--> + <select id="getWorkById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork"> + select * + from prevent_danger_check_work + where delete_status = 0 and id = #{workId} + </select> + + <!--List<PreventDangerCheckWork> listScheduleCheckWork();--> + <select id="listScheduleCheckWork" resultMap="BaseResultMap"> + select * + from prevent_danger_check_work + where delete_status = 0 and check_work_status = 1 and task_unit_id is not null + </select> + + <!--int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateCheckWorkReport"> + update prevent_danger_check_work set + report_switch = #{reportSwitch} + where id = #{id} + </update> + + <!--int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateParams)--> + <update id="updateCheckWorkLastTimeAndNextTime"> + update prevent_danger_check_work set + last_check_time = #{lastCheckTime}, + next_check_time = #{nextCheckTime}, + check_work_status = #{checkWorkStatus} + where delete_status = 0 and id = #{id} + </update> + + <!--void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams);--> + <update id="updateCheckWorkStatus"> + update prevent_danger_check_work set + check_work_status = #{checkWorkStatus} + where delete_status = 0 and id = #{id} + </update> + + <!--int resetWorkStatus(Long workId);--> + <update id="resetWorkStatus"> + update prevent_danger_check_work set + check_work_status = 1 + where delete_status = 0 and id = #{workId} + </update> + + + <!--int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams);--> + <update id="updateCheckWork"> + update prevent_danger_check_work set + check_work_type = #{checkWorkType}, + check_work_status = 1, + check_cycle_unit = #{checkCycleUnit}, + valid_time_unit = #{checkCycleUnit}, + notice_time_unit = #{noticeTimeUnit}, + notice_time = #{noticeTime}, + valid_time = #{validTime}, + check_cycle = #{checkCycle}, + check_work_name = #{checkWorkName}, + exec_dep_id = #{execDepId}, + exec_dep = #{execDep}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + first_start_time = #{firstStartTime}, + next_check_time = #{nextCheckTime}, + task_unit_id = #{taskUnitId}, + task_unit_uuid = #{taskUnitUuid}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus}, + report_switch = #{reportSwitch} + where delete_status = 0 and id = #{id} + </update> + +<!-- int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams);--> + <update id="deleteCheckWork"> + update prevent_danger_check_work set + delete_status = 1, + gmt_moditify = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime}, + last_edit_user_name = #{lastEditUserName} + where delete_status = 0 and id = #{id} + </update> + + <!--int updateWorkReportStatus(Long id, byte code);--> + <update id="updateWorkReportStatus"> + update prevent_danger_check_work set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--List<PreventDangerCheckWork> listReportWork();--> + <select id="listReportWork" resultMap="BaseResultMap"> + select * from prevent_danger_check_work + where report_switch = 1 and (update_report_data_time > report_time or report_time is null) + order by gmt_create + </select> + + <!--List<PreventDangerCheckWork> listErrorCheckWork(Date date);--> + <select id="listErrorCheckWork" resultMap="BaseResultMap"> + select * from prevent_danger_check_work + where delete_status = 0 and #{date} >= next_check_time or (delete_status = 0 and next_check_time is null and #{date} >= first_start_time) + </select> + + <!--int resetErrorWork(Date resetTime, Long id);--> + <update id="resetErrorWork"> + update prevent_danger_check_work set + next_check_time = #{resetTime}, + check_work_status = 1 + where delete_status = 0 and id = #{id} + </update> + + <!--List<PreventDangerCheckWork> listExecCheckWork(Date startTime, Date endTime);--> + <select id="listExecCheckWork" resultMap="BaseResultMap"> + select * from prevent_danger_check_work + where delete_status = 0 and #{endTime} > next_check_time and check_work_status in(4,5) or (delete_status = 0 and check_work_status is null) + </select> +<!-- + select * from prevent_danger_check_work + where delete_status = 0 and next_check_time > #{startTime} + and #{endTime} > next_check_time and (check_work_status = 1 or check_work_status = 5 or check_work_status = 4 or check_work_status is null) +--> + + <!--int resetCheckWorkStatus(Id);--> + <update id="resetCheckWorkStatus"> + update prevent_danger_check_work set check_work_status = 1 + where delete_status = 0 and id = #{Id} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerImageMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerImageMapper.xml new file mode 100644 index 0000000..7c038f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerImageMapper.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerImageRepository" > + + + <update id="updateStatusByParentId"> + update prevent_danger_image + set status = #{status} + where parent_id = #{parentId} + and type = #{type} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageMapper.xml new file mode 100644 index 0000000..add9803 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageMapper.xml @@ -0,0 +1,303 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerManageRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerManage"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="serialCode" column="serial_code"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="registerTime" column="register_time"/> + <result property="dangerLevel" column="danger_level"/> + <result property="dangerType" column="danger_type"/> + <result property="dangerSource" column="danger_source"/> + <result property="dangerStatus" column="danger_status"/> + <result property="registantId" column="registant_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="taskId" column="task_id"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="produceDeviceId" column="produce_device_id"/> + <result property="dangerCode" column="danger_code"/> + <result property="registantName" column="registant_name"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="dangerReason" column="danger_reason"/> + <result property="dangerDesc" column="danger_desc"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="report_switch" property="reportSwitch"/> + <result column="danger_result" property="dangerResult"/> + <result column="dep_id" property="depId"/> + <result column="risk_unit_id" property="riskUnitId"/> + <result column="danger_review" property="dangerReview"/> + <result column="danger_close_reason" property="dangerCloseReason"/> + </resultMap> + + + <resultMap id="PreventTaskRectifyDO" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO"> + <result property="manageId" column="manage_id"/> + <result property="manageUuid" column="manage_uuid"/> + <result property="registerTime" column="register_time"/> + <result property="dangerLevel" column="danger_level"/> + <result property="dangerType" column="danger_type"/> + <result property="dangerSource" column="danger_source"/> + <result property="dangerStatus" column="danger_status"/> + <result property="registantId" column="registant_id"/> + <result property="produceDeviceId" column="produce_device_id"/> + <result property="dangerCode" column="danger_code"/> + <result property="registantName" column="registant_name"/> + <result property="dangerDesc" column="danger_desc"/> + <result property="dangerReason" column="danger_reason"/> + <result property="dangerResult" column="danger_result"/> + <result property="depId" column="dep_id"/> + <result property="riskUnitId" column="risk_unit_id"/> + <result property="dangerReview" column="danger_review"/> + <result property="dangerCloseReason" column="danger_close_reason"/> + <result property="rectifyId" column="rectify_id"/> + <result property="rectifyType" column="rectify_type"/> + <result property="rectifyTime" column="rectify_time"/> + <result property="liablePersonId" column="liable_person_id"/> + <result property="checkAcceptTime" column="check_accept_time"/> + <result property="checkAcceptPersonId" column="check_accept_person_id"/> + <result property="liablePerson" column="liable_person"/> + <result property="checkAcceptPerson" column="check_accept_person"/> + <result property="rectifyDepId" column="rectify_dep_id"/> + <result property="rectifyDesc" column="rectify_desc"/> + <result property="cost" column="cost"/> + <result property="rectifyApplyTime" column="rectify_apply_time"/> + <result property="timeOutDesc" column="time_out_desc"/> + <result property="rectifyInfo" column="rectify_info"/> + </resultMap> + + <!--IPage<PreventDangerManage> getDangerManagePage(page, manageQueryReqDTO);--> + <select id="getDangerManagePage" resultMap="BaseResultMap"> + select * + from prevent_danger_manage + <where> + delete_status = 0 + <if test="manageQueryReqDTO.dangerLevel != null"> + and danger_level = #{manageQueryReqDTO.dangerLevel} + </if> + <if test="manageQueryReqDTO.dangerType != null"> + and danger_type = #{manageQueryReqDTO.dangerType} + </if> + <if test="manageQueryReqDTO.dangerSource != null"> + and danger_source = #{manageQueryReqDTO.dangerSource} + </if> + <if test="manageQueryReqDTO.dangerStatus != null"> + and danger_status = #{manageQueryReqDTO.dangerStatus} + </if> + <if test="manageQueryReqDTO.serialCode != null"> + and serial_code = #{manageQueryReqDTO.serialCode} + </if> + <if test="manageQueryReqDTO.serialCode != null"> + and serial_code = #{manageQueryReqDTO.serialCode} + </if> + <if test="manageQueryReqDTO.depId != null"> + and dep_id = #{manageQueryReqDTO.depId} + </if> + </where> + order by gmt_create desc,danger_status ASC + </select> + + <!--PreventDangerManage getDangerManageByCode(String dangerCode);--> + <select id="getDangerManageByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerManage"> + select + id, + danger_code + from prevent_danger_manage + where delete_status = 0 and danger_code = #{dangerCode} + </select> + + <!--PreventDangerManage getDangerManageById(Long dangerManagerId);--> + <select id="getDangerManageById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerManage"> + select + id, + uuid, + report_switch, + danger_status, + danger_review, + serial_code + from prevent_danger_manage + where delete_status = 0 and id = #{dangerManagerId} + </select> + + <!--PreventDangerManage getDangerManageByTaskId(Long taskId);--> + <select id="getDangerManageByTaskId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerManage"> + select + id, + uuid, + danger_code + from prevent_danger_manage + where delete_status = 0 and task_id = #{taskId} + </select> + +<!-- List<PreventDangerManage> listDangerManage(); --> + <select id="listDangerManage" resultMap="BaseResultMap"> + select + id, + uuid, + danger_code + from prevent_danger_manage + where delete_status = 0 + </select> + + <!--List<PreventDangerManage> listRectifyOver(PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO);--> + <select id="listRectifyOver" resultMap="BaseResultMap"> + select + id, + uuid, + danger_status + from prevent_danger_manage + where delete_status = 0 and (danger_status = 1 or danger_status = 9) + </select> + + + + <!--int updateDangerManagerReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateDangerManagerReport"> + update prevent_danger_manage set + report_switch = #{reportSwitch} + where id = #{id} + </update> + + <!--int updateRectifyResult(Long dangerManagerId);--> + <update id="updateRectifyResult"> + update prevent_danger_manage set + danger_status = #{dangerStatus}, + update_report_data_time = #{updateReportDataTime} + where delete_status = 0 and id = #{dangerManagerId} + </update> + + <!--int closeDanger(CloseDangerParams closeDangerParams);--> + <update id="closeDanger"> + update prevent_danger_manage set + danger_review = #{dangerReview}, + danger_close_reason = #{dangerCloseReason}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + update_report_data_time = #{updateReportDataTime} + where delete_status = 0 and id = #{id} + </update> + + <!--int updateManagerStatus(Long dangerManagerId, byte code);--> + <update id="updateManagerStatus"> + update prevent_danger_manage set + danger_status = #{code} + where delete_status = 0 and id = #{dangerManagerId} + </update> + <!--int updateDangerManage(PreventDangerManageUpdateParams updateParams);--> + <update id="updateDangerManage"> + update prevent_danger_manage set + danger_level = #{dangerLevel}, + danger_type = #{dangerType}, + danger_source = #{dangerSource}, + produce_device_id = #{produceDeviceId}, + danger_desc = #{dangerDesc}, + danger_reason = #{dangerReason}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + update_report_data_time = #{updateReportDataTime}, + dep_id = #{depId}, + risk_unit_id = #{riskUnitId}, + danger_result = #{dangerResult}, + report_status = #{reportStatus}, + danger_code = #{dangerCode}, + report_switch = #{reportSwitch} + where delete_status = 0 and id = #{id} + </update> + + <!--int deleteDangerManage(PreventDeleteParams deleteParams);--> + <update id="deleteDangerManage"> + update prevent_danger_manage set + registant_name = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + update_report_data_time = #{updateReportDataTime}, + delete_status = 1 + where delete_status = 0 and id = #{id} + </update> + + + <!--int updateManageReportStatus(Long id, byte code);--> + <update id="updateManageReportStatus"> + update prevent_danger_manage set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--List<PreventDangerManage> listReportDanger();--> + <select id="listReportDanger" resultMap="BaseResultMap"> + select * from prevent_danger_manage + where report_switch = 1 and (update_report_data_time > report_time or report_time is null) + order by gmt_create + </select> + + <!--IPage<PreventDangerManage> getDangerManagePageTORectify(Page<Object> objectPage);--> + <select id="getDangerManagePageTORectify" resultMap="BaseResultMap"> + select * from prevent_danger_manage + where delete_status = 0 and (danger_status = 1 or danger_status = 9) + order by gmt_create desc + </select> + + + <select id="countByCreateTime" resultType="Integer"> + select count(id) from prevent_danger_manage + where gmt_create >= #{startTime} and gmt_create < #{endTime} + </select> + + <select id="findByDangerSerialCode" resultMap="BaseResultMap"> + select * + from prevent_danger_manage + where serial_code = #{serialCode} + </select> + <select id="listOwnRectifyPage" + resultMap="PreventTaskRectifyDO"> + select + dangerManage.id manage_id, + dangerManage.uuid manage_uuid, + dangerManage.register_time register_time, + dangerManage.danger_level danger_level, + dangerManage.danger_type danger_type, + dangerManage.danger_source danger_source, + dangerManage.danger_status danger_status, + dangerManage.registant_id registant_id, + dangerManage.produce_device_id produce_device_id, + dangerManage.danger_code danger_code, + dangerManage.registant_name registant_name, + dangerManage.danger_desc danger_desc, + dangerManage.danger_reason danger_reason, + dangerManage.danger_result danger_result, + dangerManage.dep_id dep_id, + dangerManage.risk_unit_id risk_unit_id, + dangerManage.danger_review danger_review, + dangerManage.danger_close_reason danger_close_reason, + rectify.id rectify_id, + rectify.rectify_type rectify_type, + rectify.rectify_time rectify_time, + rectify.liable_person_id liable_person_id, + rectify.check_accept_time check_accept_time, + rectify.check_accept_person_id check_accept_person_id, + rectify.liable_person liable_person, + rectify.check_accept_person check_accept_person, + rectify.rectify_dep_id rectify_dep_id, + rectify.rectify_desc rectify_desc, + rectify.cost cost, + rectify.apply_time rectify_apply_time, + rectify.time_out_desc time_out_desc, + rectify.rectify_info rectify_info + from prevent_danger_manage as dangerManage + left join prevent_danger_rectify as rectify on rectify.danger_manager_id = dangerManage.id + where dangerManage.delete_status = 0 + and rectify.liable_person_id = #{query.currentUid} + and rectify.rectify_time >= now() + and dangerManage.danger_status = 0 + order by rectify.rectify_time asc + + + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageTimeoutMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageTimeoutMapper.xml new file mode 100644 index 0000000..c856a5b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerManageTimeoutMapper.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerManageTimeoutRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerManageTimeout"> + <id property="id" column="id"/> + <result column="delete_status" property="deleteStatus"/> + <result column="danger_rectify_id" property="dangerRectifyId"/> + <result column="danger_manager_id" property="dangerManagerId"/> + <result column="timeout_status" property="timeoutStatus"/> + </resultMap> + + +<!-- PreventDangerManageTimeout getByRectifyId(Long rectifyId);--> + <select id="getByRectifyId" resultMap="BaseResultMap"> + select * from prevent_danger_manage_timeout + where delete_status = 0 and danger_rectify_id = #{dangerRectifyId} + </select> + + <!--PreventDangerManageTimeout getByManageId(Long dangerManagerId);--> + <select id="getByManageId" resultMap="BaseResultMap"> + select * from prevent_danger_manage_timeout + where delete_status = 0 and danger_manager_id = #{dangerManagerId} + </select> + + + <!--int manageTimeout(PreventDangerManageTimeout manageTimeout);--> + <update id="manageTimeout"> + update prevent_danger_manage_timeout set + timeout_status = #{timeoutStatus} + where danger_rectify_id = #{dangerRectifyId} and danger_manager_id = #{dangerManagerId} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerRectifyMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerRectifyMapper.xml new file mode 100644 index 0000000..e90a7a9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventDangerRectifyMapper.xml @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventDangerRectifyRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="rectifyType" column="rectify_type"/> + <result property="rectifyTime" column="rectify_time"/> + <result property="checkAcceptTime" column="check_accept_time"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="dangerCode" column="danger_code"/> + <result property="liablePersonId" column="liable_person_id"/> + <result property="checkAcceptPersonId" column="check_accept_person_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="liablePerson" column="liable_person"/> + <result property="checkAcceptPerson" column="check_accept_person"/> + <result property="rectifyDepId" column="rectify_dep_id"/> + <result property="rectifyDesc" column="rectify_desc"/> + <result property="checkAcceptDesc" column="check_accept_desc"/> + <result property="dangerManagerId" column="danger_manager_id"/> + <result property="dangerManagerUuid" column="danger_manager_uuid"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="cost" property="cost"/> + <result column="apply_time" property="applyTime"/> + <result column="time_out_desc" property="timeOutDesc"/> + <result column="rectify_info" property="rectifyInfo"/> + </resultMap> + + <resultMap id="ResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="rectifyType" column="rectify_type"/> + <result property="rectifyTime" column="rectify_time"/> + <result property="checkAcceptTime" column="check_accept_time"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="dangerCode" column="danger_code"/> + <result property="liablePersonId" column="liable_person_id"/> + <result property="checkAcceptPersonId" column="check_accept_person_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="liablePerson" column="liable_person"/> + <result property="checkAcceptPerson" column="check_accept_person"/> + <result property="rectifyDepId" column="rectify_dep_id"/> + <result property="rectifyDesc" column="rectify_desc"/> + <result property="checkAcceptDesc" column="check_accept_desc"/> + <result property="dangerManagerId" column="danger_manager_id"/> + <result property="dangerManagerUuid" column="danger_manager_uuid"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="cost" property="cost"/> + <result column="apply_time" property="applyTime"/> + <result column="time_out_desc" property="timeOutDesc"/> + <result column="rectify_info" property="rectifyInfo"/> + <association property="preventDangerManage" javaType="com.gk.hotwork.doublePrevention.entity.PreventDangerManage"> + <result column="danger_status" property="dangerStatus"></result> + <result column="serial_code" property="serialCode"></result> + </association> + </resultMap> + + + <!--IPage<PreventDangerManage> getDangerRectifyPage(page, rectifyQueryReqDTO);--> + <select id="getDangerRectifyPage" resultMap="ResultMap"> + select t1.* , t2.id as managerId, t2.danger_status, t2.serial_code from prevent_danger_rectify t1 + left join prevent_danger_manage t2 + on t1.danger_manager_id = t2.id + <where> + t1.delete_status = 0 + <if test="rectifyQueryReqDTO.rectifyType != null"> + and t1.rectify_type = #{rectifyQueryReqDTO.rectifyType} + </if> + <if test="rectifyQueryReqDTO.rectifyDepId != null"> + and t1.rectify_dep_id = #{rectifyQueryReqDTO.rectifyDepId} + </if> + <if test="rectifyQueryReqDTO.dangerStatus != null"> + and t2.danger_status = #{rectifyQueryReqDTO.dangerStatus} + </if> + <if test="rectifyQueryReqDTO.serialCode != null"> + and t2.serial_code = #{rectifyQueryReqDTO.serialCode} + </if> + <if test="rectifyQueryReqDTO.startTime != null"> + and t1.gmt_create >= #{rectifyQueryReqDTO.startTime} and #{rectifyQueryReqDTO.endTime} >= t1.gmt_create + </if> + </where> + order by t1.gmt_create desc,t2.danger_status ASC + </select> + + <!--IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO);--> + <select id="getRectifyOverPage" resultMap="BaseResultMap"> + select * + from prevent_danger_rectify + <where> + delete_status = 0 + <if test="rectifyOverQueryReqDTO.checkAcceptPersonid != null"> + and check_accept_person_id = #{rectifyOverQueryReqDTO.checkAcceptPersonid} + </if> + </where> + </select> + + <!--PreventDangerRectifyService getRectifyByCode(String dangerCode);--> + <select id="getRectifyByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + select + id, + uuid + from prevent_danger_rectify + where delete_status = 0 and danger_code= #{dangerCode} + </select> + + <!--IPage<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO);--> + <select id="getDangerRectifyPageToOverRectify" resultMap="ResultMap"> + select t1.* , t2.id managerId, t2.danger_status from prevent_danger_rectify t1 + left join prevent_danger_manage t2 + on t1.danger_manager_id = t2.id + <where> + t1.delete_status = 0 + <if test="rectifyOverQueryReqDTO.rectifyType != null"> + and t1.rectify_type = #{rectifyOverQueryReqDTO.rectifyType} + </if> + <if test="rectifyOverQueryReqDTO.checkAcceptPersonid != null"> + and t1.check_accept_person_id = #{rectifyOverQueryReqDTO.checkAcceptPersonid} + </if> + <if test="rectifyOverQueryReqDTO.dangerStatus != null"> + and t2.danger_status = #{rectifyOverQueryReqDTO.dangerStatus} + </if> + <if test="rectifyOverQueryReqDTO.status != null"> + and (t2.danger_status = 1 or t2.danger_status = 9) + </if> + <if test="rectifyOverQueryReqDTO.depId != null"> + and t2.dep_id = #{rectifyOverQueryReqDTO.depId} + </if> + </where> + order by t2.danger_status ASC,t1.gmt_create desc + </select> + + + <!--PreventDangerRectify getRectifyById(Long id);--> + <select id="getRectifyById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + select + id, + uuid, + rectify_time, + check_accept_person_id, + liable_person_id, + danger_manager_id + from prevent_danger_rectify + where delete_status = 0 and id= #{id} + </select> + + <!-- PreventDangerRectify getRectifyByManageId(Long manageId);--> + <select id="getRectifyByManageId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + select * from prevent_danger_rectify + where delete_status = 0 and danger_manager_id= #{manageId} + </select> + + <!--PreventDangerRectify getRectifyByManageIdForReport(Long manageId);--> + <select id="getRectifyByManageIdForReport" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify"> + select * from prevent_danger_rectify + where danger_manager_id = #{manageId} + </select> + + <!--int updateRectifyReportStatus(Long id, byte code);--> + <update id="updateRectifyReportStatus"> + update prevent_danger_rectify set + report_status = #{reportStatus}, + report_time = #{reportTime} + where danger_manager_id = #{id} + </update> + + + <!--int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams);--> + <update id="updateRectifyTime"> + update prevent_danger_rectify set + rectify_time = #{rectifyTime}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + time_out_desc = #{timeOutDesc} + where delete_status = 0 and id =#{id} + </update> + + <!--int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams);--> + <update id="updateDangerRectify" > + update prevent_danger_rectify set + rectify_type = #{rectifyType}, + rectify_time = #{rectifyTime}, + cost = #{cost}, + rectify_desc = #{rectifyDesc}, + rectify_dep_id = #{rectifyDepId}, + liable_person_id = #{liablePersonId}, + liable_person = #{liablePerson}, + update_report_data_time = #{updateReportDataTime}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + report_status = #{reportStatus} + where delete_status = 0 and id =#{id} + </update> + + <!--int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams);--> + <update id="applyReport" > + update prevent_danger_rectify set + apply_time = #{applyTime}, + update_report_data_time = #{updateReportDataTime}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + rectify_info = #{rectifyInfo} + where delete_status = 0 and id =#{id} + </update> + + <!--int closeDanger(CloseDangerParams closeDangerParams);--> + <update id="closeDanger"> + update prevent_danger_rectify set + danger_review = #{dangerReview}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName} + where delete_status = 0 and danger_manager_id = #{id} + </update> + + + <!--int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams);--> + <update id="reportRectify" > + update prevent_danger_rectify set + check_accept_time = #{checkAcceptTime}, + check_accept_desc = #{checkAcceptDesc}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus} + where delete_status = 0 and id =#{id} + </update> + + <!--int deleteDangerRectify(PreventDeleteParams deleteParams);--> + <update id="deleteDangerRectify" > + update prevent_danger_rectify set + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime}, + delete_status = 1 + where delete_status = 0 and id =#{id} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventProduceDeviceMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventProduceDeviceMapper.xml new file mode 100644 index 0000000..5791b15 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventProduceDeviceMapper.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventProduceDeviceRepository" > + + <!--IPage selectPage(Long pageIndex, Long pageSize, Map<String, Object> params);--> + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventProduceDevice"> + <id column="id" property="id"/> + <result column="uuid" property="uuid"/> + <result column="delete_status" property="deleteStatus"/> + <result column="risk_level" property="riskLevel"/> + <result column="status" property="status"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_moditify" property="gmtModitify"/> + <result column="dep_id" property="depId"/> + <result column="enterprise_id" property="enterpriseId"/> + <result column="dep_uuid" property="depUuid"/> + <result column="enterprise_uuid" property="enterpriseUuid"/> + <result column="dep_name" property="depName"/> + <result column="create_by_user_name" property="createByUserName"/> + <result column="last_edit_user_name" property="lastEditUserName"/> + <result column="produce_device_name" property="produceDeviceName"/> + <result column="location" property="location"/> + </resultMap> + + <select id="getDevicePage" resultMap="BaseResultMap"> + select * from prevent_produce_device + <where> + delete_status = 0 + <if test="queryParams.riskLevel != null"> + and risk_level = #{queryParams.riskLevel} + </if> + <if test="queryParams.status != null"> + and status = #{queryParams.status} + </if> + <if test="queryParams.depId != null"> + and dep_id = #{queryParams.depId} + </if> + <if test="queryParams.produceDeviceName != null"> + and produce_device_name like '%' #{queryParams.produceDeviceName} '%' + </if> + <if test="queryParams.location != null"> + and location = #{queryParams.location} + </if> + </where> + order by gmt_create desc + </select> + +<!-- List<PreventProduceDevice> getByRiskLevel(Integer riskLevel);--> + <select id="getByRiskLevel" resultType="com.gk.hotwork.doublePrevention.entity.PreventProduceDevice"> + select * from prevent_produce_device where delete_status = 0 and risk_level= #{riskLevel} + </select> + + <!--PreventProduceDevice getByDeviceName(String produceDeviceName);--> + <select id="getByNameAndLocation" resultType="com.gk.hotwork.doublePrevention.entity.PreventProduceDevice"> + select * from prevent_produce_device + where delete_status = 0 and produce_device_name = {produceDeviceName} and location = #{location} + </select> + + <!-- PreventProduceDevice getByDeviceName(String produceDeviceName);--> + <select id="getByDeviceName" resultType="com.gk.hotwork.doublePrevention.entity.PreventProduceDevice"> + select * from prevent_produce_device + where delete_status = 0 and produce_device_name = #{produceDeviceName} + </select> + + <!--PreventProduceDevice selectByDeviceId(Long id);--> + <select id="selectByDeviceId" resultMap="BaseResultMap"> + select + id, + produce_device_name + from prevent_produce_device + where delete_status = 0 and id = #{id} + </select> + + <!--List<PreventProduceDevice> getListDevices();--> + <select id="getListDevices" resultMap="BaseResultMap"> + select + id, + produce_device_name + from prevent_produce_device + where delete_status = 0 + </select> + + <!--PreventProduceDevice getDeviceByNameAndDep(String name, String dep);--> + <select id="getDeviceByNameAndDep" resultType="com.gk.hotwork.doublePrevention.entity.PreventProduceDevice"> + select + id, + produce_device_name + from prevent_produce_device + where delete_status = 0 and produce_device_name = #{name} and dep_name = #{dep} + </select> + <select id="countDeviceEveryLevel" resultType="java.util.Map"> + select + count(if(risk_level = 1,1,null)) lowRisk, + count(if(risk_level = 2,1,null)) generalRisk, + count(if(risk_level = 3,1,null)) higherRisk, + count(if(risk_level = 4,1,null)) majorRisk + from prevent_produce_device + where delete_status = 0 + </select> + + <update id="updateProduceDevice"> + update prevent_produce_device set + produce_device_name = #{produceDeviceName}, + dep_id = #{depId}, + dep_name = #{depName}, + dep_uuid = #{depUuid}, + risk_level = #{riskLevel}, + status = #{status}, + location = #{location}, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify} + where delete_status = 0 and id = #{id} + </update> + + <!--int deleteOne(Long id);--> + <update id="deleteOne"> + update prevent_produce_device set + delete_status = 1, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify} + where id = #{id} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportBatchMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportBatchMapper.xml new file mode 100644 index 0000000..e2e968f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportBatchMapper.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportBatchRepository" > + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportBatch"> + <id column="id" property="id"/> + <result column="batch_id" property="batchId"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="data_type" property="dataType"/> + </resultMap> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckRecordFromTaskMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckRecordFromTaskMapper.xml new file mode 100644 index 0000000..8ede87f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckRecordFromTaskMapper.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportCheckRecordFromTaskRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportCheckRecordFromTask"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="check_task_id" property="checkTaskId"/> + <result column="check_status" property="checkStatus"/> + <result column="check_time" property="checkTime"/> + <result column="create_by_mobile" property="createByMobile"/> + <result column="update_by_mobile" property="updateByMobile"/> + <result column="task_id" property="taskId"/> + </resultMap> + + <!--IPage<PreventReportCheckRecordFromTask> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckRecordFromTaskReqDTO queryReqDTO);--> + <select id="getReportTaskFromWorkPage" resultMap="BaseResultMap"> + select * from prevent_report_check_record_from_task + order by create_by desc + </select> + + <!--List<PreventReportCheckRecordFromTask> listReportTaskRecordDate();--> + <select id="listReportTaskRecordDate" resultMap="BaseResultMap"> + select * from prevent_report_check_record_from_task + where report_status = 1 + limit 200 + </select> + +<!-- PreventReportCheckRecordFromTask getTaskById(String id);--> + <select id="getTaskById" resultMap="BaseResultMap"> + select * from prevent_report_check_record_from_task + where id = #{id} + </select> + <!--int updateTaskReportStatus(HandlerReportParam handlerReportParam);--> + <update id="updateTaskReportStatus"> + update prevent_report_check_record_from_task set + report_status = #{reportStatus}, + report_time = #{reportTime} + where task_id = #{id} + </update> + +<!-- int updateTaskById(String id);--> + <update id="updateTaskById"> + update prevent_report_check_record_from_task set + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime}, + check_task_id = #{checkTaskId}, + check_status = #{checkStatus}, + check_time = #{checkTime}, + create_by_mobile = #{createByMobile}, + update_by_mobile = #{updateByMobile} + where id = #{id} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckTaskFromWorkMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckTaskFromWorkMapper.xml new file mode 100644 index 0000000..5a9420a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportCheckTaskFromWorkMapper.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportCheckTaskFromWorkRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportCheckTaskFromWork"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="troubleshoot_content" property="troubleshootContent"/> + <result column="risk_measure_id" property="riskMeasureId"/> + <result column="check_cycle" property="checkCycle"/> + <result column="check_cycle_unit" property="checkCycleUnit"/> + <result column="work_id" property="workId"/> + </resultMap> + + <!--IPage<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckTaskFromWorkReqDTO queryReqDTO);--> + <select id="getReportTaskFromWorkPage" resultMap="BaseResultMap"> + select * from prevent_report_check_task_from_work + order by create_by desc + </select> + + <!--List<PreventReportCheckTaskFromWork> listReportTaskFromWorkDate();--> + <select id="listReportTaskFromWorkDate" resultMap="BaseResultMap"> + select * from prevent_report_check_task_from_work + where report_status = 1 + limit 200 + </select> + +<!-- PreventReportCheckTaskFromWork getWorkById(String id);--> + <select id="getWorkById" resultMap="BaseResultMap"> + select * from prevent_report_check_task_from_work + where id = #{id} + </select> + +<!-- int updateWorkById(String id);--> + <update id="updateWorkById"> + update prevent_report_check_task_from_work set + report_status = #{reportStatus}, + report_time = #{reportTime} + where work_id = #{id} + </update> + + <!--int updateWorkReportStatus(HandlerReportParam handlerReportParam);--> + <update id="updateWorkReportStatus"> + update prevent_report_check_task_from_work set + risk_measure_id = #{riskMeasureId}, + check_cycle = #{checkCycle}, + check_cycle_unit = #{checkCycleUnit}, + troubleshoot_content = #{troubleshootContent}, + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + +<!-- int insertList(taskFromWorkLists);--> + <insert id="saveList"> + insert into prevent_report_check_task_from_work + ( + id, + risk_measure_id, + check_cycle, + check_cycle_unit, + troubleshoot_content, + company_code, + deleted, + create_date, + create_by, + update_date, + update_by, + data_source, + report_status, + report_time + ) + values + <foreach collection="taskFromWorkLists" item="taskFromWorkList" separator="," > + ( + #{taskFromWorkList.id}, + #{taskFromWorkList.riskMeasureId}, + #{taskFromWorkList.checkCycle}, + #{taskFromWorkList.checkCycleUnit}, + #{taskFromWorkList.troubleshootContent}, + #{taskFromWorkList.companyCode}, + #{taskFromWorkList.deleted}, + #{taskFromWorkList.createDate}, + #{taskFromWorkList.createBy}, + #{taskFromWorkList.updateDate}, + #{taskFromWorkList.updateBy}, + #{taskFromWorkList.dataSource}, + #{taskFromWorkList.reportStatus}, + #{taskFromWorkList.reportTime} + ) + </foreach> + </insert> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigLogMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigLogMapper.xml new file mode 100644 index 0000000..68e865c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigLogMapper.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportConfigLogRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportConfigLog"> + <id property="id" column="id"/> + <result property="reportState" column="report_state"/> + <result property="reportType" column="report_type"/> + <result property="reportData" column="report_data"/> + <result property="reportDataName" column="report_data_name"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + </resultMap> + + <!--IPage<PreventReportConfigLog> getReportConfigLogPage(Page<Object> page, PreventReportConfigLogQueryReqDTO queryReqDTO);--> + <select id="getReportConfigLogPage" resultMap="BaseResultMap"> + select id, report_state, report_type, report_data_name, gmt_moditify, last_edit_user_name, update_info + from prevent_report_config_log + <where> + 1 = 1 + <if test="queryReqDTO.startTime != null"> + and #{queryReqDTO.id} >= gmt_moditify + </if> + <if test="queryReqDTO.endTime != null"> + and gmt_moditify >= #{queryReqDTO.id} + </if> + </where> + order by create_by desc + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigMapper.xml new file mode 100644 index 0000000..e9c8b0a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportConfigMapper.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportConfigRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportConfig"> + <id property="id" column="id"/> + <result property="reportState" column="report_state"/> + <result property="reportType" column="report_type"/> + <result property="reportData" column="report_data"/> + <result property="reportDataName" column="report_data_name"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + </resultMap> + + <!--List<PreventReportConfig> ListReportConfigs();--> + <select id="ListReportConfigs" resultMap="BaseResultMap"> + select id, report_state, report_type, report_data_name, gmt_moditify, last_edit_user_name + from prevent_report_config + order by create_by desc + </select> + + <!--int updateReportConfig(PreventReportConfigUpdateParams updateParams);--> + <update id="updateReportConfig"> + update prevent_report_config set + report_state = #{reportState}, + report_type = #{reportType}, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify} + where id = #{id} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportDangerInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportDangerInfoMapper.xml new file mode 100644 index 0000000..d72afff --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportDangerInfoMapper.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportDangerInfoRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportDangerInfo"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="hazard_code" property="hazardCode"/> + <result column="risk_measure_id" property="riskMeasureId"/> + <result column="check_record_id" property="checkRecordId"/> + <result column="danger_name" property="dangerName"/> + <result column="danger_level" property="dangerLevel"/> + <result column="danger_src" property="dangerSrc"/> + <result column="danger_manage_type" property="dangerManageType"/> + <result column="danger_desc" property="dangerDesc"/> + <result column="danger_reason" property="dangerReason"/> + <result column="control_measures" property="controlMeasures"/> + <result column="cost" property="cost"/> + <result column="danger_manage_deadline" property="dangerManageDeadline"/> + <result column="danger_state" property="dangerState"/> + <result column="hazard_danger_type" property="hazardDangerType"/> + <result column="registrant" property="registrant"/> + <result column="regist_time" property="registTime"/> + <result column="liable_person" property="liablePerson"/> + <result column="check_accept_person" property="checkAcceptPerson"/> + <result column="check_accept_comment" property="checkAcceptComment"/> + <result column="check_accept_time" property="checkAcceptTime"/> + <result column="danger_manager_id" property="dangerManagerId"/> + </resultMap> + + <!--IPage<PreventReportDangerInfo> getReportDangerInfoPage(Page<Object> objectPage, PreventReportDangerInfoReqDTO queryReqDTO);--> + <select id="getReportDangerInfoPage" resultMap="BaseResultMap"> + select * from prevent_report_danger_info + order by create_by desc + </select> + + <!-- List<PreventReportDangerInfo> listReportDangerRecordDate();--> + <select id="listReportDangerDate" resultMap="BaseResultMap"> + select * from prevent_report_danger_info + where report_status = 1 + limit 200 + </select> + + <!--int updateTaskReportStatus(HandlerReportParam handlerReportParam);--> + <update id="updateTaskReportStatus"> + update prevent_report_danger_info set + report_status = #{reportStatus}, + report_time = #{reportTime} + where danger_manager_id = #{id} + </update> + +<!-- PreventReportDangerInfo getDangerById(String id);--> + <select id="getDangerById" resultMap="BaseResultMap"> + select * from prevent_report_danger_info + where id = #{id} + </select> + +<!-- int updateDangerById(String id);--> + <update id="updateDangerById"> + update prevent_report_danger_info set + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + hazard_code = #{hazardCode}, + risk_measure_id = #{riskMeasureId}, + check_record_id = #{checkRecordId}, + danger_name = #{dangerName}, + danger_level = #{dangerLevel}, + danger_src = #{dangerSrc}, + danger_manage_type = #{dangerManageType}, + danger_desc = #{dangerDesc}, + danger_reason = #{dangerReason}, + control_measures = #{controlMeasures}, + cost = #{cost}, + danger_manage_deadline = #{dangerManageDeadline}, + danger_state = #{dangerState}, + hazard_danger_type = #{hazardDangerType}, + registrant = #{registrant}, + regist_time = #{registTime}, + liable_person = #{liablePerson}, + check_accept_person = #{checkAcceptPerson}, + check_accept_comment = #{checkAcceptComment}, + check_accept_time = #{checkAcceptTime}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskAnaUnitMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskAnaUnitMapper.xml new file mode 100644 index 0000000..4d8b47c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskAnaUnitMapper.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportRiskAnaUnitRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportRiskAnaUnit"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="risk_unit_name" property="riskUnitName"/> + <result column="hazard_code" property="hazardCode"/> + <result column="hazard_dep" property="hazardDep"/> + <result column="hazard_liable_person" property="hazardLiablePerson"/> + <result column="risk_unit_id" property="riskUnitId"/> + </resultMap> + + <!--IPage<PreventRiskAnaUnit> getReportRiskUnitPage(Page<Object> page, PreReportRiskUnitQueryReqDTO queryReqDTO);--> + <select id="getReportRiskUnitPage" resultMap="BaseResultMap"> + select * from + prevent_report_risk_ana_unit + <where> + 1 = 1 + <if test="queryReqDTO.riskUnitName != null"> + and liable_person_id = #{queryReqDTO.riskUnitName} + </if> + <if test="queryReqDTO.hazardDep != null"> + and liable_dep_id = #{queryReqDTO.hazardDep} + </if> + <if test="queryReqDTO.hazardLiablePerson != null"> + and risk_unit_name = #{queryReqDTO.hazardLiablePerson} + </if> + </where> + order by create_by desc + </select> + + <!--List<PreventReportRiskAnaUnit> listReportUnitDate();--> + <select id="listReportUnitDate" resultMap="BaseResultMap"> + select * from prevent_report_risk_ana_unit + where report_status = 1 + limit 200 + </select> + +<!-- PreventReportRiskAnaUnit getUnitById(String id);--> + <select id="getUnitById" resultMap="BaseResultMap"> + select * from prevent_report_risk_ana_unit + where id = #{id} + </select> + <!--int updateReportStatus();--> + <update id="updateReportStatus"> + update prevent_report_risk_ana_unit set + report_status = #{reportStatus}, + report_time = #{reportTime} + where risk_unit_id = #{id} + </update> + +<!-- int updateUnitById(PreventReportRiskAnaUnit unitList);--> + <update id="updateUnitById"> + update prevent_report_risk_ana_unit set + risk_unit_name = #{riskUnitName}, + hazard_code = #{hazardCode}, + hazard_dep = #{hazardDep}, + hazard_liable_person = #{hazardLiablePerson}, + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--int saveList(List<PreventReportRiskAnaUnit> unitLists);--> + <insert id="saveList"> + insert into prevent_report_risk_ana_unit + ( + id, + risk_unit_name, + hazard_code, + hazard_dep, + hazard_liable_person, + company_code, + deleted, + create_date, + create_by, + update_date, + update_by, + data_source, + report_status, + report_time + ) + values + <foreach collection="unitLists" item="unitList" separator="," > + ( + #{unitList.id}, + #{unitList.riskUnitName}, + #{unitList.hazardDep}, + #{unitList.hazardDep}, + #{unitList.hazardLiablePerson}, + #{unitList.companyCode}, + #{unitList.deleted}, + #{unitList.createDate}, + #{unitList.createBy}, + #{unitList.updateDate}, + #{unitList.updateBy}, + #{unitList.dataSource}, + #{unitList.reportStatus}, + #{unitList.reportTime} + ) + </foreach> + </insert> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskControlMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskControlMeasureMapper.xml new file mode 100644 index 0000000..fbb2b1c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskControlMeasureMapper.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportRiskControlMeasureRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportRiskControlMeasure"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="risk_event_id" property="riskEventId"/> + <result column="data_src" property="dataSrc"/> + <result column="risk_measure_desc" property="riskMeasureDesc"/> + <result column="troubleshoot_content" property="troubleshootContent"/> + <result column="classify1" property="classify1"/> + <result column="classify2" property="classify2"/> + <result column="classify3" property="classify3"/> + <result column="risk_measure_id" property="riskMeasureId"/> + </resultMap> + +<!-- IPage<PreventReportRiskControlMeasure> getReportMeasurePage();--> + <select id="getReportMeasurePage" resultMap="BaseResultMap"> + select * from prevent_report_risk_control_measure + order by create_by desc + </select> + + <!--List<PreventReportRiskControlMeasure> listReportMeasureDate();--> + <select id="listReportMeasureDate" resultMap="BaseResultMap"> + select * from prevent_report_risk_control_measure + where report_status = 1 + limit 200 + </select> + +<!-- PreventReportRiskControlMeasure getMeasureById(String id);--> + <select id="getMeasureById" resultMap="BaseResultMap"> + select * from prevent_report_risk_control_measure + where id = #{id} + </select> + + <!--int updateMeasureReportStatus(HandlerReportParam handlerReportParam);--> + <update id="updateMeasureReportStatus"> + update prevent_report_risk_control_measure set + report_status = #{reportStatus}, + report_time = #{reportTime} + where risk_measure_id = #{id} + </update> + +<!-- int updateMeasureById(String id);--> + <update id="updateMeasureById"> + update prevent_report_risk_control_measure set + risk_event_id = #{riskEventId}, + data_src = #{dataSrc}, + risk_measure_desc = #{riskMeasureDesc}, + troubleshoot_content = #{troubleshootContent}, + classify1 = #{classify1}, + classify2 = #{classify2}, + classify3 = #{classify3}, + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + <!--int insertList(List<PreventReportRiskControlMeasure> measureLists);--> + <insert id="insertList"> + insert into prevent_report_risk_control_measure + ( + id, + risk_event_id, + data_src, + risk_measure_desc, + troubleshoot_content, + classify1, + classify2, + classify3, + company_code, + deleted, + create_date, + create_by, + update_date, + update_by, + data_source, + report_status, + report_time + ) + values + <foreach collection="measureLists" item="measureList" separator="," > + ( + #{eventList.id}, + #{eventList.riskEventId}, + #{eventList.dataSrc}, + #{eventList.riskMeasureDesc}, + #{eventList.troubleshootContent}, + #{eventList.classify1}, + #{eventList.classify2}, + #{eventList.classify3}, + #{eventList.companyCode}, + #{eventList.deleted}, + #{eventList.createDate}, + #{eventList.createBy}, + #{eventList.updateDate}, + #{eventList.updateBy}, + #{eventList.dataSource}, + #{eventList.reportStatus}, + #{eventList.reportTime} + ) + </foreach> + </insert> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskEventMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskEventMapper.xml new file mode 100644 index 0000000..c03a3e6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventReportRiskEventMapper.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventReportRiskEventRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent"> + <id property="id" column="id"/> + <result column="company_code" property="companyCode"/> + <result column="deleted" property="deleted"/> + <result column="create_date" property="createDate"/> + <result column="create_by" property="createBy"/> + <result column="update_date" property="updateDate"/> + <result column="update_by" property="updateBy"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="data_source" property="dataSource"/> + <result column="risk_event_name" property="riskEventName"/> + <result column="risk_unit_id" property="riskUnitId"/> + <result column="risk_event_id" property="riskEventId"/> + </resultMap> + + <!--IPage<PreventReportRiskEvent> getReportRiskEventPage();--> + <select id="getReportRiskEventPage" resultMap="BaseResultMap"> + select * from prevent_report_risk_event + order by create_by desc + </select> + + <!--List<PreventReportRiskEvent> listReportEventDate();--> + <select id="listReportEventDate" resultMap="BaseResultMap"> + select * from prevent_report_risk_event + where report_status = 1 + limit 200 + </select> + +<!-- PreventReportRiskEvent getEventById(String id);--> + <select id="getEventById" resultMap="BaseResultMap"> + select * from prevent_report_risk_event + where id = #{id} + </select> + + <!--int updateEventReportStatus(HandlerReportParam handlerReportParam);--> + <update id="updateEventReportStatus"> + update prevent_report_risk_event set + report_status = #{reportStatus}, + report_time = #{reportTime} + where risk_event_id = #{id} + </update> + +<!-- int updateEventById(String id);--> + <update id="updateEventById"> + update prevent_report_risk_event set + risk_event_name = #{riskEventName}, + risk_unit_id = #{riskUnitId}, + company_code = #{companyCode}, + deleted = #{deleted}, + create_date = #{createDate}, + create_by = #{createBy}, + update_date = #{updateDate}, + update_by = #{updateBy}, + data_source = #{dataSource}, + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--int insertList(List<PreventReportRiskEvent> eventLists);--> + <insert id="saveList"> + insert into prevent_report_risk_event + ( + id, + risk_event_name, + risk_unit_id, + company_code, + deleted, + create_date, + create_by, + update_date, + update_by, + data_source, + report_status, + report_time + ) + values + <foreach collection="eventLists" item="eventList" separator="," > + ( + #{eventList.id}, + #{eventList.riskEventName}, + #{eventList.riskUnitId}, + #{eventList.companyCode}, + #{eventList.deleted}, + #{eventList.createDate}, + #{eventList.createBy}, + #{eventList.updateDate}, + #{eventList.updateBy}, + #{eventList.dataSource}, + #{eventList.reportStatus}, + #{eventList.reportTime} + ) + </foreach> + </insert> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskAnaUnitMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskAnaUnitMapper.xml new file mode 100644 index 0000000..05699da --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskAnaUnitMapper.xml @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventRiskAnaUnitRepository" > + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit"> + <id column="id" property="id"/> + <result column="uuid" property="uuid"/> + <result column="delete_status" property="deleteStatus"/> + <result column="produce_device_id" property="produceDeviceId"/> + <result column="liable_dep_id" property="liableDepId"/> + <result column="liable_person_id" property="liablePersonId" /> + <result column="enterprise_id" property="enterpriseId"/> + <result column="liable_person_uuid" property="liablePersonUuid"/> + <result column="produce_device_uuid" property="produceDeviceUuid"/> + <result column="liable_dep_uuid" property="liableDepUuid"/> + <result column="enterprise_uuid" property="enterpriseUuid"/> + <result column="risk_code" property="riskCode"/> + <result column="risk_unit_name" property="riskUnitName" jdbcType="VARCHAR"/> + <result column="liable_dep" property="liableDep" jdbcType="VARCHAR"/> + <result column="liable_person" property="liablePerson" jdbcType="VARCHAR"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_moditify" property="gmtModitify" jdbcType="TIMESTAMP"/> + <result column="create_by_user_name" property="createByUserName"/> + <result column="last_edit_user_name" property="lastEditUserName"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="report_switch" property="reportSwitch"/> + </resultMap> + + <!-- IPage<PreventProduceDevice> getRiskUnitPage + (Page<Object> page, String liableDep, String liablePerson, String riskUnitName);--> + <select id="getRiskUnitPage" resultMap="BaseResultMap"> + select * from prevent_risk_ana_unit + <where> + delete_status = 0 + <if test="queryParams.liablePersonId != null"> + and liable_person_id = #{queryParams.liablePersonId} + </if> + <if test="queryParams.liableDepId != null"> + and liable_dep_id = #{queryParams.liableDepId} + </if> + <if test="queryParams.riskUnitName != null"> + and risk_unit_name like '%' #{queryParams.riskUnitName} '%' + </if> + </where> + order by gmt_create desc + </select> + +<!-- PreventRiskAnaUnit getRiskUnitByName(String riskUnitName);--> + <select id="getRiskUnitByName" resultMap="BaseResultMap"> + select * from prevent_risk_ana_unit + where delete_status = 0 and risk_unit_name = #{riskUnitName} + </select> + +<!-- PreventRiskAnaUnit getRiskUnitById(Long riskUnitId);--> + <select id="getRiskUnitById" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit"> + select id, + uuid, + risk_unit_name, + produce_device_id, + report_switch + from prevent_risk_ana_unit + where delete_status = 0 and id = #{riskUnitId} + </select> + + <!--List<PreventRiskAnaUnit> getRiskUnitByDeviceId(Long id);--> + <select id="getRiskUnitByDeviceId" resultMap="BaseResultMap"> + select + id, + uuid, + produce_device_id, + risk_unit_name + from prevent_risk_ana_unit + where delete_status = 0 and produce_device_id = #{deviceId} + </select> + + <!--PreventRiskAnaUnit getRiskUnitByCode(String riskCode);--> + <select id="getRiskUnitByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit"> + select + id, + uuid, + risk_unit_name + from prevent_risk_ana_unit + where delete_status = 0 and risk_code = #{riskCode} + </select> + + <!--List<PreventRiskAnaUnit> listRiskUnits();--> + <select id="listRiskUnits" resultMap="BaseResultMap"> + select + id, + uuid, + risk_unit_name, + produce_device_id + from prevent_risk_ana_unit + where delete_status = 0 + </select> + + <!--int updateRiskAnaUnitReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateRiskAnaUnitReport"> + update prevent_risk_ana_unit set + report_switch = #{reportSwitch} + where id = #{id} + </update> + +<!-- int updateRiskAnaUnitById();--> + <update id="updateRiskAnaUnitById"> + update prevent_risk_ana_unit set + risk_code = #{riskCode}, + risk_unit_name = #{riskUnitName}, + produce_device_id = #{produceDeviceId}, + liable_person_id = #{liablePersonId}, + liable_dep_id = #{liableDepId}, + liable_dep_uuid = #{liableDepUuid}, + liable_person_uuid = #{liablePersonUuid}, + produce_device_uuid = #{produceDeviceUuid}, + liable_dep = #{liableDep}, + liable_person = #{liablePerson}, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus}, + report_switch = #{reportSwitch} + where delete_status = 0 and id = #{id} + </update> + +<!-- int deleteRiskAnaUnitById(PreventRiskAnaUnitDeleteParams deleteParams);--> + <update id="deleteRiskAnaUnitById"> + update prevent_risk_ana_unit set + delete_status = 1, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime} + where delete_status = 0 and id = #{id} + </update> + + + + + <!--int updateReportStatus(Long id, byte code);--> + <update id="updateReportStatus"> + update prevent_risk_ana_unit set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--List<PreventRiskAnaUnit> listRiskAnaUnit();--> + <select id="listRiskAnaUnit" resultMap="BaseResultMap"> + select * from prevent_risk_ana_unit + where report_switch = 1 and (update_report_data_time > report_time or report_time is null) + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlMeasureMapper.xml new file mode 100644 index 0000000..7f0d79f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlMeasureMapper.xml @@ -0,0 +1,292 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventRiskControlMeasureRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="gmtCreate" column="gmt_create"/> + <result property="gmtModitify" column="gmt_moditify"/> + <result property="controlType" column="control_type"/> + <result property="classify1" column="classify1"/> + <result property="classify2" column="classify2"/> + <result property="riskEventId" column="risk_event_id"/> + <result property="enterpriseId" column="enterprise_id"/> + <result property="checkTaskUnitId" column="check_task_unit_id"/> + <result property="checkWorkId" column="check_work_id"/> + <result property="checkTaskId" column="check_task_id"/> + <result property="checkTaskUuid" column="check_task_uuid"/> + <result property="riskEventUuid" column="risk_event_uuid"/> + <result property="enterpriseUuid" column="enterprise_uuid"/> + <result property="checkTaskUnitUuid" column="check_task_unit_uuid"/> + <result property="checkWorkUuid" column="check_work_uuid"/> + <result property="classify3" column="classify3"/> + <result property="controlMeasureCode" column="control_measure_code"/> + <result property="createByUserName" column="create_by_user_name"/> + <result property="lastEditUserName" column="last_edit_user_name"/> + <result property="measureDesc" column="measure_desc"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="report_switch" property="reportSwitch"/> + </resultMap> + + <resultMap id="ResultMap" type="com.gk.hotwork.doublePrevention.entity.dto.PreventRiskControlMeasureListDO"> + <id property="id" column="id"/> + <result property="controlType" column="control_type"/> + <result property="classify1" column="classify1"/> + <result property="classify2" column="classify2"/> + <result property="classify3" column="classify3"/> + <result property="controlMeasureCode" column="control_measure_code"/> + <result property="measureDesc" column="measure_desc"/> + <result property="checkContent" column="check_content"/> + </resultMap> + + <!--IPage<PreventRiskEvent> getRiskControlMeasurePage--> + <select id="getRiskControlMeasurePage" resultMap="BaseResultMap"> + select * + from prevent_risk_control_measure + <where> + delete_status = 0 + <if test="queryParams.riskEventId != null"> + and risk_event_id = #{queryParams.riskEventId} + </if> + <if test="queryParams.controlType != null"> + and control_type = #{queryParams.controlType} + </if> + </where> + order by gmt_create desc + </select> + + <!--List<PreventRiskControlMeasure> getRiskControlMeasureByRiskEventId(Long riskEventId);--> + <select id="getRiskControlMeasureByRiskEventId" resultMap="BaseResultMap"> + select + id, + risk_event_id + from prevent_risk_control_measure + where delete_status = 0 and risk_event_id = #{riskEventId} + </select> + +<!-- PreventRiskControlMeasure getRiskControlMeasureById(Long id);--> + <select id="getRiskControlMeasureByCodeAndEventId" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure"> + select + id, + uuid, + control_measure_code + from prevent_risk_control_measure + where delete_status = 0 and risk_event_id = #{riskEventId} and control_measure_code = #{controlMeasureCode} + </select> + +<!-- PreventRiskControlMeasure getControlMeasureByCode(String measureCode);--> + <select id="getControlMeasureByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure"> + select + id, + uuid, + control_measure_code + from prevent_risk_control_measure + where delete_status = 0 and control_measure_code = #{measureCode} + </select> + + <!--List<PreventRiskControlMeasure> getControlMeasureByWorkId(Long workId);--> + <select id="getControlMeasureByWorkId" resultMap="BaseResultMap"> + select + id, + uuid, + control_measure_code + from prevent_risk_control_measure + where delete_status = 0 and risk_work_id = #{workId} + </select> + + <!--List<PreventRiskControlMeasure> getListByUnitId(Long taskUnitId);--> + <select id="getListByUnitId" resultMap="BaseResultMap"> + select * + from prevent_risk_control_measure + where delete_status = 0 and check_task_unit_id = #{taskUnitId} + </select> + + <!--List<PreventRiskControlMeasure> listControlMeasure(); todo --> + <select id="listControlMeasure" resultMap="ResultMap"> + select + id, + control_measure_code, + control_type, + classify1, + classify2, + classify3, + measure_desc, + check_content + from + (select + t1.id id, + t1.control_measure_code control_measure_code, + t1.control_type control_type, + t1.classify1 classify1, + t1.classify2 classify2, + t1.classify3 classify3, + t1.measure_desc measure_desc, + t2.check_content check_content + from prevent_risk_control_measure t1 + left join prevent_danger_check_content t2 on t1.id = t2.control_measure_id + where t1.delete_status = 0) t + </select> + + <!--PreventRiskControlMeasure selectByMeasureId(Long id);--> + <select id="selectByMeasureId" resultMap="BaseResultMap"> + select * from prevent_risk_control_measure + where delete_status = 0 and id = #{id} + </select> + + <!--int updateRiskControlMeasure(PreventRiskControlMeasureUpdateParams updateParams);--> + <update id="updateRiskControlMeasure" > + update prevent_risk_control_measure set + control_measure_code = #{controlMeasureCode}, + control_type = #{controlType}, + gmt_moditify = #{gmtModitify}, + classify1 = #{classify1}, + classify2 = #{classify2}, + classify3 = #{classify3}, + risk_event_id= #{riskEventId}, + risk_event_uuid = #{riskEventUuid}, + last_edit_user_name = #{lastEditUserName}, + measure_desc = #{measureDesc}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus}, + report_switch = #{reportSwitch} + where delete_status = 0 and id = #{id} + </update> + + <!--void updateTaskIdByMeasureCode(Long measureId, long taskId);--> + <update id="updateTaskIdByMeasureCode" > + update prevent_risk_control_measure set + check_task_id = #{taskId} + where delete_status = 0 and control_measure_id = #{measureId} + </update> + + <!--int updateControlMeasureByMeasureIdAndUnitId(Long measureId, Long taskUnitId)--> + <update id="updateControlMeasureByMeasureIdAndUnitId" > + update prevent_risk_control_measure set + check_task_unit_id = #{taskUnitId} + where delete_status = 0 and id = #{measureId} + </update> + + <!--int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateRiskEventReport"> + update prevent_risk_control_measure set + report_switch = #{reportSwitch} + where id = #{id} + </update> + + <!--int deleteTaskIdByMeasureCode(String measureCode);--> + <update id="deleteTaskIdByMeasureCode" > + update prevent_risk_control_measure set + check_task_id = 0 + where delete_status = 0 and control_measure_code = #{measureCode} + </update> + <!--int deleteRiskControlMeasure();--> + <update id="deleteRiskControlMeasure" > + update prevent_risk_control_measure set + delete_status = 1, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime} + where delete_status = 0 and id = #{id} + </update> + + <!--PreventRiskControlMeasure updateWorkIdByMeasureCode(String controlMeasureCode, long checkWorkId);--> + <update id="updateWorkIdByMeasureCode" > + update prevent_risk_control_measure set + risk_work_id = #{checkWorkId} + where delete_status = 0 and control_measure_code = #{controlMeasureCode} + </update> + + <!--int updateControlMeasureByCodeAndUnitId(String measureCode, Long taskUnitId);--> + <update id="updateControlMeasureByCodeAndUnitId" > + update prevent_risk_control_measure set + check_task_unit_id = #{taskUnitId} + where delete_status = 0 and control_measure_code = #{measureCode} + </update> + +<!-- int updateControlMeasureByUnitId(Long id);--> + <update id="updateControlMeasureByUnitId" > + update prevent_risk_control_measure set + check_task_unit_id = null + where delete_status = 0 and check_task_unit_id = #{unitId} + </update> + + + + <!--int updateMeasureReportStatus(Long id, byte code);--> + <update id="updateMeasureReportStatus"> + update prevent_risk_control_measure set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + <!--IPage<PreventRiskControlMeasureListDO> listControlMeasurePage(Page<Object> objectPage, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO);--> + <select id="listControlMeasurePage" resultMap="ResultMap"> + select * from prevent_risk_control_measure + <where> + delete_status = 0 + <if test="listQueryReqDTO.controlType != null"> + and control_type = #{listQueryReqDTO.controlType} + </if> + <if test="listQueryReqDTO.controlMeasureCode != null"> + and control_measure_code like '%' #{listQueryReqDTO.controlMeasureCode} '%' + </if> + <if test="listQueryReqDTO.classify1 != null"> + and classify1 = #{listQueryReqDTO.classify1} + </if> + <if test="listQueryReqDTO.classify2 != null"> + and classify2 = #{listQueryReqDTO.classify2} + </if> + </where> + </select> + + + <!--PreventRiskControlMeasure getControlMeasureByUuid(measureUuid);--> + <select id="getControlMeasureByUuid" resultMap="BaseResultMap"> + select * from prevent_risk_control_measure + where uuid = #{measureUuid} + </select> + + <!--List<PreventRiskControlMeasure> listReportMeasure();--> + <select id="listReportMeasure" resultMap="BaseResultMap"> + select * from prevent_risk_control_measure + where report_switch = 1 and (update_report_data_time > report_time or report_time is null) + </select> + + +<!-- List<PreventrCheckContentRespDTO> getControlMeasureAndContent(List<Long> idList);--> + <select id="getControlMeasureAndContent" resultMap="BaseResultMap"> + select + t1.id, + t1.control_type, + t1.classify1, + t1.classify2, + t1.classify3, + t1.measure_desc, + t1.control_measure_code, + t1.check_task_id + from prevent_risk_control_measure t1 + where t1.delete_status = 0 and t1.id in + <foreach collection="list" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </select> +<!-- List<PreventRiskControlMeasure> listAllControlMeasure();--> + <select id="listAllControlMeasure" resultMap="BaseResultMap"> + select + id, + control_type, + classify1, + classify2, + classify3, + measure_desc, + control_measure_code, + check_task_id + from prevent_risk_control_measure + where delete_status = 0 + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlTemplateMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlTemplateMapper.xml new file mode 100644 index 0000000..69ad1fe --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskControlTemplateMapper.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" ><mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventRiskControlTemplateRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventRiskControlTemplate"> + <id property="id" column="id"/> + <result property="uuid" column="uuid"/> + <result property="deleteStatus" column="delete_status"/> + <result property="orderIndex" column="order_index"/> + <result property="parentId" column="parent_id"/> + <result property="riskMeasureName" column="risk_measure_name"/> + </resultMap> + + <!--List<PreventRiskControlTemplate> listMeasureTemplates();--> + <select id="listMeasureTemplates" resultMap="BaseResultMap"> + select + id, + order_index, + parent_id, + risk_measure_name + from prevent_risk_control_template + where delete_status = 0 + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskEventMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskEventMapper.xml new file mode 100644 index 0000000..a50f5ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskEventMapper.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventRiskEventRepository" > + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventRiskEvent"> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="uuid" property="uuid" jdbcType="CHAR"/> + <result column="delete_status" property="deleteStatus" jdbcType="TINYINT"/> + <result column="risk_unit_id" property="riskUnitId" jdbcType="BIGINT"/> + <result column="enterprise_id" property="enterpriseId" jdbcType="BIGINT"/> + <result column="enterprise_uuid" property="enterpriseUuid" jdbcType="CHAR"/> + <result column="risk_unit_uuid" property="riskUnitUuid" jdbcType="CHAR"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_moditify" property="gmtModitify" jdbcType="TIMESTAMP"/> + <result column="create_by_user_name" property="createByUserName" jdbcType="VARCHAR"/> + <result column="last_edit_user_name" property="lastEditUserName" jdbcType="VARCHAR"/> + <result column="event_result" property="eventResult"/> + <result column="risk_event_name" property="riskEventName" jdbcType="VARCHAR"/> + <result column="report_status" property="reportStatus"/> + <result column="report_time" property="reportTime"/> + <result column="update_report_data_time" property="updateReportDataTime"/> + <result column="report_switch" property="reportSwitch"/> + </resultMap> + + <!--IPage<PreventRiskEvent> getRiskUnitPage(PreventRiskEventQueryReqDTO riskEventQueryReqDTO);--> + <select id="getRiskEventPage" resultMap="BaseResultMap"> + select * from prevent_risk_event + <where> + delete_status = 0 + <if test="queryParams.riskEventName != null"> + and risk_event_name like '%' #{queryParams.riskEventName} '%' + </if> + <if test="queryParams.riskUnitId != null"> + and risk_unit_id = #{queryParams.riskUnitId} + </if> + </where> + order by gmt_create desc + </select> + + <!--PreventRiskEvent getRiskEventByName(String riskEventName);--> + <select id="getRiskEventByName" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskEvent"> + select + id, + uuid, + risk_event_name + from prevent_risk_event + where delete_status = 0 and risk_event_name = #{riskEventName} + </select> + + <!--PreventRiskEvent getRiskEventNameById(Long id);--> + <select id="getRiskEventNameById" resultType="com.gk.hotwork.doublePrevention.entity.PreventRiskEvent"> + select + id, + uuid, + risk_event_name, + report_switch + from prevent_risk_event + where delete_status = 0 and id = #{id} + </select> + <!--List<PreventRiskEvent> getRiskEventNameByRiskUnitId(Long riskUnitId);--> + <select id="getRiskEventNameByRiskUnitId" resultMap="BaseResultMap"> + select + id, + risk_event_name + from prevent_risk_event + where delete_status = 0 and risk_unit_id = #{riskUnitId} + </select> + + <!--List<PreventRiskEvent> getListEvents();--> + <select id="getListEvents" resultMap="BaseResultMap"> + select + id, + uuid, + risk_event_name + from prevent_risk_event + where delete_status = 0 + </select> + + <!--int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> + <update id="updateRiskEventReport"> + update prevent_risk_ana_unit set + report_switch = #{reportSwitch} + where id = #{id} + </update> + + <!--int updateRiskEvent(PreventRiskEventUpdateParams updateParams);--> + <update id="updateRiskEvent"> + update prevent_risk_event set + risk_event_name = #{riskEventName}, + risk_unit_id = #{riskUnitId}, + event_result = #{eventResult}, + risk_unit_uuid = #{riskUnitUuid}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName}, + update_report_data_time = #{updateReportDataTime}, + report_status = #{reportStatus}, + report_switch = #{reportSwitch} + where delete_status = 0 and id = #{id} + </update> + + <!--int deleteRiskEventById(PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO);--> + <update id="deleteRiskEventById"> + update prevent_risk_event set + delete_status = 1, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify}, + update_report_data_time = #{updateReportDataTime} + where delete_status = 0 and id = #{id} + </update> + + <!--int updateEventReportStatus(Long id, byte code);--> + <update id="updateEventReportStatus"> + update prevent_risk_event set + report_status = #{reportStatus}, + report_time = #{reportTime} + where id = #{id} + </update> + + + + + <!--List<PreventRiskEvent> listReportEvent();--> + <select id="listReportEvent" resultMap="BaseResultMap"> + select * from prevent_risk_event + where report_switch = 1 and (update_report_data_time > report_time or report_time is null) + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskMapMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskMapMapper.xml new file mode 100644 index 0000000..860e288 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventRiskMapMapper.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventRiskMapRepository" > + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventRiskMap"> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="uuid" property="uuid" jdbcType="CHAR"/> + <result column="delete_status" property="deleteStatus" jdbcType="TINYINT"/> + <result column="desc_info" property="descInfo" jdbcType="VARCHAR"/> + <result column="enterprise_id" property="enterpriseId" jdbcType="BIGINT"/> + <result column="enterprise_uuid" property="enterpriseUuid" jdbcType="CHAR"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_moditify" property="gmtModitify" jdbcType="TIMESTAMP"/> + <result column="create_by_user_name" property="createByUserName" jdbcType="VARCHAR"/> + <result column="last_edit_user_name" property="lastEditUserName" jdbcType="VARCHAR"/> + <result column="img_path" property="imgPath" jdbcType="VARCHAR"/> + </resultMap> + + <!-- IPage<PreventProduceDevice> getMapPage(Page<Object> page);--> + <select id="getMapPage" resultMap="BaseResultMap"> + select * from prevent_risk_map where delete_status = 0 + </select> + + <!--int deleteRiskMap(Long id);--> + <update id="deleteRiskMap"> + update prevent_risk_map set delete_status = 1 + where delete_status = 0 and id = #{id} + </update> + + <!--int updateRiskMap(Long id, String imgPath, String descInfo, Date gmtModitify, String lastEditByUserName);--> + <update id="updateRiskMap"> + update prevent_risk_map set + desc_info = #{descInfo}, + last_edit_user_name = #{lastEditUserName}, + gmt_moditify = #{gmtModitify} + where delete_status = 0 and id = #{id} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskAndMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskAndMeasureMapper.xml new file mode 100644 index 0000000..4ebb7ae --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskAndMeasureMapper.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventTaskAndMeasureRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventTaskAndMeasure"> + <id property="id" column="id"/> + <result property="controlMeasureId" column="control_measure_id"/> + <result property="checkTaskId" column="check_task_id"/> + <result property="checkContent" column="check_content"/> + <result property="deleteStatus" column="delete_status"/> + <result property="checkResult" column="check_result"/> + </resultMap> + + <!--void updateTaskAndMeasureByTaskId(Long TaskId);--> + <update id="deleteTaskAndMeasureByTaskId"> + update prevent_task_and_measure set + delete_status = 1 + where check_task_id = #{checkTaskId} + </update> + + <!--List<PreventTaskAndMeasure> getListByTaskId(Long taskId);--> + <select id="getListByTaskId" resultMap="BaseResultMap"> + select + id, + check_task_id, + control_measure_id, + check_content, + check_result + from prevent_task_and_measure + where delete_status = 0 and check_task_id = #{taskId} + </select> + + <!-- PreventTaskAndMeasure getTaskAndMeasureByTaskId(Long taskId);--> + <select id="getTaskAndMeasureByTaskId" resultMap="BaseResultMap"> + select + id, + check_task_id, + control_measure_id, + check_content, + check_result + from prevent_task_and_measure + where delete_status = 0 and check_task_id = #{taskId} + </select> + + <!--int updateCheckResult(PreventCheckResultParams checkResultParams);--> + <update id="updateCheckResult"> + update prevent_task_and_measure set + check_result = #{checkResult} + where id = #{id} + </update> +<!-- List<PreventTaskAndMeasure> getListByTaskIdByIdList(List<Long> taskIdLists);--> + <select id="getListByTaskIdByIdList" resultMap="BaseResultMap"> + select + id, + check_task_id, + control_measure_id, + check_content, + check_result + from prevent_task_and_measure + where delete_status = 0 and check_task_id in + <foreach collection="list" item="taskId" open="(" separator="," close=")"> + #{taskId} + </foreach> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskUnitAndMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskUnitAndMeasureMapper.xml new file mode 100644 index 0000000..9ec6550 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventTaskUnitAndMeasureMapper.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventTaskUnitAndMeasureRepository" > + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventTaskUnitAndMeasure"> + <id column="id" property="id"/> + <result column="delete_status" property="deleteStatus"/> + <result column="task_unit_id" property="taskUnitId"/> + <result column="task_unit_uuid" property="taskUnitUuid"/> + <result column="measure_id" property="measureId"/> + <result column="measure_uuid" property="measureUuid"/> + <result column="gmt_create" property="gmtCreate"/> + <result column="gmt_moditify" property="gmtModitify"/> + <result column="create_by_user_name" property="createByUserName"/> + <result column="last_edit_user_name" property="lastEditUserName"/> + </resultMap> + + <!--List<PreventRiskControlMeasure> getListByUnitId(Long taskUnitId);--> + <select id="getListByUnitId" resultMap="BaseResultMap"> + select * from prevent_task_unit_and_measure + where delete_status = 0 and task_unit_id = #{taskUnitId} + </select> + + <!--List<PreventTaskUnitAndMeasure> getListByMeasureId(Long measureId);--> + <select id="getListByMeasureId" resultMap="BaseResultMap"> + select * from prevent_task_unit_and_measure + where delete_status = 0 and measure_id = #{measureId} + </select> + + <!--int deleteTaskUnitAndMeasure(PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams);--> + <update id="deleteTaskUnitAndMeasure"> + update prevent_task_unit_and_measure set + delete_status = #{deleteStatus}, + gmt_moditify = #{gmtModitify}, + last_edit_user_name = #{lastEditUserName} + where delete_status = 0 and task_unit_id = #{taskUnitId} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventWorkAndMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventWorkAndMeasureMapper.xml new file mode 100644 index 0000000..0b60ec6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/doublePrevention/PreventWorkAndMeasureMapper.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.doublePrevention.repository.PreventWorkAndMeasureRepository"> + + <resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventWorkAndMeasure"> + <id property="id" column="id"/> + <result property="measureUuid" column="measure_uuid"/> + <result property="workUuid" column="work_uuid"/> + <result property="measureId" column="measure_id"/> + <result property="workId" column="work_id"/> + </resultMap> + + + + <delete id="updateWorkAndMeasure"> + delete from prevent_work_and_measure + where work_uuid = #{workUuid} + </delete> + + <!--PreventWorkAndMeasure getWorkAndMeasure(String workUuid, String measureUuid);--> + <select id="getWorkAndMeasure" resultType="com.gk.hotwork.doublePrevention.entity.PreventWorkAndMeasure"> + select * from prevent_work_and_measure + where work_uuid = #{workUuid} and measure_uuid = #{measureUuid} + </select> + +<!-- PreventWorkAndMeasure getWorkAndMeasureByWorkUuid(String workUuid);--> + <select id="getWorkAndMeasureByWorkUuid" resultMap="BaseResultMap"> + select * from prevent_work_and_measure + where work_uuid = #{workUuid} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/AppFileInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/AppFileInfoMapper.xml new file mode 100644 index 0000000..348c025 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/AppFileInfoMapper.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.AppFileInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.AppFileInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="filetype" property="filetype" jdbcType="VARCHAR" /> + <result column="filename" property="filename" jdbcType="VARCHAR" /> + <result column="fileurl" property="fileurl" jdbcType="VARCHAR" /> + <result column="version" property="version" jdbcType="INTEGER" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + <result column="created" property="created" jdbcType="TIMESTAMP" /> + <result column="updated" property="updated" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, filetype, filename, fileurl, version, remark, created, updated + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from appfile + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.AppFileInfo"> + select + <include refid="Base_Column_List" /> + from appfile + <where> + 1=1 + <if test="condition.filetype != null and condition.filetype !=''"> + and filetype = #{filetype} + </if> + </where> + </select> + <select id="selectNew" resultType="com.gk.hotwork.Domain.AppFileInfo"> + select + <include refid="Base_Column_List" /> + from appfile + <where> + 1=1 + <if test="filetype != null and filetype !=''"> + and filetype = #{filetype} + </if> + </where> + order by version desc + limit 1 + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from appfile + where id = #{id,jdbcType=BIGINT} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.AppFileInfo" > + <!-- --> + update appfile + <set > + <if test="filetype != null" > + filetype = #{filetype,jdbcType=VARCHAR}, + </if> + <if test="filename != null" > + filename = #{filename,jdbcType=VARCHAR}, + </if> + <if test="fileurl != null" > + fileurl = #{fileurl,jdbcType=VARCHAR}, + </if> + <if test="version != null" > + version = #{version,jdbcType=INTEGER}, + </if> + <if test="remark != null" > + remark = #{remark,jdbcType=VARCHAR}, + </if> + <if test="created != null" > + created = #{created,jdbcType=TIMESTAMP}, + </if> + <if test="updated != null" > + updated = #{updated,jdbcType=TIMESTAMP}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.AppFileInfo" > + <!-- --> + update appfile + set filetype = #{filetype,jdbcType=VARCHAR}, + filename = #{filename,jdbcType=VARCHAR}, + fileurl = #{fileurl,jdbcType=VARCHAR}, + version = #{version,jdbcType=INTEGER}, + remark = #{remark,jdbcType=VARCHAR}, + created = #{created,jdbcType=TIMESTAMP}, + updated = #{updated,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/AuthorizationInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/AuthorizationInfoMapper.xml new file mode 100644 index 0000000..ce965fd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/AuthorizationInfoMapper.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.AuthorizationInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.AuthorizationInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="enterprisenumber" property="enterprisenumber" jdbcType="VARCHAR" /> + <result column="authcode" property="authcode" jdbcType="VARCHAR" /> + <result column="authcodeprefix" property="authcodeprefix" jdbcType="VARCHAR" /> + <result column="contractcode" property="contractcode" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + <result column="lasttime" property="lasttime" jdbcType="TIMESTAMP" /> + <result column="status" property="status" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, enterprisenumber, authcode, authcodeprefix, contractcode, createdat, createdby, + flag, lasttime, status + </sql> + <select id="selectByUser" resultType="com.gk.hotwork.Domain.AuthorizationInfo"> + select * + from authorization + where + enterprisenumber = #{enterprisenumber} + and authcode = #{authcode} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/BlackListInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/BlackListInfoMapper.xml new file mode 100644 index 0000000..96653e3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/BlackListInfoMapper.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.BlackListInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.BlackListInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="company" property="company" jdbcType="VARCHAR" /> + <result column="contactname" property="contactname" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, company, contactname, createdby, createdat, modifiedby, modifiedat, flag + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.BlackListInfo"> + select + <include refid="Base_Column_List"/> + from blacklist + <where> + 1=1 + <if test="condition.company != null and condition.company != ''"> + and `company` like concat('%',#{condition.company},'%') + </if> + </where> + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/CompanyInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/CompanyInfoMapper.xml new file mode 100644 index 0000000..9297928 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/CompanyInfoMapper.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.CompanyInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.CompanyInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="code" property="code" jdbcType="VARCHAR" /> + <result column="company" property="company" jdbcType="VARCHAR" /> + <result column="contactname" property="contactname" jdbcType="VARCHAR" /> + <result column="contactphone" property="contactphone" jdbcType="VARCHAR" /> + <result column="ismain" property="ismain" jdbcType="TINYINT" /> + <result column="province" property="province" jdbcType="VARCHAR" /> + <result column="city" property="city" jdbcType="VARCHAR" /> + <result column="area" property="area" jdbcType="VARCHAR" /> + <result column="town" property="town" jdbcType="VARCHAR" /> + <result column="community" property="community" jdbcType="VARCHAR" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + <result column="longitude" property="longitude" jdbcType="VARCHAR" /> + <result column="latitude" property="latitude" jdbcType="VARCHAR" /> + <result column="isbanned" property="isbanned" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id,code,company, contactname, contactphone, ismain, province, city, area, town, community, isdel, + createdby,createddate, lastmodifiedby, lastmodifieddate, longitude, latitude, isbanned + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.CompanyInfo"> + select * + from company + <where> + 1=1 + and isdel = 0 + <if test="condition.company != null and condition.company !=''"> + and company like concat('%',#{condition.company},'%') + </if> + <if test="condition.province != null and condition.province !=''"> + and province like concat('%',#{condition.province},'%') + </if> + <if test="condition.city != null and condition.city !=''"> + and city like concat('%',#{condition.city},'%') + </if> + <if test="condition.area != null and condition.area !=''"> + and area like concat('%',#{condition.area},'%') + </if> + <if test="condition.town != null and condition.town !=''"> + and town like concat('%',#{condition.town},'%') + </if> + <if test="condition.community != null and condition.community !=''"> + and community like concat('%',#{condition.community},'%') + </if> + <if test="condition.isMain != null "> + and ismain = #{condition.isMain} + </if> + </where> + </select> + <select id="selectExistByName" resultType="com.gk.hotwork.Domain.CompanyInfo"> + select * + from company + <where> + isdel = 0 + and company = #{company} + <if test="id != null"> + and id != #{id} + </if> + </where> + </select> + <select id="selectByAll" resultType="com.gk.hotwork.Domain.CompanyInfo"> + select * + from company + where isdel = 0 + and isbanned = 0 + </select> + <select id="selectExistMain" resultType="com.gk.hotwork.Domain.CompanyInfo"> + select * + from company + where isdel = 0 + and ismain = 1 + <if test="id != null"> + and id != #{id} + </if> + limit 1 + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/DepartmentInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/DepartmentInfoMapper.xml new file mode 100644 index 0000000..ee3a6e5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/DepartmentInfoMapper.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.DepartmentInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DepartmentInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="department" property="department" jdbcType="VARCHAR" /> + <result column="issafety" property="issafety" jdbcType="TINYINT" /> + <result column="isanalysis" property="isanalysis" jdbcType="TINYINT" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + id, department, issafety, isanalysis, isdel, createdby,createddate, lastmodifiedby, lastmodifieddate + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.Vo.DepartmentVo"> + select * + from department + <where> + 1=1 + and isdel = 0 + <if test="condition.department != null and condition.department !=''"> + and department like concat('%',#{condition.department},'%') + </if> + </where> + </select> + <select id="selectExistByName" resultType="com.gk.hotwork.Domain.DepartmentInfo"> + select * + from department + <where> + 1=1 + and isdel = 0 + and department = #{department} + <if test="id != null"> + and id != #{id} + </if> + </where> + </select> + <select id="selectByAll" resultType="com.gk.hotwork.Domain.Vo.DepartmentVo"> + select * + from department + where isdel = 0 + </select> + <select id="selectSafety" resultType="com.gk.hotwork.Domain.DepartmentInfo"> todo + select * + from department + where isdel = 0 + and issafety = 1 + <if test="id != null"> + and id != #{id} + </if> + </select> + <select id="selectCountForExam" parameterType="java.util.Map" resultType="java.lang.Integer"> + select count(0) + from department + where isdel = 0 + <if test="name != null and name != ''"> + and department like concat("%",#{name},"%") + </if> + </select> + <select id="selectPageForExam" parameterType="java.util.Map" resultMap="BaseResultMap"> + select * + from department + where isdel = 0 + <if test="name != null and name != ''"> + and department like concat("%",#{name},"%") + </if> + <if test="first != null and pageSize != null"> + limit #{first},#{pageSize} + </if> + </select> + + <!--void getInfoByName(String departmentName);--> + <select id="getInfoByName" resultType="com.gk.hotwork.Domain.DepartmentInfo"> + select * from department where isdel =0 and department = #{departmentName} + </select> + + <!--DepartmentInfo getDepartmentInfoById(Long depId);--> + <select id="getDepartmentInfoById" resultType="com.gk.hotwork.Domain.DepartmentInfo"> + select * from department where isdel =0 and id = #{depId} + </select> + <select id="listDepByDepIds" resultType="com.gk.hotwork.Domain.DepartmentInfo"> + select * from department + where isdel =0 + and id in + <foreach collection="list" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + + </select> +<!-- List<DepartmentInfo> listDepartmentInfoById();--> + <select id="listDepartmentInfoById" resultMap="BaseResultMap"> + select * from department where isdel =0 + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/DeviceLoactionMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/DeviceLoactionMapper.xml new file mode 100644 index 0000000..fa923f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/DeviceLoactionMapper.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.DeviceLocationMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DeviceLocation" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <id column="root_area_id" property="rootAreaId" jdbcType="BIGINT" /> + <id column="area_id" property="areaId" jdbcType="BIGINT" /> + <id column="gate_id" property="gateId" jdbcType="VARCHAR" /> + <id column="device_type" property="deviceType" jdbcType="VARCHAR" /> + <id column="tag_id" property="tagId" jdbcType="VARCHAR" /> + <id column="uid" property="uid" jdbcType="VARCHAR" /> + <id column="user_id" property="userId" jdbcType="VARCHAR" /> + <id column="router_id" property="routerId" jdbcType="VARCHAR" /> + <id column="raise_time" property="raiseTime" jdbcType="VARCHAR" /> + <id column="x" property="x" jdbcType="DECIMAL" /> + <id column="y" property="y" jdbcType="DECIMAL" /> + <id column="z" property="z" jdbcType="DECIMAL" /> + <id column="floor" property="floor" jdbcType="INTEGER" /> + <id column="direction" property="direction" jdbcType="INTEGER" /> + <id column="speed" property="speed" jdbcType="DECIMAL" /> + <id column="silent" property="silent" jdbcType="BOOLEAN" /> + <id column="longitude" property="longitude" jdbcType="DECIMAL" /> + <id column="altitude" property="altitude" jdbcType="DECIMAL" /> + <id column="latitude" property="latitude" jdbcType="DECIMAL" /> + <id column="gps_type" property="gpsType" jdbcType="VARCHAR" /> + <id column="mode" property="mode" jdbcType="VARCHAR" /> + <id column="create_time" property="createTime" jdbcType="DATE" /> + + </resultMap> + + <sql id="base_columns"> + root_area_id, + area_id, + gate_id, + device_type, + tag_id, + uid, + user_id, + router_id, + raise_time, + x, + y, + z, + floor, + direction, + speed, + silent, + longitude, + altitude, + latitude, + gps_type, + mode, + create_time + </sql> + + <insert id="insertOne"> + insert into device_location_slice${slice} + (<include refid="base_columns"></include>) + values( + #{location.rootAreaId}, + #{location.areaId}, + #{location.gateId}, + #{location.deviceType}, + #{location.tagId}, + #{location.uid}, + #{location.userId}, + #{location.routerId}, + #{location.raiseTime}, + #{location.x}, + #{location.y}, + #{location.z}, + #{location.floor}, + #{location.direction}, + #{location.speed}, + #{location.silent}, + #{location.longitude}, + #{location.altitude}, + #{location.latitude}, + #{location.gpsType}, + #{location.mode}, + #{location.createTime} + + ) + + + </insert> + <delete id="deleteRecordBeforeDays"> + delete from device_location_slice${slice} + where create_time < date_sub(now(),INTERVAL #{days} DAY) + </delete> + <select id="selectLatestUserLocation" resultMap="BaseResultMap"> + + select + <include refid="base_columns"/> + from device_location_slice${slice} + where uid = #{uid} + order by raise_time desc + limit 1 + </select> + <select id="selectUserLocations" resultType="com.gk.hotwork.Domain.DeviceLocation"> + select + <include refid="base_columns"/> + from device_location_slice${slice} + where + uid = #{uid} + and raise_time > #{starttime} + and raise_time < #{endtime} + order by raise_time + + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryItemInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryItemInfoMapper.xml new file mode 100644 index 0000000..1310f79 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryItemInfoMapper.xml @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.DictionaryItemInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DictionaryItemInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="sort" property="sort" jdbcType="INTEGER" /> + <result column="status" property="status" jdbcType="TINYINT" /> + <result column="text" property="text" jdbcType="VARCHAR" /> + <result column="value" property="value" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" /> + <result column="description" property="description" jdbcType="VARCHAR" /> + <result column="typeid" property="typeid" jdbcType="BIGINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, sort, status, text, value, createdby, createddate, modifiedby, modifieddate, + description, typeid + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from dictionaryitem + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.DictionaryItemInfo"> + select + <include refid="Base_Column_List" /> + from dictionaryitem + <where> + 1=1 + and status = 1 + <if test="condition.name != null and condition.name != ''"> + and text like concat('%',#{condition.name},'%') + </if> + <if test="condition.dictionaryTypeId != null"> + and typeid = #{condition.dictionaryTypeId} + </if> + </where> + </select> + <select id="selectExistInfo" resultType="com.gk.hotwork.Domain.DictionaryTypeInfo"> + select + <include refid="Base_Column_List" /> + from dictionaryitem + <where> + 1=1 + and id != #{id} + <if test="value != null and value != ''"> + and value = #{value} + </if> + <if test="text != null and text !=''"> + and text = #{text} + </if> + </where> + </select> + <select id="selectByType" resultType="com.gk.hotwork.Domain.DictionaryItemInfo"> + select + dictionaryitem.* + from dictionaryitem + left join dictionarytype on dictionarytype.id = dictionaryitem.typeid + <where> + 1=1 + and dictionarytype.status = 1 + and dictionaryitem.status = 1 + <if test="dictionaryType != null and dictionaryType !=''"> + and dictionarytype.text = #{dictionaryType} + </if> + </where> + order by dictionaryitem.sort asc + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from dictionaryitem + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.gk.hotwork.Domain.DictionaryItemInfo" > + <!-- --> + insert into dictionaryitem (id, sort, status, + text, value, createdby, + createddate, modifiedby, modifieddate, + description, typeid) + values (#{id,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, + #{text,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{createdby,jdbcType=VARCHAR}, + #{createddate,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR}, #{modifieddate,jdbcType=TIMESTAMP}, + #{description,jdbcType=VARCHAR}, #{typeid,jdbcType=BIGINT}) + </insert> + <insert id="insertSelective" parameterType="com.gk.hotwork.Domain.DictionaryItemInfo" > + <!-- --> + insert into dictionaryitem + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + id, + </if> + <if test="sort != null" > + sort, + </if> + <if test="status != null" > + status, + </if> + <if test="text != null" > + text, + </if> + <if test="value != null" > + value, + </if> + <if test="createdby != null" > + createdby, + </if> + <if test="createddate != null" > + createddate, + </if> + <if test="modifiedby != null" > + modifiedby, + </if> + <if test="modifieddate != null" > + modifieddate, + </if> + <if test="description != null" > + description, + </if> + <if test="typeid != null" > + typeid, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=BIGINT}, + </if> + <if test="sort != null" > + #{sort,jdbcType=INTEGER}, + </if> + <if test="status != null" > + #{status,jdbcType=TINYINT}, + </if> + <if test="text != null" > + #{text,jdbcType=VARCHAR}, + </if> + <if test="value != null" > + #{value,jdbcType=VARCHAR}, + </if> + <if test="createdby != null" > + #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null" > + #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="modifiedby != null" > + #{modifiedby,jdbcType=VARCHAR}, + </if> + <if test="modifieddate != null" > + #{modifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="description != null" > + #{description,jdbcType=VARCHAR}, + </if> + <if test="typeid != null" > + #{typeid,jdbcType=BIGINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.DictionaryItemInfo" > + <!-- --> + update dictionaryitem + <set > + <if test="sort != null" > + sort = #{sort,jdbcType=INTEGER}, + </if> + <if test="status != null" > + status = #{status,jdbcType=TINYINT}, + </if> + <if test="text != null" > + text = #{text,jdbcType=VARCHAR}, + </if> + <if test="value != null" > + value = #{value,jdbcType=VARCHAR}, + </if> + <if test="createdby != null" > + createdby = #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null" > + createddate = #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="modifiedby != null" > + modifiedby = #{modifiedby,jdbcType=VARCHAR}, + </if> + <if test="modifieddate != null" > + modifieddate = #{modifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="description != null" > + description = #{description,jdbcType=VARCHAR}, + </if> + <if test="typeid != null" > + typeid = #{typeid,jdbcType=BIGINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.DictionaryItemInfo" > + <!-- --> + update dictionaryitem + set sort = #{sort,jdbcType=INTEGER}, + status = #{status,jdbcType=TINYINT}, + text = #{text,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + createdby = #{createdby,jdbcType=VARCHAR}, + createddate = #{createddate,jdbcType=TIMESTAMP}, + modifiedby = #{modifiedby,jdbcType=VARCHAR}, + modifieddate = #{modifieddate,jdbcType=TIMESTAMP}, + description = #{description,jdbcType=VARCHAR}, + typeid = #{typeid,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryTypeInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryTypeInfoMapper.xml new file mode 100644 index 0000000..bed6dfc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/DictionaryTypeInfoMapper.xml @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.DictionaryTypeInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DictionaryTypeInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="code" property="code" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="TINYINT" /> + <result column="text" property="text" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" /> + <result column="description" property="description" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, code, status, text, createdby, createddate, modifiedby, modifieddate, description + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from dictionarytype + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.DictionaryTypeInfo"> + select + <include refid="Base_Column_List" /> + from dictionarytype + <where> + 1=1 + and status = 1 + <if test="condition.name != null and condition.name != ''"> + and text like concat('%',#{condition.name},'%') + </if> + </where> + </select> + <select id="selectExistInfo" resultType="com.gk.hotwork.Domain.DictionaryTypeInfo"> + select + <include refid="Base_Column_List" /> + from dictionarytype + <where> + 1=1 + and id != #{id} + <if test="code != null and code !=''"> + and code = #{code} + </if> + <if test="text != null and text !=''"> + and text = #{text} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from dictionarytype + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.gk.hotwork.Domain.DictionaryTypeInfo" > + <!-- --> + insert into dictionarytype (id, code, status, + text, createdby, createddate, + modifiedby, modifieddate, description + ) + values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, + #{text,jdbcType=VARCHAR}, #{createdby,jdbcType=VARCHAR}, #{createddate,jdbcType=TIMESTAMP}, + #{modifiedby,jdbcType=VARCHAR}, #{modifieddate,jdbcType=TIMESTAMP}, #{description,jdbcType=VARCHAR} + ) + </insert> + <insert id="insertSelective" parameterType="com.gk.hotwork.Domain.DictionaryTypeInfo" > + <!-- --> + insert into dictionarytype + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + id, + </if> + <if test="code != null" > + code, + </if> + <if test="status != null" > + status, + </if> + <if test="text != null" > + text, + </if> + <if test="createdby != null" > + createdby, + </if> + <if test="createddate != null" > + createddate, + </if> + <if test="modifiedby != null" > + modifiedby, + </if> + <if test="modifieddate != null" > + modifieddate, + </if> + <if test="description != null" > + description, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=BIGINT}, + </if> + <if test="code != null" > + #{code,jdbcType=VARCHAR}, + </if> + <if test="status != null" > + #{status,jdbcType=TINYINT}, + </if> + <if test="text != null" > + #{text,jdbcType=VARCHAR}, + </if> + <if test="createdby != null" > + #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null" > + #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="modifiedby != null" > + #{modifiedby,jdbcType=VARCHAR}, + </if> + <if test="modifieddate != null" > + #{modifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="description != null" > + #{description,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.DictionaryTypeInfo" > + <!-- --> + update dictionarytype + <set > + <if test="code != null" > + code = #{code,jdbcType=VARCHAR}, + </if> + <if test="status != null" > + status = #{status,jdbcType=TINYINT}, + </if> + <if test="text != null" > + text = #{text,jdbcType=VARCHAR}, + </if> + <if test="createdby != null" > + createdby = #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null" > + createddate = #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="modifiedby != null" > + modifiedby = #{modifiedby,jdbcType=VARCHAR}, + </if> + <if test="modifieddate != null" > + modifieddate = #{modifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="description != null" > + description = #{description,jdbcType=VARCHAR}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.DictionaryTypeInfo" > + <!-- --> + update dictionarytype + set code = #{code,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + text = #{text,jdbcType=VARCHAR}, + createdby = #{createdby,jdbcType=VARCHAR}, + createddate = #{createddate,jdbcType=TIMESTAMP}, + modifiedby = #{modifiedby,jdbcType=VARCHAR}, + modifieddate = #{modifieddate,jdbcType=TIMESTAMP}, + description = #{description,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/DistrictInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/DistrictInfoMapper.xml new file mode 100644 index 0000000..e05e531 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/DistrictInfoMapper.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.DistrictInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.DistrictInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="code" property="code" jdbcType="VARCHAR" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="parentcode" property="parentcode" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, code, name, parentcode, type + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from district + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectDistrictInfo" resultType="com.gk.hotwork.Domain.DistrictInfo"> + select + <include refid="Base_Column_List" /> + from district + where type = #{type} + and parentcode = #{parentcode} + </select> + <select id="selectDistrictByName" resultType="com.gk.hotwork.Domain.DistrictInfo"> + SELECT + district.* + FROM + district + WHERE + district.type = #{type} + AND district.parentcode IN ( + SELECT + `code` + FROM + district + WHERE + type = #{parenttype} + and district.NAME = #{parentname} + ) + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from district + where id = #{id,jdbcType=BIGINT} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.DistrictInfo" > + <!-- --> + update district + <set > + <if test="code != null" > + code = #{code,jdbcType=VARCHAR}, + </if> + <if test="name != null" > + name = #{name,jdbcType=VARCHAR}, + </if> + <if test="parentcode != null" > + parentcode = #{parentcode,jdbcType=VARCHAR}, + </if> + <if test="type != null" > + type = #{type,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.DistrictInfo" > + <!-- --> + update district + set code = #{code,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + parentcode = #{parentcode,jdbcType=VARCHAR}, + type = #{type,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml new file mode 100644 index 0000000..455f46c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.ElementManagementMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.ElementManagement" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="name" property="name" jdbcType="BIGINT" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="parent_id" property="parentId" jdbcType="VARCHAR" /> + <result column="parent_name" property="parentName" jdbcType="VARCHAR" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + <result column="point" property="point" jdbcType="VARCHAR" /> + <result column="weight" property="weight" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select a.*, + b.name parent_name + from element_management as a + left join element_management as b on a.parent_id = b.id and b.valid_flag = 1 + where a.valid_flag = 1 + <if test="params.name != null and params.name != ''"> + and a.name like concat("%",#{params.name},"%") + </if> + <if test="params.type != null "> + and a.type = #{params.type} + </if> + order by a.create_time desc + </select> + + <select id="getElementByType" resultMap="BaseResultMap"> + select * from element_management where valid_flag = 1 and type = #{type} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanFileMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanFileMapper.xml new file mode 100644 index 0000000..9498eb9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanFileMapper.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.EmergencyPlanFileMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.EmergencyPlanFile" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="file_url" jdbcType="VARCHAR" property="fileUrl" /> + <result column="file_name" jdbcType="VARCHAR" property="fileName" /> + <result column="emergency_plan_id" jdbcType="BIGINT" property="emergencyPlanId" /> + + </resultMap> + + <sql id="Base_Column_List" > + <!-- --> + id, risk_unit_id, risk_event_name, valid_flag, create_time, create_by, update_time, + update_by, risk_uint_name + </sql> + + <select id="getByEmergencyPlanId" resultMap="BaseResultMap"> + select * from emergency_plan_file where valid_flag = 1 and emergency_plan_id=#{emergencyPlanId} + </select> + + <update id="deleteById"> + update emergency_plan_file set + valid_flag=0, + update_time=#{updateTime}, + update_by=#{updateBy} + where id=#{id} + </update> + + <update id="deleteByEmergencyPlanId"> + update emergency_plan_file set + valid_flag=0, + update_time=#{updateTime}, + update_by=#{updateBy} + where emergency_plan_id=#{emergencyPlanId} + </update> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanMapper.xml new file mode 100644 index 0000000..13a3418 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/EmergencyPlanMapper.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.EmergencyPlanMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.EmergencyPlan" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="name" property="name" jdbcType="BIGINT" /> + <result column="file_type" property="fileType" jdbcType="VARCHAR" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + + <association property="fileList" javaType="com.gk.hotwork.Domain.EmergencyPlanFile"> + <id column="file_id" property="id" /> + <result column="file_url" jdbcType="VARCHAR" property="fileUrl" /> + <result column="file_name" jdbcType="VARCHAR" property="fileName" /> + <result column="emergency_plan_id" jdbcType="BIGINT" property="emergencyPlanId" /> + </association> + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select * + from emergency_plan + where valid_flag = 1 + <if test="params.name != null and params.name != ''"> + and name like concat("%",#{params.name},"%") + </if> + order by create_time desc + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/EquipmentInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/EquipmentInfoMapper.xml new file mode 100644 index 0000000..92a626a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/EquipmentInfoMapper.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.EquipmentInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.EquipmentInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="number" property="number" jdbcType="VARCHAR" /> + <result column="isphoto" property="isphoto" jdbcType="TINYINT" /> + <result column="photoname" property="photoname" jdbcType="VARCHAR" /> + <result column="photoaddress" property="photoaddress" jdbcType="VARCHAR" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + <result column="updateby" property="updateby" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, name, number, isphoto, photoname, photoaddress, updatetime, updateby + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + select * + from equipment + <where> + 1=1 + <if test="condition.name != null and condition.name != ''"> + and name like concat('%',#{condition.name},'%') + </if> + <if test="condition.number != null and condition.number != ''"> + and number like concat('%',#{condition.number},'%') + </if> + </where> + </select> + <select id="selectExistByNumber" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + select * + from equipment + where number = #{number} + <if test="id !=null"> + and id != #{id} + </if> + </select> + <select id="selectByNumber" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + select * + from equipment + where number = #{equipmentnumber} + </select> + <select id="selectByTask" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + SELECT + equipment.* + FROM + taskequipmentbind + LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber + WHERE equipment.isphoto = 1 + and equipment.photoname != '' + and equipment.photoaddress !='' + </select> + <select id="selectByTaskAndWorker" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + select + equipment.* + FROM + taskequipmentbind + LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber + <where> + taskequipmentbind.updateby = #{worker} + and taskequipmentbind.taskcode = #{code} + </where> + </select> + <select id="selectUsingByTask" resultType="com.gk.hotwork.Domain.EquipmentInfo"> + SELECT + equipment.* + FROM + taskequipmentbind + LEFT JOIN equipment on equipment.number = taskequipmentbind.equipmentnumber + <where> + taskequipmentbind.taskcode = #{code} + </where> + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/ExamSocreInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/ExamSocreInfoMapper.xml new file mode 100644 index 0000000..0af494d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/ExamSocreInfoMapper.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.ExamScoreInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.ExamScoreInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="realname" property="realname" jdbcType="VARCHAR" /> + <result column="mobile" property="mobile" jdbcType="VARCHAR" /> + <result column="idcard" property="idcard" jdbcType="VARCHAR" /> + <result column="examtype" property="examtype" jdbcType="VARCHAR" /> + <result column="score" property="score" jdbcType="INTEGER" /> + <result column="starttime" property="starttime" jdbcType="TIMESTAMP" /> + <result column="endtime" property="endtime" jdbcType="TIMESTAMP" /> + <result column="createtime" property="createtime" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, realname, mobile, idcard, examtype, score, starttime, endtime, createtime + </sql> + <select id="selectByMobile" resultType="com.gk.hotwork.Domain.ExamScoreInfo"> + select * + from examscore + where mobile = #{mobile} + and examtype = #{examtype} + </select> + <select id="selectByAll" resultType="com.gk.hotwork.Domain.Vo.ExamScoreVo"> + select + CASE WHEN (examscore.endtime > NOW()) THEN 1 ELSE 0 END AS ispass, + examtype + from examscore + where mobile = #{username} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorMap2Mapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorMap2Mapper.xml new file mode 100644 index 0000000..d439797 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorMap2Mapper.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.FourColorMap2Mapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.FourColorMap2" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="geometry" property="geometry" jdbcType="VARCHAR" /> + <result column="properties" property="properties" jdbcType="VARCHAR" /> + <result column="etype" property="etype" jdbcType="VARCHAR" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + </resultMap> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointCoordMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointCoordMapper.xml new file mode 100644 index 0000000..5c09d29 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointCoordMapper.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.FourColorPointCoordMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.FourColorPointCoord" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="point_id" property="pointId" jdbcType="VARCHAR"/> + <result column="lon" property="lon" jdbcType="FLOAT"/> + <result column="lat" property="lat" jdbcType="FLOAT"/> + <result column="hei" property="hei" jdbcType="FLOAT"/> + </resultMap> + <sql id="Base_Column_List" > + id,point_id,lon,lat,hei + </sql> + <select id="findCoordListByPointId" resultMap="BaseResultMap"> + select <include refid="Base_Column_List"/> + from four_color_map_coord + <where> + <if test="pointId != null and pointId != ''"> + point_id = #{pointId} + </if> + </where> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointMapper.xml new file mode 100644 index 0000000..2a2517d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/FourColorPointMapper.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.FourColorPointMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.FourColorPoint" > + <!-- --> + <id column="id" property="id" jdbcType="VARCHAR" /> + <result column="etype" property="etype" jdbcType="INTEGER"/> + <result column="shape_type" property="shapeType" jdbcType="VARCHAR"/> + <result column="name" property="name" jdbcType="VARCHAR"/> + <result column="type" property="type" jdbcType="VARCHAR"/> + <result column="text" property="text" jdbcType="VARCHAR"/> + <result column="clamp_toground" property="clampToGround" jdbcType="BOOLEAN"/> + <result column="color" property="color" jdbcType="VARCHAR"/> + <result column="geo_type" property="geoType" jdbcType="VARCHAR"/> + </resultMap> + <sql id="Base_Column_List" > + id,etype,shape_type,name,type,text,clamp_toground,color,geo_type + </sql> + <select id="findPointListByEtype" resultMap="BaseResultMap"> + select <include refid="Base_Column_List"/> + from four_color_map + <where> + <if test="etype != null and etype > 0"> + etype = #{etype} + </if> + </where> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/GasWarnInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/GasWarnInfoMapper.xml new file mode 100644 index 0000000..13b4048 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/GasWarnInfoMapper.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.GasWarnInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.GasWarnInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="gastype" property="gastype" jdbcType="VARCHAR" /> + <result column="warntype" property="warntype" jdbcType="VARCHAR" /> + <result column="max" property="max" jdbcType="DECIMAL" /> + <result column="min" property="min" jdbcType="DECIMAL" /> + <result column="gasunit" property="gasunit" jdbcType="VARCHAR" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + <result column="updateby" property="updateby" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, gastype, warntype, max, min, gasunit, updatetime, updateby + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.GasWarnInfo"> + select * + from gaswarn + <where> + 1=1 + <if test="condition.gastype != null and condition.gastype !=''"> + and gastype = #{condition.gastype} + </if> + <if test="condition.warntype != null and condition.warntype !=''"> + and warntype = #{condition.warntype} + </if> + </where> + </select> + <select id="selectExistByType" resultType="com.gk.hotwork.Domain.GasWarnInfo"> + select * from gaswarn + where + gastype = #{gastype} + and warntype = #{warntype} + <if test="id !=null"> + and id != #{id} + </if> + </select> + <select id="selectByType" resultType="com.gk.hotwork.Domain.GasWarnInfo"> + select * from gaswarn + where + gastype = #{gastype} + and warntype = #{warntype} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/HelpDocInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/HelpDocInfoMapper.xml new file mode 100644 index 0000000..15f311f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/HelpDocInfoMapper.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.HelpDocInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.HelpDocInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="filetype" property="filetype" jdbcType="VARCHAR" /> + <result column="filename" property="filename" jdbcType="VARCHAR" /> + <result column="fileurl" property="fileurl" jdbcType="VARCHAR" /> + <result column="version" property="version" jdbcType="INTEGER" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="created" property="created" jdbcType="TIMESTAMP" /> + <result column="updated" property="updated" jdbcType="TIMESTAMP" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, filetype, filename, fileurl, version, remark, createdby, created, updated, isdel, + flag + </sql> + + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.HelpDocInfo"> + select + <include refid="Base_Column_List" /> + from helpdoc + <where> + 1=1 + and isdel = 0 + <if test="condition.name != null and condition.name !=''"> + and filename like concat('%',#{condition.name},'%') + </if> + </where> + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerLogMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerLogMapper.xml new file mode 100644 index 0000000..f408413 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerLogMapper.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.HiddenDangerLogMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.HiddenDangerLog" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="operator" property="operator" jdbcType="VARCHAR" /> + <result column="operatorid" property="operatorid" jdbcType="BIGINT" /> + <result column="operation" property="operation" jdbcType="VARCHAR" /> + <result column="operationtime" property="operationtime" jdbcType="TIMESTAMP" /> + <result column="detail" property="detail" jdbcType="VARCHAR" /> + <result column="extra" property="extra" jdbcType="VARCHAR" /> + <result column="validflag" property="validflag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, operator, operatorid, operation, operationtime, detail, extra, validflag + </sql> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerMapper.xml new file mode 100644 index 0000000..d1b8f3f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerMapper.xml @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.HiddenDangerMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.HiddenDanger" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="level" property="level" jdbcType="VARCHAR" /> + <result column="code" property="code" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="VARCHAR" /> + <result column="requestor" property="requestor" jdbcType="VARCHAR" /> + <result column="requestorid" property="requestorid" jdbcType="BIGINT" /> + <result column="createtime" property="createtime" jdbcType="TIMESTAMP" /> + <result column="createnote" property="createnote" jdbcType="VARCHAR" /> + <result column="rectifytime" property="rectifytime" jdbcType="TIMESTAMP" /> + <result column="rectifynote" property="rectifynote" jdbcType="VARCHAR" /> + <result column="rectifydeadline" property="rectifydeadline" jdbcType="VARCHAR" /> + <result column="rectifier" property="rectifier" jdbcType="VARCHAR" /> + <result column="rectifierid" property="rectifierid" jdbcType="BIGINT" /> + <result column="rectifymeasure" property="rectifymeasure" jdbcType="VARCHAR" /> + <result column="source" property="source" jdbcType="VARCHAR" /> + <result column="validflag" property="validflag" jdbcType="TINYINT" /> + <collection property="rectifyResources" + ofType="com.gk.hotwork.Domain.HiddenDangerResource" + select="selectRectifyResources" column="hiddendangerid=id"> + + </collection> + + <collection property="reportResources" + ofType="com.gk.hotwork.Domain.HiddenDangerResource" + select="selectReportResources" column="hiddendangerid=id"> + + </collection> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, level, status, requestor,, requestorid, + createtime, createnote, rectifytime, rectifynote, + validflag + </sql> + <select id="selectPages" resultMap="BaseResultMap"> + select * + from hiddendanger + where + validflag = 1 + <if test="params.requestorid != null and params.requestorid != ''"> + and requestorid = #{params.requestorid} + </if> + <if test="params.rectifierid != null and params.rectifierid != ''"> + and rectifierid = #{params.rectifierid} + </if> + + <if test="params.level != null"> + and level = #{params.level} + </if> + <if test="params.code != null and params.code != ''"> + and code like concat("%",#{params.code},"%") + </if> + + <if test="params.requestorName != null and params.requestorName != ''"> + and requestor like concat("%", #{params.requestorName},"%") + </if> + <if test="params.rectifierName != null and params.rectifierName != ''"> + and rectifier like concat("%", #{params.rectifierName},"%") + </if> + + <if test="params.status != null"> + and status = #{params.status} + </if> + <if test="params.source != null and params.source != ''"> + and source = #{params.source} + </if> + <if test="params.overTime != null and params.overTime != ''"> + and rectifydeadline < now() + </if> + + order by createtime desc + </select> + + <select id="selectRectifyResources" resultType="com.gk.hotwork.Domain.HiddenDangerResource"> + select * + from hiddendangerresource + where operation = 'RECTIFICATION' + and belongid = #{hiddendangerid} + and validflag = 1 + order by sort + </select> + + <select id="selectReportResources" resultType="com.gk.hotwork.Domain.HiddenDangerResource"> + select * + from hiddendangerresource + where operation = 'REPORT' + and belongid = #{hiddendangerid} + and validflag = 1 + order by sort + </select> + + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.HiddenDanger"> + select + hiddendanger.* + from hiddendanger + LEFT JOIN task on task.`code` = hiddendanger.taskcode + <where> + hiddendanger.validflag = 1 + and hiddendanger.`status` IN ("UNCONFIRMED","RECTIFIED") + <if test="condition.starttime != null and condition.starttime != ''"> + and hiddendanger.`createtime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and hiddendanger.`createtime` <= #{condition.endtime} + </if> + + <if test="condition.company != null and condition.company != ''"> + and task.constructionunit = #{condition.company} + </if> + </where> + </select> + + <select id="selectStatisticsData" resultType="com.gk.hotwork.Domain.HiddenDanger"> + select task.constructionunit, + COUNT(*) as countNum from hiddendanger + LEFT JOIN task on task.`code` = hiddendanger.taskcode + <where> + hiddendanger.validflag = 1 + and hiddendanger.`status` IN ("UNCONFIRMED","RECTIFIED") + <if test="condition.starttime != null and condition.starttime != ''"> + and hiddendanger.`createtime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and hiddendanger.`createtime` <= #{condition.endtime} + </if> + + <if test="condition.company != null and condition.company != ''"> + and task.constructionunit = #{condition.company} + </if> + </where> + group by task.constructionunit + </select> + <select id="countNumInMonth" resultType="java.lang.Integer"> + select count(0) + from hiddendanger + where requestorid = #{id} + and date_format(createtime,'%Y-%m') = date_format(now(),'%Y-%m') + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerResourceMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerResourceMapper.xml new file mode 100644 index 0000000..67973b7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/HiddenDangerResourceMapper.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.HiddenDangerResourceMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.HiddenDangerResource" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="operation" property="operation" jdbcType="VARCHAR" /> + <result column="belongid" property="belongid" jdbcType="BIGINT" /> + <result column="originalfilename" property="originalfilename" jdbcType="VARCHAR" /> + <result column="filename" property="filename" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="url" property="url" jdbcType="VARCHAR" /> + <result column="createtime" property="createtime" jdbcType="TIMESTAMP" /> + <result column="validflag" property="validflag" jdbcType="TINYINT" /> + <result column="sort" property="sort" jdbcType="INTEGER" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, operation, belongid, originalfilename, filename, type, url, createtime, validflag, + order + </sql> + + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/InvolveDepInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/InvolveDepInfoMapper.xml new file mode 100644 index 0000000..cfda6cd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/InvolveDepInfoMapper.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.InvolveDepInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.InvolveDepInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="department" property="department" jdbcType="VARCHAR" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, department, lastmodifiedby, lastmodifieddate + </sql> + <delete id="deleteByName"> + delete from involvedep + where department = #{department} + </delete> + <select id="selectByName" resultType="com.gk.hotwork.Domain.InvolveDepInfo"> + select * + from involvedep + where department = #{department} + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentAlarmMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentAlarmMapper.xml new file mode 100644 index 0000000..5f1d3da --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentAlarmMapper.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.MajorEquipmentAlarmMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.MajorEquipmentAlarm" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="equipment_id" property="equipmentId" jdbcType="BIGINT" /> + <result column="status" property="status" jdbcType="FLOAT" /> + <result column="alarm_time" property="alarmTime" jdbcType="FLOAT" /> + <result column="alarm_info" property="alarmInfo" jdbcType="FLOAT" /> + <result column="remark" property="remark" jdbcType="FLOAT" /> + + <result column="equipment_name" property="equipmentName" jdbcType="VARCHAR" /> + <result column="equipment_serial_number" property="equipmentSerialNumber" jdbcType="VARCHAR" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select a.*, + b.name equipment_name, + b.serial_number equipment_serial_number + from major_equipment_alarm as a + left join major_equipment as b on a.equipment_id = b.id + where a.valid_flag = 1 and b.valid_flag = 1 + <if test="params.equipmentName != null and params.equipmentName != ''"> + and b.name like concat("%",#{params.equipmentName},"%") + </if> + <if test="params.status != null"> + and a.status = #{params.status} + </if> + ORDER BY + a.STATUS, + a.create_time DESC + </select> + + <update id="deleteByEquipmentId" > + update major_equipment_alarm set valid_flag=0 , update_time=#{updateTime}, update_by=#{updateBy} where equipment_id=#{id} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentDataMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentDataMapper.xml new file mode 100644 index 0000000..86db597 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentDataMapper.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.MajorEquipmentDataMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.MajorEquipmentData" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="equipment_id" property="equipmentId" jdbcType="BIGINT" /> + <result column="range_lower_limit" property="rangeLowerLimit" jdbcType="FLOAT" /> + <result column="range_upper_limit" property="rangeUpperLimit" jdbcType="FLOAT" /> + <result column="high_high_liquid_alarm" property="highHighLiquidAlarm" jdbcType="FLOAT" /> + <result column="high_liquid_alarm" property="highLiquidAlarm" jdbcType="FLOAT" /> + <result column="low_liquid_alarm" property="lowLiquidAlarm" jdbcType="FLOAT" /> + <result column="low_low_liquid_alarm" property="lowLowLiquidAlarm" jdbcType="FLOAT" /> + <result column="monitoring_time" property="monitoringTime" jdbcType="TIMESTAMP" /> + + <result column="equipment_name" property="equipmentName" jdbcType="VARCHAR" /> + <result column="equipment_serial_number" property="equipmentSerialNumber" jdbcType="VARCHAR" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select a.*, + b.name equipment_name, + b.serial_number equipment_serial_number + from major_equipment_data as a + left join major_equipment as b on a.equipment_id = b.id + where a.valid_flag = 1 and b.valid_flag = 1 + <if test="params.equipmentName != null and params.equipmentName != ''"> + and b.name like concat("%",#{params.equipmentName},"%") + </if> + order by a.create_time desc + </select> + + <update id="deleteByEquipmentId" > + update major_equipment_data set valid_flag=0 , update_time=#{updateTime}, update_by=#{updateBy} where equipment_id=#{id} + </update> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentMapper.xml new file mode 100644 index 0000000..6248a25 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/MajorEquipmentMapper.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.MajorEquipmentMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.MajorEquipment" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="serial_number" property="serialNumber" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="VARCHAR" /> + <result column="volume" property="volume" jdbcType="VARCHAR" /> + <result column="user_id" property="userId" jdbcType="BIGINT" /> + <result column="user_name" property="userName" jdbcType="VARCHAR" /> + <result column="area_id" property="areaId" jdbcType="BIGINT" /> + <result column="area_name" property="areaName" jdbcType="VARCHAR" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + SELECT + a.*, + b.realname user_name, + c. + VALUE + AS area_name + FROM + major_equipment AS a + LEFT JOIN USER AS b ON a.user_id = b.id + AND b.isdel = 0 + LEFT JOIN dictionaryitem AS c ON a.area_id = c.id + AND c.STATUS = 1 + WHERE + a.valid_flag = 1 + <if test="params.name != null and params.name != ''"> + and a.name like concat("%",#{params.name},"%") + </if> + <if test="params.status != null"> + and a.status = #{params.status} + </if> + <if test="params.areaId != null"> + and a.area_id = #{params.areaId} + </if> + order by a.create_time desc + </select> + + + <select id="getMajorEquipment" resultMap="BaseResultMap"> + select id , name , serial_number + from major_equipment + where valid_flag = 1 and status=0 + </select> + + <select id="getBySerialNumber" resultMap="BaseResultMap"> + select id , name , serial_number + from major_equipment + where valid_flag = 1 and serial_number= #{serialNumber} + <if test="id != null"> + and id != #{id} + </if> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/PermissionInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/PermissionInfoMapper.xml new file mode 100644 index 0000000..9b67b72 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/PermissionInfoMapper.xml @@ -0,0 +1,163 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.Mapper.PermissionInfoMapper"> + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.PermissionInfo"> + <!-- --> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="level" jdbcType="INTEGER" property="level" /> + <result column="title" jdbcType="VARCHAR" property="title" /> + <result column="path" jdbcType="VARCHAR" property="path" /> + <result column="component" jdbcType="VARCHAR" property="component" /> + <result column="icon" jdbcType="VARCHAR" property="icon" /> + <result column="buttontype" jdbcType="VARCHAR" property="buttontype" /> + <result column="status" jdbcType="INTEGER" property="status" /> + <result column="description" jdbcType="VARCHAR" property="description" /> + <result column="sortorder" jdbcType="DOUBLE" property="sortorder" /> + <result column="type" jdbcType="INTEGER" property="type" /> + <result column="expand" jdbcType="BIT" property="expand" /> + <result column="checked" jdbcType="BIT" property="checked" /> + <result column="selected" jdbcType="BIT" property="selected" /> + <result column="createdby" jdbcType="VARCHAR" property="createdby" /> + <result column="createddate" jdbcType="TIMESTAMP" property="createddate" /> + <result column="lastmodifiedby" jdbcType="VARCHAR" property="lastmodifiedby" /> + <result column="lastmodifieddate" jdbcType="TIMESTAMP" property="lastmodifieddate" /> + <result column="parentid" jdbcType="INTEGER" property="parentid" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- --> + id, name, level, title, path, component, icon, buttontype, status, description, sortorder, + type, expand, checked, selected, createdby, createddate, lastmodifiedby, lastmodifieddate, + parentid + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> + <!-- --> + select + <include refid="Base_Column_List" /> + from permission + where id = #{id,jdbcType=INTEGER} + </select> + <select id="selectAll" resultType="com.gk.hotwork.Domain.PermissionInfo"> + select + <include refid="Base_Column_List" /> + from permission + where `status` = 1 + order by sortorder asc + </select> + <select id="selectByUserId" resultType="com.gk.hotwork.Domain.PermissionInfo"> + SELECT + <include refid="Base_Column_List" /> + FROM + permission + WHERE + id IN ( + SELECT DISTINCT + rolepermissions.permissionid + FROM + rolepermissions + WHERE + roleid IN ( + SELECT + userroles.roleid + FROM userroles + WHERE + userid = #{userId} + ) + ) + and `status` = 1 + ORDER BY `level`,sortorder ASC + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> + <!-- --> + delete from permission + where id = #{id,jdbcType=INTEGER} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.PermissionInfo"> + <!-- --> + update permission + <set> + <if test="name != null"> + name = #{name,jdbcType=VARCHAR}, + </if> + <if test="level != null"> + level = #{level,jdbcType=INTEGER}, + </if> + <if test="title != null"> + title = #{title,jdbcType=VARCHAR}, + </if> + <if test="path != null"> + path = #{path,jdbcType=VARCHAR}, + </if> + <if test="component != null"> + component = #{component,jdbcType=VARCHAR}, + </if> + <if test="icon != null"> + icon = #{icon,jdbcType=VARCHAR}, + </if> + <if test="buttontype != null"> + buttonType = #{buttontype,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + status = #{status,jdbcType=INTEGER}, + </if> + <if test="description != null"> + description = #{description,jdbcType=VARCHAR}, + </if> + <if test="sortorder != null"> + sortorder = #{sortorder,jdbcType=DOUBLE}, + </if> + <if test="type != null"> + type = #{type,jdbcType=INTEGER}, + </if> + <if test="expand != null"> + expand = #{expand,jdbcType=BIT}, + </if> + <if test="checked != null"> + checked = #{checked,jdbcType=BIT}, + </if> + <if test="selected != null"> + selected = #{selected,jdbcType=BIT}, + </if> + <if test="createdby != null"> + createdby = #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null"> + createddate = #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="lastmodifiedby != null"> + lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR}, + </if> + <if test="lastmodifieddate != null"> + lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="parentid != null"> + parentid = #{parentid,jdbcType=INTEGER}, + </if> + </set> + where id = #{id,jdbcType=INTEGER} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.PermissionInfo"> + <!-- --> + update permission + set name = #{name,jdbcType=VARCHAR}, + level = #{level,jdbcType=INTEGER}, + title = #{title,jdbcType=VARCHAR}, + path = #{path,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + icon = #{icon,jdbcType=VARCHAR}, + buttonType = #{buttontype,jdbcType=VARCHAR}, + status = #{status,jdbcType=INTEGER}, + description = #{description,jdbcType=VARCHAR}, + sortorder = #{sortorder,jdbcType=DOUBLE}, + type = #{type,jdbcType=INTEGER}, + expand = #{expand,jdbcType=BIT}, + checked = #{checked,jdbcType=BIT}, + selected = #{selected,jdbcType=BIT}, + createdby = #{createdby,jdbcType=VARCHAR}, + createddate = #{createddate,jdbcType=TIMESTAMP}, + lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR}, + lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP}, + parentid = #{parentid,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/ReserveMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/ReserveMapper.xml new file mode 100644 index 0000000..7e3b9fa --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/ReserveMapper.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.ReserveMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.Reserve" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="space" property="space" jdbcType="INTEGER" /> + <result column="hoisting" property="hoisting" jdbcType="INTEGER" /> + <result column="soild" property="soild" jdbcType="INTEGER" /> + <result column="breaks" property="breaks" jdbcType="INTEGER" /> + <result column="high" property="high" jdbcType="INTEGER" /> + <result column="electricity" property="electricity" jdbcType="INTEGER" /> + <result column="blindboard" property="blindboard" jdbcType="INTEGER" /> + <result column="fire" property="fire" jdbcType="INTEGER" /> + <result column="appointment" property="appointment" jdbcType="TIMESTAMP" /> + <result column="createtime" property="createtime" jdbcType="TIMESTAMP" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + <result column="validflag" property="validflag" jdbcType="TINYINT" /> + <result column="createby" property="createby" jdbcType="BIGINT" /> + <result column="createbyname" property="createbyname" jdbcType="VARCHAR" /> + <result column="updatebyname" property="updatebyname" jdbcType="VARCHAR" /> + <result column="createbydepartment" property="createbydepartment" jdbcType="VARCHAR" /> + + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, space, hoisting, soild, breaks, high, electricity, blindboard, fire, appointment, + createtime, updatetime, validflag, createby, createbyname, updatebyname,createbydepartment + </sql> + <select id="statistics" resultType="java.util.Map"> + + select + department.department, + ifnull(reserve.space,0) space, + ifnull(reserve.hoisting,0) hoisting, + ifnull(reserve.soild,0) soild, + ifnull(reserve.breaks,0) breaks, + ifnull(reserve.high,0) high, + ifnull(reserve.electricity,0) electricity, + ifnull(reserve.blindboard,0) blindboard, + ifnull(reserve.fire,0) fire, + date_format(reserve.appointment,"%Y-%m-%d") appointment + from reserve as reserve + right join ( + select d.department + from department as d + where d.isdel = 0 + <if test="params.department != null and params.department != ''"> + and d.department = #{params.department} + </if> + ) as department on department.department = reserve.createbydepartment + where reserve.validflag = 1 + <if test="params.appointment != null and params.appointment != ''"> + and date(reserve.appointment) = date(#{params.appointment}) + </if> + + + + + </select> + <select id="selectStatisticsTotal" resultType="java.util.Map"> + + + select + count(0) department, + sum(reserve.space) space, + sum(reserve.hoisting) hoisting, + sum(reserve.soild) soild, + sum(reserve.breaks) breaks, + sum(reserve.high) high, + sum(reserve.electricity) electricity, + sum(reserve.blindboard) blindboard, + sum(reserve.fire) fire + from ( + select + reserve.createbydepartment , + sum(reserve.space) space, + sum(reserve.hoisting) hoisting, + sum(reserve.soild) soild, + sum(reserve.breaks) breaks, + sum(reserve.high) high, + sum(reserve.electricity) electricity, + sum(reserve.blindboard) blindboard, + sum(reserve.fire) fire + from reserve as reserve + where reserve.validflag = 1 + <if test="params.appointment != null and params.appointment != ''"> + and date(reserve.appointment) = date(#{params.appointment}) + </if> + <if test="params.department != null and params.department != ''"> + and reserve.createbydepartment = #{params.department} + </if> + group by reserve.createbydepartment) as reserve + + + + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskAnaUintMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskAnaUintMapper.xml new file mode 100644 index 0000000..ed92794 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskAnaUintMapper.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.Mapper.RiskAnaUintMapper"> + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskAnaUnit"> + <!-- --> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="hazard_code" jdbcType="VARCHAR" property="hazardCode" /> + <result column="hazard_dep" jdbcType="VARCHAR" property="hazardDep" /> + <result column="hazard_liable_person" jdbcType="VARCHAR" property="hazardLiablePerson" /> + <result column="risk_uint_name" jdbcType="VARCHAR" property="riskUnitName" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> + <result column="create_by" jdbcType="VARCHAR" property="createBy" /> + <result column="update_by" jdbcType="VARCHAR" property="updateBy" /> + <result column="valid_flag" jdbcType="TINYINT" property="validFlag" /> + <result column="hazard_liable_person_id" jdbcType="BIGINT" property="hazardLiablePersonId" /> + <result column="hazard_dep_id" jdbcType="BIGINT" property="hazardDepId" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- --> + id, hazard_code, hazard_dep, hazard_liable_person, risk_unit_name, create_time, update_time, + create_by, update_by, valid_flag, hazard_liable_person_id, hazard_dep_id + </sql> + <select id="selectPages" resultType="com.gk.hotwork.Domain.RiskAnaUnit"> + select + rau.id, + rau.hazard_code, + u.realname hazard_liable_person, + rau.risk_unit_name, + rau.create_time, + rau.update_time, + rau.create_by, + rau.update_by, + rau.valid_flag, + rau.hazard_liable_person_id, + rau.hazard_dep_id, + d.department hazard_dep + from risk_ana_unit as rau + left join department as d on d.id = rau.hazard_dep_id and d.isdel = 0 + left join user as u on u.id = rau.hazard_liable_person_id + where rau.valid_flag = 1 + <if test="params.riskUnitName != null and params.riskUnitName != ''"> + and rau.risk_unit_name like concat("%",#{params.riskUnitName},"%") + </if> + <if test="params.hazardDep != null and params.hazardDep != ''"> + and d.department like concat("%",#{params.hazardDep},"%") + </if> + <if test="params.hazardLiablePerson != null and params.hazardLiablePerson != ''"> + and u.realname like concat("%",#{params.hazardLiablePerson},"%") + </if> + </select> + <select id="selectDepartmentAnalysis" resultType="java.util.Map"> + select count(0) count,d.department + from risk_ana_unit as rau + left join department as d on d.id = rau.hazard_dep_id and d.isdel = 0 + group by d.id + </select> + + <select id="getInfo" resultType="com.gk.hotwork.Domain.RiskAnaUnit"> + select + a.hazard_code, + u.realname hazard_liable_person, + a.risk_unit_name, + b.department hazard_dep + from risk_ana_unit as a + left join department as b on b.id = a.hazard_dep_id and b.isdel = 0 + left join user as u on u.id = a.hazard_liable_person_id + where valid_flag = 1 + </select> + +<!-- RiskAnaUnit getInfoByRiskUnitName(String riskUnitName);--> + <select id="getInfoByRiskUnitName" resultType="com.gk.hotwork.Domain.RiskAnaUnit"> + select * from risk_ana_unit where valid_flag = 1 and risk_unit_name = #{riskUnitName} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlClassifyMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlClassifyMapper.xml new file mode 100644 index 0000000..9e70dfd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlClassifyMapper.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RiskControlClassifyMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskControlClassify" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="note" property="note" jdbcType="VARCHAR" /> + <result column="order_index" property="orderIndex" jdbcType="INTEGER" /> + <result column="parent_id" property="parentId" jdbcType="BIGINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, name, note, order_index, parent_id, create_time, create_by, update_time, update_by, + valid_flag + </sql> + <select id="selectPages" resultMap="BaseResultMap"> + select classify1.* + from risk_control_classify as classify1 + where valid_flag = 1 + + </select> + +<!-- RiskControlClassify getByClassify1AndClassify12(String classify1, String classify2);--> + <select id="getByClassify1AndClassify12" resultType="com.gk.hotwork.Domain.RiskControlClassify"> + select * from risk_control_classify as classify1 + left join risk_control_classify as classify2 on classify1.id = classify2.parent_id + where classify1.valid_flag = 1 and classify1.name = #{classify1} and classify2.name = #{classify2} + </select> + + <!-- RiskControlClassify getByClassify1AndClassify2(String classify1, String classify2);--> + <select id="getByClassify1AndClassify2" resultType="com.gk.hotwork.Domain.RiskControlClassify"> + select + classify1.id id1 , + classify1.name, + classify2.id id2, + classify2.name + from risk_control_classify as classify1 + left join risk_control_classify as classify2 on classify1.id = classify2.parent_id + where classify1.valid_flag = 1 and classify1.name = #{classify1} and classify2.name = #{classify2} + </select> + + <!-- RiskControlClassify getByClassify(String classify);--> + <select id="getByClassify" resultType="com.gk.hotwork.Domain.RiskControlClassify"> + select * from risk_control_classify where valid_flag = 1 and name = #{classify} + </select> + + <!--RiskControlClassify getByClassify2(Long id, String trim);--> + <select id="getByClassify2" resultType="com.gk.hotwork.Domain.RiskControlClassify"> + select * from risk_control_classify where valid_flag = 1 and parent_id = #{id} and name = #{trim} + </select> + +<!-- RiskControlClassify getByControlId(Byte classify2);--> + <select id="getByControlId" resultMap="BaseResultMap"> + select * from risk_control_classify + where valid_flag = 1 and id = #{id} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlMeasureMapper.xml new file mode 100644 index 0000000..0bb2602 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskControlMeasureMapper.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RiskControlMeasureMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskControlMeasure" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="risk_event_id" property="riskEventId" jdbcType="BIGINT" /> + <result column="data_src" property="dataSrc" jdbcType="VARCHAR" /> + <result column="risk_measure_desc" property="riskMeasureDesc" jdbcType="VARCHAR" /> + <result column="classify1" property="classify1" jdbcType="VARCHAR" /> + <result column="classify2" property="classify2" jdbcType="VARCHAR" /> + <result column="classify3" property="classify3" jdbcType="VARCHAR" /> + + <result column="time_effect" property="timeEffect" jdbcType="VARCHAR" /> + <result column="time_unit" property="timeUnit" jdbcType="VARCHAR" /> + + <result column="troubleshoot_content" property="troubleshootContent" jdbcType="VARCHAR" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + <result column="event_update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="event_update_by" property="updateBy" jdbcType="VARCHAR" /> + <association property="riskEvent" javaType="com.gk.hotwork.Domain.RiskEvent"> + <id column="event_id" property="id" jdbcType="BIGINT" /> + <result column="risk_unit_id" property="riskUnitId" jdbcType="BIGINT" /> + <result column="risk_event_name" property="riskEventName" jdbcType="VARCHAR" /> + <result column="event_valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="event_create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="event_create_by" property="createBy" jdbcType="VARCHAR" /> + <association property="riskAnaUnit" javaType="com.gk.hotwork.Domain.RiskAnaUnit"> + <id column="unit_id" property="id" /> + <result column="hazard_code" jdbcType="VARCHAR" property="hazardCode" /> + <result column="hazard_dep" jdbcType="VARCHAR" property="hazardDep" /> + <result column="hazard_liable_person" jdbcType="VARCHAR" property="hazardLiablePerson" /> + <result column="risk_unit_name" jdbcType="VARCHAR" property="riskUnitName" /> + <result column="unit_create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="unit_update_time" jdbcType="TIMESTAMP" property="updateTime" /> + <result column="unit_create_by" jdbcType="VARCHAR" property="createBy" /> + <result column="unit_update_by" jdbcType="VARCHAR" property="updateBy" /> + <result column="unit_valid_flag" jdbcType="TINYINT" property="validFlag" /> + <result column="hazard_liable_person_id" jdbcType="BIGINT" property="hazardLiablePersonId" /> + <result column="hazard_dep_id" jdbcType="BIGINT" property="hazardDepId" /> + </association> + </association> + + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, risk_event_id, data_src, risk_measure_desc, classify1, classify2, classify3, + troubleshoot_content, valid_flag, create_time, update_time, create_by, update_by, + </sql> + <select id="selectPages" resultMap="BaseResultMap"> + select measure.*, + event.id event_id, + event.risk_unit_id risk_unit_id, + event.risk_event_name risk_event_name, + event.valid_flag event_valid_flag, + event.create_time event_create_time, + event.create_by event_create_by, + event.update_time event_update_time, + event.update_by event_update_by, + unit.id unit_id, + unit.hazard_code hazard_code, + unit.hazard_dep hazard_dep, + unit.hazard_liable_person hazard_liable_person, + unit.risk_unit_name risk_unit_name, + unit.create_time unit_create_time, + unit.update_time unit_update_time, + unit.create_by unit_create_by, + unit.update_by unit_update_by, + unit.valid_flag unit_valid_flag, + unit.hazard_liable_person_id hazard_liable_person_id, + unit.hazard_dep_id hazard_dep_id + from risk_control_measure as measure + left join risk_event as event on event.id = measure.risk_event_id and event.valid_flag = 1 + left join risk_ana_unit as unit on unit.id = event.risk_unit_id and unit.valid_flag = 1 + where measure.valid_flag = 1 + <if test="params.dataSrc != null and params.dataSrc != ''"> + and measure.data_src = #{params.dataSrc} + </if> + <if test="params.riskEventName != null and params.riskEventName != ''"> + and event.risk_event_name like concat("%",#{params.riskEventName},"%") + </if> + <if test="params.riskUnitName != null and params.riskUnitName != ''"> + and unit.risk_unit_name like concat("%",#{params.riskUnitName},"%") + </if> + + </select> + + <select id="getRiskControlMeasureList" resultMap="BaseResultMap"> + select + measure.data_src, + measure.risk_measure_desc, + measure.classify1, + measure.classify2, + measure.classify3, + measure.troubleshoot_content, + measure.risk_event_id, + measure.time_effect, + measure.time_unit, + event.risk_event_name + from risk_control_measure as measure + left join risk_event as event on event.id = measure.risk_event_id and event.valid_flag = 1 + where measure.valid_flag = 1 + </select> + +<!-- RiskControlMeasure getByDataSrc(String trim);--> + <select id="getByDataSrc" resultType="com.gk.hotwork.Domain.RiskControlMeasure"> + select DISTINCT data_src + from risk_control_measure where valid_flag = 1 and data_src = 'trim' + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskEventMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskEventMapper.xml new file mode 100644 index 0000000..f15baad --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskEventMapper.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RiskEventMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskEvent" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="risk_unit_id" property="riskUnitId" jdbcType="BIGINT" /> + <result column="risk_event_name" property="riskEventName" jdbcType="VARCHAR" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + <association property="riskAnaUnit" javaType="com.gk.hotwork.Domain.RiskAnaUnit"> + <id column="unit_id" property="id" /> + <result column="hazard_code" jdbcType="VARCHAR" property="hazardCode" /> + <result column="hazard_dep" jdbcType="VARCHAR" property="hazardDep" /> + <result column="hazard_liable_person" jdbcType="VARCHAR" property="hazardLiablePerson" /> + <result column="risk_unit_name" jdbcType="VARCHAR" property="riskUnitName" /> + <result column="unit_create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="unit_update_time" jdbcType="TIMESTAMP" property="updateTime" /> + <result column="unit_create_by" jdbcType="VARCHAR" property="createBy" /> + <result column="unit_update_by" jdbcType="VARCHAR" property="updateBy" /> + <result column="unit_valid_flag" jdbcType="TINYINT" property="validFlag" /> + <result column="hazard_liable_person_id" jdbcType="BIGINT" property="hazardLiablePersonId" /> + <result column="hazard_dep_id" jdbcType="BIGINT" property="hazardDepId" /> + </association> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, risk_unit_id, risk_event_name, valid_flag, create_time, create_by, update_time, + update_by, risk_uint_name + </sql> + <select id="selectPages" resultMap="BaseResultMap"> + select e.*, + unit.id unit_id, + unit.hazard_code hazard_code, + unit.hazard_dep hazard_dep, + unit.hazard_liable_person hazard_liable_person, + unit.risk_unit_name risk_unit_name, + unit.create_time unit_create_time, + unit.update_time unit_update_time, + unit.create_by unit_create_by, + unit.update_by unit_update_by, + unit.valid_flag unit_valid_flag, + unit.hazard_liable_person_id hazard_liable_person_id, + unit.hazard_dep_id hazard_dep_id + from risk_event as e + left join risk_ana_unit as unit on unit.id = e.risk_unit_id and unit.valid_flag = 1 + where e.valid_flag = 1 + <if test="params.riskEventName != null and params.riskEventName != ''"> + and e.risk_event_name like concat("%",#{params.riskEventName},"%") + </if> + <if test="params.riskUnitName != null and params.riskUnitName != ''"> + and unit.risk_unit_name like concat("%",#{params.riskUnitName},"%") + </if> + </select> + +<!-- List<RiskEvent> getRiskEventList();--> + <select id="getRiskEventList" resultMap="BaseResultMap"> + select unit.risk_unit_name, event.risk_unit_id, event.risk_event_name + from risk_event event + left join risk_ana_unit unit on event.risk_unit_id = unit.id and unit.valid_flag = 1 + where event.valid_flag = 1 + </select> + + <!--RiskEvent getByRiskEventName(String riskEventName);--> + <select id="getByRiskEventName" resultType="com.gk.hotwork.Domain.RiskEvent"> + select * from risk_event where valid_flag = 1 and risk_event_name = #{riskEventName} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskMapMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskMapMapper.xml new file mode 100644 index 0000000..116d3cf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskMapMapper.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RiskMapRepository"> + <resultMap id="baseMapper" type="com.gk.hotwork.Domain.RiskMap"> + <id column="id" property="id" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> + <result column="edit_uid" property="editUid" jdbcType="BIGINT"/> + <result column="edit_time" property="editTime" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="edit_uname" property="editUname" jdbcType="VARCHAR"/> + <result column="img" property="img" jdbcType="VARCHAR"/> + <result column="desc_info" property="descInfo" jdbcType="VARCHAR"/> + </resultMap> + + <sql id="all_columns"> + id,eid,status,create_uid,create_time,edit_uid,edit_time,create_uname,edit_uname,img,desc_info + </sql> + + <select id="listByStatus" resultMap="baseMapper"> + select <include refid="all_columns"></include> from risk_map + <where> + <if test="status != null"> + status = #{status} + </if> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskSourceMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskSourceMapper.xml new file mode 100644 index 0000000..b9d6d8f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RiskSourceMapper.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RiskSourceMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RiskSource" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="level" property="level" jdbcType="TINYINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="depId" property="dep_id" jdbcType="BIGINT"/> + <result column="createUid" property="create_uid" jdbcType="BIGINT"/> + <result column="editUid" property="edit_uid" jdbcType="BIGINT"/> + <result column="createTime" property="create_time" jdbcType="TIMESTAMP"/> + <result column="editTime" property="edit_time" jdbcType="TIMESTAMP"/> + <result column="createUname" property="create_uname" jdbcType="VARCHAR"/> + <result column="editUname" property="edit_uname" jdbcType="VARCHAR"/> + <result column="depName" property="dep_name" jdbcType="VARCHAR"/> + <result column="location" property="location" jdbcType="VARCHAR"/> + <result column="accidentDesc" property="accident_desc" jdbcType="VARCHAR"/> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id,name,type,level,status,dep_id,create_uid,edit_uid,create_time,edit_time,create_uname,edit_uname,dep_name,location,accident_desc + </sql> + <select id="findRiskSourceListByConditionsAndPage" resultMap="BaseResultMap"> + select <include refid="Base_Column_List"/> + from risk_source + <where> + status != 3 + <if test="parm.type != null"> + and type = #{parm.type} + </if> + <if test="parm.status != null"> + and status = #{parm.status} + </if> + <if test="parm.level != null"> + and level = #{parm.level} + </if> + <if test="parm.depId != null"> + and dep_id = #{parm.depId} + </if> + <if test="parm.startTime != null"> + and create_time >= #{parm.startTime} + </if> + <if test="parm.endTime != null"> + and create_time <= #{parm.endTime} + </if> + <if test="parm.name != null and parm.name != ''"> + <bind name="namePat" value="'%' + parm.name + '%'"/> + and name like #{namePat} + </if> + <if test="parm.depName != null and parm.depName != ''"> + <bind name="depnamePat" value="'%' + parm.depName + '%'"/> + and dep_name like #{depnamePat} + </if> + <if test="parm.location != null and parm.location != ''"> + <bind name="locatPat" value="'%' + parm.location + '%'"/> + and location like #{localPat} + </if> + </where> + </select> + + <!-- List<RiskSource> getRiskSourceList();--> + <select id="getRiskSourceList" resultMap="BaseResultMap"> + select * from risk_source where status = 1 + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RoleInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RoleInfoMapper.xml new file mode 100644 index 0000000..fdf29bb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RoleInfoMapper.xml @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RoleInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RoleInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + <result column="description" property="description" jdbcType="VARCHAR" /> + <result column="code" property="code" jdbcType="VARCHAR" /> + <result column="btnaccess" property="btnaccess" jdbcType="VARCHAR" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, name, createdby, createddate, lastmodifiedby, lastmodifieddate, description, + code, btnaccess,isdel + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from role + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectRoleByUser" resultType="com.gk.hotwork.Domain.RoleInfo"> + SELECT + role.id, + role.`name` + from role + LEFT JOIN userroles on userroles.roleid = role.id + where + userroles.userid = #{id,jdbcType=BIGINT} + </select> + <select id="selectList" resultType="com.gk.hotwork.Domain.RoleInfo"> + select + <include refid="Base_Column_List" /> + from role + <where> + 1=1 + and isdel = 0 + <if test="name != null and name !=''"> + and name = #{name} + </if> + </where> + </select> + <select id="selectExistRole" resultType="com.gk.hotwork.Domain.RoleInfo"> + select + <include refid="Base_Column_List" /> + from role + <where> + 1=1 + <if test="name != null and name !=''"> + and name = #{name} + </if> + <if test="id != null"> + and id != #{id} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from role + where id = #{id,jdbcType=BIGINT} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.RoleInfo" > + <!-- --> + update role + <set > + <if test="name != null" > + name = #{name,jdbcType=VARCHAR}, + </if> + <if test="createdby != null" > + createdby = #{createdby,jdbcType=VARCHAR}, + </if> + <if test="createddate != null" > + createddate = #{createddate,jdbcType=TIMESTAMP}, + </if> + <if test="lastmodifiedby != null" > + lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR}, + </if> + <if test="lastmodifieddate != null" > + lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP}, + </if> + <if test="description != null" > + description = #{description,jdbcType=VARCHAR}, + </if> + <if test="code != null" > + code = #{code,jdbcType=VARCHAR}, + </if> + <if test="btnaccess != null" > + btnaccess = #{btnaccess,jdbcType=VARCHAR}, + </if> + <if test="isdel != null"> + isdel = #{isdel,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.RoleInfo" > + <!-- --> + update role + set name = #{name,jdbcType=VARCHAR}, + createdby = #{createdby,jdbcType=VARCHAR}, + createddate = #{createddate,jdbcType=TIMESTAMP}, + lastmodifiedby = #{lastmodifiedby,jdbcType=VARCHAR}, + lastmodifieddate = #{lastmodifieddate,jdbcType=TIMESTAMP}, + description = #{description,jdbcType=VARCHAR}, + code = #{code,jdbcType=VARCHAR}, + btnaccess = #{btnaccess,jdbcType=VARCHAR}, + isdel = #{isdel,jdbcType=TINYINT}, + where id = #{id,jdbcType=BIGINT} + </update> + <select id="selectOauthRoleByUser" resultType="com.gk.hotwork.Config.Oauth2.OauthRole"> + SELECT + ar.id, + ar.NAME, + ar.code, + ar.btnaccess + FROM + userroles AS aur + LEFT JOIN role AS ar ON ar.id = aur.roleid + WHERE + aur.userid = #{id,jdbcType=INTEGER} + </select> + <select id="selectRoleCount" resultType="java.lang.Integer"> + select + count(0) + from role + where isdel = 0 + <if test="name != null and name != ''"> + and name like concat("%",#{name},"%") + </if> + </select> + <select id="selectPageForRole" resultType="com.gk.hotwork.Domain.RoleInfo"> + select + * + from role + where isdel = 0 + <if test="params.name != null and params.name != ''"> + and name like concat("%",#{params.name},"%") + </if> + order by createddate desc + <if test="params.first != null and params.pageSize != null"> + limit #{params.first},#{params.pageSize} + </if> + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/RolePermissionsInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/RolePermissionsInfoMapper.xml new file mode 100644 index 0000000..02d40ca --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/RolePermissionsInfoMapper.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.RolePermissionsInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.RolePermissionsInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="roleid" property="roleid" jdbcType="BIGINT" /> + <result column="permissionid" property="permissionid" jdbcType="BIGINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, roleid, permissionid + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from rolepermissions + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectMenuList" resultType="com.gk.hotwork.Domain.Vo.Menu"> + select permissionid as id + from rolepermissions + where roleid = #{roleId,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from rolepermissions + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="delRolePermissionByRoleId"> + delete from rolepermissions + where roleid = #{roleid,jdbcType=BIGINT} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.RolePermissionsInfo" > + <!-- --> + update rolepermissions + <set > + <if test="roleid != null" > + roleid = #{roleid,jdbcType=BIGINT}, + </if> + <if test="permissionid != null" > + permissionid = #{permissionid,jdbcType=BIGINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.RolePermissionsInfo" > + <!-- --> + update rolepermissions + set roleid = #{roleid,jdbcType=BIGINT}, + permissionid = #{permissionid,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemDeductionMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemDeductionMapper.xml new file mode 100644 index 0000000..962d82c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemDeductionMapper.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SafetyInspectionItemDeductionMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetyInspectionItemDeduction" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="safety_inspection_item_id" property="safetyInspectionItemId" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + + </resultMap> + + <select id="getBySafetyInspectionItemId" resultMap="BaseResultMap"> + select * from safety_inspection_item_deduction where valid_flag = 1 and safety_inspection_item_id=#{safetyInspectionItemId} + </select> + + <update id="deleteById"> + update safety_inspection_item_deduction set + valid_flag=0, + update_time=#{updateTime}, + update_by=#{updateBy} + where id=#{id} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml new file mode 100644 index 0000000..6df66a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SafetyInspectionItemMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetyInspectionItem" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="element_a" property="elementA" jdbcType="BIGINT" /> + <result column="element_b" property="elementB" jdbcType="BIGINT" /> + <result column="standardization_requirements" property="standardizationRequirements" jdbcType="VARCHAR" /> + <result column="enterprise_standard" property="enterpriseStandard" jdbcType="VARCHAR" /> + <result column="review_method" property="reviewMethod" jdbcType="VARCHAR" /> + <result column="veto" property="veto" jdbcType="VARCHAR" /> + <result column="element_a_name" property="elementAName" jdbcType="VARCHAR" /> + <result column="element_b_name" property="elementBName" jdbcType="VARCHAR" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select a.*, + b.name element_a_name, + c.name element_b_name + from safety_inspection_item as a + left join element_management as b on a.element_a = b.id and b.valid_flag = 1 + left join element_management as c on a.element_b = c.id and c.valid_flag = 1 + where a.valid_flag = 1 and a.element_b= #{params.elementB} + </select> + + <select id="infoElementA" resultMap="BaseResultMap"> + select a.*, + b.name element_a_name, + c.name element_b_name + from safety_inspection_item as a + left join element_management as b on a.element_a = b.id and b.valid_flag = 1 + left join element_management as c on a.element_b = c.id and c.valid_flag = 1 + where a.valid_flag = 1 and a.element_a= #{id} + </select> + + + <select id="getById" resultMap="BaseResultMap"> + select a.*, + b.name element_a_name, + c.name element_b_name + from safety_inspection_item as a + left join element_management as b on a.element_a = b.id and b.valid_flag = 1 + left join element_management as c on a.element_b = c.id and c.valid_flag = 1 + where a.valid_flag = 1 and a.id= #{id} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemDeductionMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemDeductionMapper.xml new file mode 100644 index 0000000..e5ef41c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemDeductionMapper.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SafetySelfInspectionItemDeductionMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetySelfInspectionItemDeduction" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="safety_self_inspection_item_id" property="safetySelfInspectionItemId" jdbcType="BIGINT" /> + <result column="safety_inspection_item_deduction_id" property="safetyInspectionItemDeductionId" jdbcType="BIGINT" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="point" property="point" jdbcType="BIGINT" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + </resultMap> + + <select id="getBySafetySelfInspectionItemId" resultMap="BaseResultMap"> + SELECT + a.*, + b.`name` + FROM + safety_self_inspection_item_deduction a + LEFT JOIN safety_inspection_item_deduction b ON a.safety_inspection_item_deduction_id = b.id + WHERE + a.valid_flag = 1 + AND safety_self_inspection_item_id=#{safetySelfInspectionItemId} + </select> + + + <update id="delBySafetySelfInspectionItemId"> + update safety_self_inspection_item_deduction set + valid_flag=0, + update_time=#{updateTime}, + update_by=#{updateBy} + where safety_self_inspection_item_id=#{safetySelfInspectionItemId} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemMapper.xml new file mode 100644 index 0000000..17d0345 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionItemMapper.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SafetySelfInspectionItemMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetySelfInspectionItem" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + + <result column="safety_self_inspection_id" property="safetySelfInspectionId" jdbcType="BIGINT" /> + <result column="safety_inspection_item_id" property="safetyInspectionItemId" jdbcType="BIGINT" /> + <result column="safety_inspection_item_result" property="safetyInspectionItemResult" jdbcType="VARCHAR" /> + <result column="safety_inspection_item_result_desc" property="safetyInspectionItemResultDesc" jdbcType="VARCHAR" /> + + </resultMap> + + <select id="getBySafetySelfInspectionId" resultMap="BaseResultMap"> + select * from safety_self_inspection_item where valid_flag = 1 and safety_self_inspection_id=#{safetySelfInspectionId} + </select> + + <update id="deleteById"> + update safety_self_inspection_item set + valid_flag=0, + update_time=#{updateTime}, + update_by=#{updateBy} + where id=#{id} + </update> + + <select id="getDetailBySafetySelfInspectionId" resultMap="BaseResultMap"> + SELECT + a.*, + b.standardization_requirements AS standardizationRequirements, + b.enterprise_standard AS enterpriseStandard, + b.review_method AS reviewMethod, + b.veto AS veto, + c.id AS elementA, + c.NAME AS elementAName, + c.weight AS elementAWeight, + d.id AS elementB, + d.NAME AS elementBName, + d.point as point + FROM + safety_self_inspection_item a + LEFT JOIN safety_inspection_item b ON a.safety_inspection_item_id = b.id + AND b.valid_flag = 1 + LEFT JOIN element_management c ON b.element_a = c.id + AND c.valid_flag = 1 + LEFT JOIN element_management d ON b.element_b = d.id + AND d.valid_flag = 1 + WHERE + a.valid_flag = 1 + AND a.safety_self_inspection_id=#{safetySelfInspectionId} + <if test="unqualified != null and unqualified != ''"> + And a.safety_inspection_item_result in (0,1) + </if> + </select> + + <select id="getDetailById" resultMap="BaseResultMap"> + SELECT + a.*, + b.standardization_requirements AS standardizationRequirements, + b.enterprise_standard AS enterpriseStandard, + b.review_method AS reviewMethod, + b.veto AS veto, + c.NAME AS elementAName, + d.NAME AS elementBName, + d.point as point + FROM + safety_self_inspection_item a + LEFT JOIN safety_inspection_item b ON a.safety_inspection_item_id = b.id + AND b.valid_flag = 1 + LEFT JOIN element_management c ON b.element_a = c.id + AND c.valid_flag = 1 + LEFT JOIN element_management d ON b.element_b = d.id + AND d.valid_flag = 1 + WHERE + a.valid_flag = 1 + AND a.id=#{id} + </select> + + <select id="countQualifiedDataById" + resultType="com.gk.hotwork.Domain.Do.SafetySelfInspectionItemQualifiedCountDO"> + SELECT + COUNT( CASE WHEN safety_self_inspection_id = #{id} THEN 1 ELSE NULL END ) AS `itemSum`, + COUNT( CASE WHEN safety_self_inspection_id = #{id} and safety_inspection_item_result = 2 THEN 1 ELSE NULL END ) AS 'qualifiedItem' + FROM safety_self_inspection_item WHERE valid_flag = 1 + + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionMapper.xml new file mode 100644 index 0000000..c3ec6c8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetySelfInspectionMapper.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SafetySelfInspectionMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetySelfInspection" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="update_by" property="updateBy" jdbcType="VARCHAR" /> + <result column="checked_company_id" property="checkedCompanyId" jdbcType="BIGINT" /> + <result column="checked_company_name" property="checkedCompanyName" jdbcType="VARCHAR" /> + + <result column="inspection_name" property="inspectionName" jdbcType="BIGINT" /> + <result column="inspection_time" property="inspectionTime" jdbcType="BIGINT" /> + <result column="inspector" property="inspector" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="VARCHAR" /> + <result column="inspector_name" property="inspectorName" jdbcType="VARCHAR" /> + + </resultMap> + <select id="selectPages" resultMap="BaseResultMap"> + select a.*, + b.realname inspector_name,c.roleid + from safety_self_inspection as a + left join user as b on a.inspector = b.id and b.isdel = 0 + LEFT JOIN userroles as c on b.id = c.userid + where a.valid_flag = 1 + <if test="params.inspectionName != null and params.inspectionName != ''"> + and a.inspection_name like concat("%",#{params.inspectionName},"%") + </if> + <if test="params.companyid != null and params.companyid != ''"> + and b.companyid = #{params.companyid} + </if> + <if test="params.checkedCompanyId != null"> + and b.checkedCompanyId = #{params.checkedCompanyId} + </if> + <if test="params.roleid != null "> + and c.roleid = #{params.roleid} + </if> + <if test="params.inspectorName != null and params.inspectorName != ''"> + and b.realname like concat("%",#{params.inspectorName},"%") + </if> + <if test="params.inspectionStartTime != null and params.inspectionStartTime != ''" > + and a.inspection_time <![CDATA[ >= ]]> #{params.inspectionStartTime} + </if> + <if test="params.inspectionEndTime != null and params.inspectionEndTime != ''" > + and a.inspection_time <![CDATA[ <= ]]> #{params.inspectionEndTime} + </if> + order by a.create_time desc + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SelfCheckInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SelfCheckInfoMapper.xml new file mode 100644 index 0000000..83451c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SelfCheckInfoMapper.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SelfCheckInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SelfCheckInfo" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="tasktype" property="type" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="checktype" property="checktype" jdbcType="VARCHAR" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="standard" property="standard" jdbcType="VARCHAR" /> + <result column="sort" property="sort" jdbcType="INTEGER" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="description" property="description" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id,tasktype, type, checktype, content, standard, sort, isdel, description, createdby, createddate, modifiedby, + modifieddate + </sql> + <select id="selectByType" resultType="com.gk.hotwork.Domain.Vo.SelfCheckVo"> + select + <include refid="Base_Column_List" /> + from selfcheck + where isdel = 0 + and type = #{type} + ORDER BY sort ASC + </select> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.SelfCheckInfo"> + select + <include refid="Base_Column_List" /> + from selfcheck + <where> + isdel = 0 + <if test="condition.tasktype != null and condition.tasktype != ''"> + and tasktype = #{condition.tasktype} + </if> + <if test="condition.type != null and condition.type != ''"> + and type = #{condition.type} + </if> + <if test="condition.content != null and condition.content != ''"> + and content like concat('%',#{condition.content},'%') + </if> + </where> + </select> + <select id="selectByIds" resultType="com.gk.hotwork.Domain.SelfCheckInfo"> + select + <include refid="Base_Column_List" /> + from selfcheck + <where> + isdel = 0 + <if test="idList != null and idList.size > 0"> + and id in + <foreach collection="idList" index="index" item="item" open="(" separator="," close=")"> + #{item} + </foreach> + </if> + </where> + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogInfoMapper.xml new file mode 100644 index 0000000..07b5f55 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogInfoMapper.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SmsLogInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SmsLogInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="mobile" property="mobile" jdbcType="VARCHAR" /> + <result column="sendtime" property="sendtime" jdbcType="TIMESTAMP" /> + <result column="times" property="times" jdbcType="INTEGER" /> + <result column="type" property="type" jdbcType="TINYINT"/> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, mobile, sendtime, times,type + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from smslog + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectByTel" resultType="com.gk.hotwork.Domain.SmsLogInfo"> + select + <include refid="Base_Column_List" /> + from smslog + where mobile = '${mobile}' + and sendtime >= '${starttime}' + and sendtime <= '${endtime}' + and type = '${type}' + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from smslog + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteByTime"> + delete from smslog + where sendtime <= '${seventime}' + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.SmsLogInfo" > + <!-- --> + update smslog + <set > + <if test="mobile != null" > + mobile = #{mobile,jdbcType=VARCHAR}, + </if> + <if test="sendtime != null" > + sendtime = #{sendtime,jdbcType=TIMESTAMP}, + </if> + <if test="times != null" > + times = #{times,jdbcType=INTEGER}, + </if> + <if test="type != null"> + type = #{type,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.SmsLogInfo" > + <!-- --> + update smslog + set mobile = #{mobile,jdbcType=VARCHAR}, + sendtime = #{sendtime,jdbcType=TIMESTAMP}, + times = #{times,jdbcType=INTEGER}, + type = #{type,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogMapper.xml new file mode 100644 index 0000000..603430e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SmsLogMapper.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SmsLogMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SmsLog" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="phone" property="phone" jdbcType="VARCHAR" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="send_time" property="sendTime" jdbcType="TIMESTAMP" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="createby" property="createby" jdbcType="VARCHAR" /> + <result column="source" property="source" jdbcType="TINYINT" /> + </resultMap> + + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SubTaskInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SubTaskInfoMapper.xml new file mode 100644 index 0000000..e1f6a28 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SubTaskInfoMapper.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.SubTaskInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SubTaskInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="category" property="category" jdbcType="VARCHAR" /> + <result column="level" property="level" jdbcType="TINYINT" /> + <result column="checked" property="checked" jdbcType="TINYINT" /> + <result column="spacecategory" property="spacecategory" jdbcType="VARCHAR" /> + <result column="spacename" property="spacename" jdbcType="VARCHAR" /> + <result column="spacemedium" property="spacemedium" jdbcType="VARCHAR" /> + <result column="acibase" property="acibase" jdbcType="VARCHAR" /> + <result column="hoistingweight" property="hoistingweight" jdbcType="DOUBLE" /> + <result column="soildepth" property="soildepth" jdbcType="DOUBLE" /> + <result column="soilarea" property="soilarea" jdbcType="DOUBLE" /> + <result column="breakreason" property="breakreason" jdbcType="VARCHAR" /> + <result column="workheight" property="workheight" jdbcType="DOUBLE" /> + <result column="electricityarea" property="electricityarea" jdbcType="VARCHAR" /> + <result column="voltage" property="voltage" jdbcType="VARCHAR" /> + <result column="power" property="power" jdbcType="VARCHAR" /> + <result column="pipename" property="pipename" jdbcType="VARCHAR" /> + <result column="pipemedium" property="pipemedium" jdbcType="VARCHAR" /> + <result column="pipetemperature" property="pipetemperature" jdbcType="VARCHAR" /> + <result column="pipepressure" property="pipepressure" jdbcType="VARCHAR" /> + <result column="blindboardmaterial" property="blindboardmaterial" jdbcType="VARCHAR" /> + <result column="blindboardspecification" property="blindboardspecification" jdbcType="VARCHAR" /> + <result column="blindboardnumber" property="blindboardnumber" jdbcType="VARCHAR" /> + <result column="commander" property="commander" jdbcType="VARCHAR" /> + <result column="firetype" property="firetype" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, type, category, level, checked, spacecategory, spacename, spacemedium, + acibase, hoistingweight, soildepth, soilarea, breakreason, workheight, + electricityarea, voltage, power, pipename, pipemedium, pipetemperature, pipepressure, + blindboardmaterial, blindboardspecification, blindboardnumber, commander, + firetype + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskAnalysisMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskAnalysisMapper.xml new file mode 100644 index 0000000..e992ce9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskAnalysisMapper.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskAnalysisMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskAnalysis" > + <!-- --> + <id column="id" property="id" jdbcType="TINYINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="analysisat" property="analysisat" jdbcType="TIMESTAMP" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="analysisarea" property="analysisarea" jdbcType="VARCHAR" /> + <result column="analyst" property="analyst" jdbcType="VARCHAR" /> + <result column="mediumname" property="mediumname" jdbcType="VARCHAR" /> + <result column="mediumvalue" property="mediumvalue" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, analysisat, content, analysisarea, analyst, createdat, createdby, modifiedat, + modifiedby, flag, mediumname, mediumvalue + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEnclosureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEnclosureMapper.xml new file mode 100644 index 0000000..1497f41 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEnclosureMapper.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskEnclosureMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskEnclosure" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="filetype" property="filetype" jdbcType="TINYINT" /> + <result column="filename" property="filename" jdbcType="VARCHAR" /> + <result column="originalname" property="originalname" jdbcType="VARCHAR" /> + <result column="fileurl" property="fileurl" jdbcType="VARCHAR" /> + <result column="version" property="version" jdbcType="REAL" /> + <result column="remark" property="remark" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, type, filetype, filename, originalname, fileurl, version, remark, createdby, + createdat, modifiedby, modifiedat, flag + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentBindInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentBindInfoMapper.xml new file mode 100644 index 0000000..f34e021 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentBindInfoMapper.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.Mapper.TaskEquipmentBindInfoMapper"> + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskEquipmentBindInfo"> + <!-- --> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="taskcode" jdbcType="VARCHAR" property="taskcode" /> + <result column="equipmentnumber" jdbcType="VARCHAR" property="equipmentnumber" /> + <result column="equipmentname" jdbcType="VARCHAR" property="equipmentname" /> + <result column="updateby" jdbcType="VARCHAR" property="updateby" /> + <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> + </resultMap> + <sql id="Base_Column_List"> + id, taskcode, equipmentnumber, equipmentname, updateby, updatetime + </sql> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentMapper.xml new file mode 100644 index 0000000..ad6af72 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskEquipmentMapper.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskEquipmentMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskEquipment" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="num" property="num" jdbcType="INTEGER" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, name, type, num, createdat, createdby, modifiedat, modifiedby, flag + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskGasInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskGasInfoMapper.xml new file mode 100644 index 0000000..463346b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskGasInfoMapper.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskGasInfoMapper"> + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskGasInfo"> + <!-- --> + <id column="id" property="id" jdbcType="BIGINT"/> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR"/> + <result column="taskworker" property="taskworker" jdbcType="VARCHAR"/> + <result column="gastype" property="gastype" jdbcType="VARCHAR"/> + <result column="gasvalue" property="gasvalue" jdbcType="DECIMAL"/> + <result column="gasunit" property="gasunit" jdbcType="VARCHAR"/> + <result column="iswarn" property="iswarn" jdbcType="TINYINT"/> + <result column="isyujing" property="isyujing" jdbcType="TINYINT"/> + <result column="issms" property="issms" jdbcType="TINYINT"/> + <result column="ismend" property="ismend" jdbcType="TINYINT"/> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP"/> + </resultMap> + <sql id="Base_Column_List"> + <!-- --> + id, taskcode, taskworker, gastype, gasvalue, gasunit, iswarn, isyujing, issms, ismend, + updatetime + </sql> + <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.TaskGasInfo"> + select * + from taskgas + <where> + 1=1 + <if test="condition.taskcode != null and condition.taskcode !=''"> + and taskcode = #{condition.taskcode} + </if> + <if test="condition.gastype != null and condition.gastype !=''"> + and gastype = #{condition.gastype} + </if> + </where> + </select> + <select id="selectLastGas" resultType="com.gk.hotwork.Domain.TaskGasInfo"> + SELECT + * + FROM + ( + SELECT * FROM `taskgas` + <where> + taskcode = #{taskCode} + AND taskworker = #{worker} + </where> + ORDER BY + updatetime DESC + LIMIT 100 + ) t + GROUP BY + t.gastype + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInfoMapper.xml new file mode 100644 index 0000000..05c2cea --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInfoMapper.xml @@ -0,0 +1,868 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskInfoMapper"> + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskInfo"> + <!-- --> + <id column="id" property="id" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="unit" property="unit" jdbcType="VARCHAR"/> + <result column="department" property="department" jdbcType="VARCHAR"/> + <result column="applicant" property="applicant" jdbcType="VARCHAR"/> + <result column="code" property="code" jdbcType="VARCHAR"/> + <result column="etype" property="etype" jdbcType="VARCHAR"/> + <result column="level" property="level" jdbcType="TINYINT"/> + <result column="area" property="area" jdbcType="VARCHAR"/> + <result column="mode" property="mode" jdbcType="VARCHAR"/> + <result column="director" property="director" jdbcType="VARCHAR"/> + <result column="starttime" property="starttime" jdbcType="TIMESTAMP"/> + <result column="endtime" property="endtime" jdbcType="TIMESTAMP"/> + <result column="othertask" property="othertask" jdbcType="VARCHAR"/> + <result column="hazard" property="hazard" jdbcType="VARCHAR"/> + <result column="supervisor" property="supervisor" jdbcType="VARCHAR"/> + <result column="profession" property="profession" jdbcType="VARCHAR"/> + <result column="partdirector" property="partdirector" jdbcType="VARCHAR"/> + <result column="approversupervisor" property="approversupervisor" jdbcType="VARCHAR"/> + <result column="approverprofession" property="approverprofession" jdbcType="VARCHAR"/> + <result column="applyunitopinion" property="applyunitopinion" jdbcType="VARCHAR"/> + <result column="constructionopinion" property="constructionopinion" jdbcType="VARCHAR"/> + <result column="relevantopinion" property="relevantopinion" jdbcType="VARCHAR"/> + <result column="securityopinion" property="securityopinion" jdbcType="VARCHAR"/> + <result column="enterpriseopinion" property="enterpriseopinion" jdbcType="VARCHAR"/> + <result column="shiftleaderopinion" property="shiftleaderopinion" jdbcType="VARCHAR"/> + <result column="applyunitname" property="applyunitname" jdbcType="VARCHAR"/> + <result column="constructionname" property="constructionname" jdbcType="VARCHAR"/> + <result column="relevantname" property="relevantname" jdbcType="VARCHAR"/> + <result column="securityname" property="securityname" jdbcType="VARCHAR"/> + <result column="enterprisename" property="enterprisename" jdbcType="VARCHAR"/> + <result column="shiftleadername" property="shiftleadername" jdbcType="VARCHAR"/> + <result column="applyunittime" property="applyunittime" jdbcType="TIMESTAMP"/> + <result column="constructiontime" property="constructiontime" jdbcType="TIMESTAMP"/> + <result column="relevanttime" property="relevanttime" jdbcType="TIMESTAMP"/> + <result column="securitytime" property="securitytime" jdbcType="TIMESTAMP"/> + <result column="enterprisetime" property="enterprisetime" jdbcType="TIMESTAMP"/> + <result column="shiftleadertime" property="shiftleadertime" jdbcType="TIMESTAMP"/> + <result column="completedtime" property="completedtime" jdbcType="TIMESTAMP"/> + <result column="completedname" property="completedname" jdbcType="VARCHAR"/> + <result column="completedconfirm" property="completedconfirm" jdbcType="VARCHAR"/> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP"/> + <result column="createdby" property="createdby" jdbcType="VARCHAR"/> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP"/> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR"/> + <result column="flag" property="flag" jdbcType="TINYINT"/> + <result column="isdel" property="isdel" jdbcType="TINYINT"/> + <result column="constructionunit" property="constructionunit" jdbcType="VARCHAR"/> + <result column="securitydep" property="securitydep" jdbcType="VARCHAR"/> + <result column="isholiday" property="isholiday" jdbcType="TINYINT"/> + <result column="analyst" property="analyst" jdbcType="VARCHAR"/> + <result column="path" property="path" jdbcType="VARCHAR"/> + <result column="fullpath" property="fullpath" jdbcType="VARCHAR"/> + <result column="supervisoropinion" property="supervisoropinion" jdbcType="VARCHAR"/> + <result column="content" property="content" jdbcType="VARCHAR"/> + <result column="opinion" property="opinion" jdbcType="VARCHAR"/> + <result column="description" property="description" jdbcType="VARCHAR"/> + <result column="isanalysis" property="isanalysis" jdbcType="TINYINT"/> + <result column="analysisarea" property="analysisarea" jdbcType="VARCHAR"/> + <result column="analysismedium" property="analysismedium" jdbcType="VARCHAR"/> + </resultMap> + + <resultMap id="active_task_map" type="com.gk.hotwork.Domain.Vo.specTask.ActiveTaskInfo"> + <id column="id" property="id" jdbcType="BIGINT"/> + <result column="code" property="code" jdbcType="VARCHAR"/> + </resultMap> + <sql id="active_task_column"> + id,code + </sql> + + <sql id="Base_Column_List"> + <!-- --> + id, status, unit, department, applicant, code, level, area, mode, director, starttime, endtime, + othertask, hazard, supervisor, profession, partdirector, approversupervisor, approverprofession, + applyunitopinion, constructionopinion, relevantopinion, securityopinion, enterpriseopinion, + shiftleaderopinion, applyunitname, constructionname, relevantname, securityname, + enterprisename, shiftleadername, applyunittime, constructiontime, relevanttime, securitytime, + enterprisetime, shiftleadertime, completedtime, completedname, completedconfirm, + createdat, createdby, modifiedat, modifiedby, flag, isdel, constructionunit, securitydep, isholiday, + analyst, path, fullpath, supervisoropinion, content, opinion, `description`, isanalysis, analysisarea, + analysismedium + </sql> + + <select id="selectActiveTaskList" resultMap="active_task_map"> + select <include refid="active_task_column"></include> from task + <where> + <if test="time != null"> + task.starttime <= #{time} + and task.endtime >= #{time} + </if> + <if test="type != null"> + and type = #{type} + </if> + </where> + </select> + + <select id="selectTaskDataGrid" resultType="com.gk.hotwork.Domain.TaskInfo"> + select + task.* + from task + left join subtask on subtask.taskcode = task.`code` + <where> + isdel = 0 + <if test="condition.code != null and condition.code != ''"> + and `code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and `level` = #{condition.level} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`createdat` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`createdat` <= #{condition.endtime} + </if> + + <if test="condition.company != null and condition.company != ''"> + and task.constructionunit = #{condition.company} + </if> + + <if test="condition.type != null and condition.type != ''"> + and subtask.type = #{condition.type} + </if> + + <if test="condition.status != null "> + and task.status = #{condition.status} + </if> + + <if test="condition.flag != null "> + and task.flag = #{condition.flag} + </if> + </where> + </select> + <select id="selectTaskDataGridByDep" resultType="com.gk.hotwork.Domain.TaskInfo"> + select + <include refid="Base_Column_List"/> + from task + <where> + isdel = 0 + and unit = #{condition.unit} + and department = #{condition.department} + <if test="condition.code != null and condition.code != ''"> + and `code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and `level` = #{condition.level} + </if> + </where> + </select> + <select id="getWaitReviewDataGrid" resultType="com.gk.hotwork.Domain.TaskInfo"> + ( SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + <where> + task.isdel = 0 + AND task.department = #{condition.department} + AND task.unit = #{condition.unit} + AND task.applicant = #{condition.applicant} + AND task.flag IN (0,2,6) + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.department != null and condition.department != ''"> + and task.`department` = #{condition.department} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + </where> + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + WHERE + task.isdel = 0 + AND task.department = #{condition.department} + AND task.`status` = 3 + AND 1 = #{condition.isDepartment} + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.department != null and condition.department != ''"> + and task.`department` = #{condition.department} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + <where> + task.isdel = 0 + AND tid.department = #{condition.department} + AND task.`status` = 4 + AND 1 = #{condition.isDepartment} + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + </where> + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + <where> + task.isdel = 0 + AND task.securitydep = #{condition.department} + AND task.`status` = 5 + AND 1 = #{condition.isDepartment} + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + </where> + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + <where> + task.isdel = 0 + AND task.unit = #{condition.unit} + AND task.`status` = 6 + AND 1 = #{condition.isCompany} + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + </where> + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + WHERE + task.isdel = 0 + AND task.constructionunit = #{condition.unit} + AND task.`status` = 2 + AND 1 = #{condition.isCompany} + GROUP BY + task.`code` + ) UNION + ( + SELECT + task.* + FROM + task + LEFT JOIN taskinvolvedep AS tid ON task.`code` = tid.taskcode + left join subtask on subtask.taskcode = task.`code` + <where> + task.isdel = 0 + AND task.constructionunit = #{condition.department} + AND task.`status` = 2 + AND 1 = #{condition.isDepartment} + <if test="condition.code != null and condition.code != ''"> + and task.`code` like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.`level` = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.`status` = #{condition.status} + </if> + <if test="condition.flag != null and condition.flag != ''"> + and task.`flag` = #{condition.flag} + </if> + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`starttime` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`endtime` <= #{condition.endtime} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.`level` = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.`type` = #{condition.tasktype} + </if> + </where> + + GROUP BY + task.`code` + ) + + </select> + <select id="getTotalByYear" resultType="java.lang.Integer"> + select count(*) + from ( + select id + from task + where year(createdat) = #{year} + ) total + </select> + <select id="selectDataGridViewable" resultType="com.gk.hotwork.Domain.TaskInfo"> + select + task.id, + task.status, + task.unit, + task.department, + task.applicant, + task.code, + task.level, + task.area, + task.mode, + task.director, + task.starttime, + task.endtime, + task.othertask, + task.hazard, + task.supervisor, + task.profession, + task.partdirector, + task.approversupervisor, + task.approverprofession, + task.applyunitopinion, + task.constructionopinion, + task.relevantopinion, + task.securityopinion, + task.enterpriseopinion, + task.shiftleaderopinion, + task.applyunitname, + task.constructionname, + task.relevantname, + task.securityname, + task.enterprisename, + task.shiftleadername, + task.applyunittime, + task.constructiontime, + task.relevanttime, + task.securitytime, + task.enterprisetime, + task.shiftleadertime, + task.completedtime, + task.completedname, + task.completedconfirm, + task.createdat, + task.createdby, + task.modifiedat, + task.modifiedby, + task.flag, + task.isdel, + task.constructionunit, + task.securitydep, + task.isholiday, + task.analyst, + task.supervisoropinion, + task.content, + task.opinion, + task.path, + task.description, + task.isanalysis, + task.analysisarea, + task.analysismedium + from task + LEFT JOIN taskinvolvedep as tid on task.code = tid.taskcode + left join subtask on subtask.taskcode = task.code + <where> + task.isdel = 0 + <if test="condition.code != null and condition.code != ''"> + and task.code like concat('%',#{condition.code},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + and task.level = #{condition.level} + </if> + <if test="condition.status != null and condition.status != ''"> + and task.status = #{condition.status} + </if> + + <if test="condition.time != null and condition.time != ''"> + and task.starttime <= #{condition.time} + and task.endtime >= #{condition.time} + </if> + + <if test="condition.starttime != null and condition.starttime != ''"> + and task.starttime <= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.endtime >= #{condition.endtime} + </if> + <if test="condition.department != null and condition.department != ''"> + and task.department = #{condition.department} + </if> + <if test="condition.constructionunit != null and condition.constructionunit != ''"> + and task.level = #{condition.constructionunit} + </if> + <if test="condition.tasktype != null and condition.tasktype != ''"> + subtask.type = #{condition.tasktype} + </if> + <if test="condition.list != null and condition.list.size()>0"> + AND task.flag IN + <foreach item="item" index="index" collection="condition.list" open="(" close=")" separator=","> + #{item} + </foreach> + </if> + <if test="condition.applicant != null and condition.applicant != ''"> + and task.applicant = #{condition.applicant} + </if> + and(task.department = #{condition.department} and task.unit = #{condition.unit} + ) + or(tid.department = #{condition.department} and task.status in (4,5,6,7)) + or(task.securitydep = #{condition.department} and task.status in (5,6,7)) + or(task.constructionunit = #{condition.unit} and task.status in (2,3,4,5,6,7)) + or(task.constructionunit = #{condition.department} and task.status in (2,3,4,5,6,7)) + or 1 = #{condition.userType} + + </where> + group by task.code + </select> + <select id="getPendingTask" resultType="com.gk.hotwork.Domain.Vo.TaskVo"> + select + task.id, + task.status, + task.unit, + task.department, + task.applicant, + task.code, level, + task.area, + task.mode, + task.director, + task.starttime, + task.endtime, + task.othertask, + task.hazard, + task.supervisor, + task.profession, + task.partdirector, + task.approversupervisor, + task.approverprofession, + task.applyunitopinion, + task.constructionopinion, + task.relevantopinion, + task.securityopinion, + task.enterpriseopinion, + task.shiftleaderopinion, + task.applyunitname, + task.constructionname, + task.relevantname, + task.securityname, + task.enterprisename, + task.shiftleadername, + task.applyunittime, + task.constructiontime, + task.relevanttime, + task.securitytime, + task.enterprisetime, + task.shiftleadertime, + task.completedtime, + task.completedname, + task.completedconfirm, + task.createdat, + task.createdby, + task.modifiedat, + task.modifiedby, + task.flag, + task.isdel, + task.constructionunit, + task.securitydep, + task.isholiday, + task.analyst, + task.supervisoropinion, + task.content, + task.opinion, + task.description, + task.isanalysis, + task.analysisarea, + task.analysismedium + from task + LEFT JOIN taskinvolvedep as tid on task.`code` = tid.taskcode + left join taskworker as tw on task.`code` = tw.taskcode + <where> + task.isdel = 0 + and task.status = 7 + <if test="type != null and type == '1'.toString()"> + and tw.worker = #{name} + </if> + <if test="type != null and type == '2'.toString()"> + and task.approversupervisor = #{name} + </if> + <if test="type != null and type == '3'.toString()"> + and task.analyst = #{name} + </if> + </where> + group by task.code + order by task.createdat desc + </select> + <select id="getDoingTask" resultType="com.gk.hotwork.Domain.Vo.TaskVo"> + select + task.id, + task.status, + task.unit, + task.department, + task.applicant, + task.code, level, + task.area, + task.mode, + task.director, + task.starttime, + task.endtime, + task.othertask, + task.hazard, + task.supervisor, + task.profession, + task.partdirector, + task.approversupervisor, + task.approverprofession, + task.applyunitopinion, + task.constructionopinion, + task.relevantopinion, + task.securityopinion, + task.enterpriseopinion, + task.shiftleaderopinion, + task.applyunitname, + task.constructionname, + task.relevantname, + task.securityname, + task.enterprisename, + task.shiftleadername, + task.applyunittime, + task.constructiontime, + task.relevanttime, + task.securitytime, + task.enterprisetime, + task.shiftleadertime, + task.completedtime, + task.completedname, + task.completedconfirm, + task.createdat, + task.createdby, + task.modifiedat, + task.modifiedby, + task.flag, + task.isdel, + task.constructionunit, + task.securitydep, + task.isholiday, + task.analyst, + task.supervisoropinion, + task.content, + task.opinion, + task.description, + task.isanalysis, + task.analysisarea, + task.analysismedium + from task + LEFT JOIN taskinvolvedep as tid on task.`code` = tid.taskcode + left join taskworker as tw on task.`code` = tw.taskcode + <where> + task.isdel = 0 + and task.status = 7 + and task.flag = 4 + </where> + group by task.code + </select> + <select id="selectPageWorkTodayDetail" resultType="com.gk.hotwork.Domain.Vo.WorkShowTaskVo"> + select * + from ( + select + t1.unit, + t1.department, + t1.applicant, + t1.code, + t1.level, + t1.area, + t1.mode, + t1.director, + t1.starttime, + t1.endtime, + t1.othertask, + t1.hazard + from hotwork.task as t1 + where flag = #{params.flag} + and DATE(t1.endtime) >= CURDATE() + and DATE(t1.starttime) <= CURDATE() + and isdel = 0 + ) as a + + + </select> + <select id="selectCountWorkToday" resultType="java.lang.Integer"> + select count(0) + from hotwork.task as t1 + where t1.flag = #{flag} + and isdel = 0 + and DATE(t1.endtime) >= CURDATE() + and DATE(t1.starttime) <= CURDATE() + + </select> + <select id="selectCountDoneInPeriod" resultType="java.lang.Integer"> + select count(0) + from hotwork.task as t1 + where t1.status = #{status} + and isdel = 0 + and DATE(t1.createdat) >= DATE(#{startTime}) + + </select> + <select id="selectCountWorkEverydayInMonth" resultType="java.util.Map"> + + select + days.day, + ifnull(info.worknum,0) num + from + <foreach collection="days" item="item" open="(" close=")" separator="union all"> + SELECT date_sub(curdate(), interval #{item} day) as day + </foreach> + as days + left join( + select + date_format(t1.createdat,"%Y-%m-%d") day, + count(0) worknum + from hotwork.task as t1 + where t1.status = #{status} + and date(t1.createdat) >= #{startTime} + and isdel = 0 + group by DATE_FORMAT(t1.createdat,"%Y-%m-%d") + ) + as info on info.day = days.day + order by days.day + + + </select> + <select id="selectStatisticsData" resultType="com.gk.hotwork.Domain.Vo.TaskStatistics"> + SELECT + task.constructionunit, + subtask.type, + COUNT(*) as countNum + FROM + subtask + LEFT JOIN task ON task.`code` = subtask.taskcode + <where> + 1=1 + <if test="condition.starttime != null and condition.starttime != ''"> + and task.`createdat` >= #{condition.starttime} + </if> + <if test="condition.endtime != null and condition.endtime != ''"> + and task.`createdat` <= #{condition.endtime} + </if> + + <if test="condition.company != null and condition.company != ''"> + and task.constructionunit = #{condition.company} + </if> + + <if test="condition.type != null and condition.type != ''"> + and subtask.type = #{condition.type} + </if> + + <if test="condition.status != null "> + and task.status = #{condition.status} + </if> + + <if test="condition.flag != null "> + and task.flag = #{condition.flag} + </if> + </where> + GROUP BY + task.constructionunit, + subtask.type + </select> + <select id="selectDataGridTesting" resultType="com.gk.hotwork.Domain.TaskInfo"> + select + task.id, + task.status, + task.unit, + task.department, + task.applicant, + task.code, + task.level, + task.area, + task.mode, + task.director, + task.starttime, + task.endtime, + task.othertask, + task.hazard, + task.supervisor, + task.profession, + task.partdirector, + task.approversupervisor, + task.approverprofession, + task.applyunitopinion, + task.constructionopinion, + task.relevantopinion, + task.securityopinion, + task.enterpriseopinion, + task.shiftleaderopinion, + task.applyunitname, + task.constructionname, + task.relevantname, + task.securityname, + task.enterprisename, + task.shiftleadername, + task.applyunittime, + task.constructiontime, + task.relevanttime, + task.securitytime, + task.enterprisetime, + task.shiftleadertime, + task.completedtime, + task.completedname, + task.completedconfirm, + task.createdat, + task.createdby, + task.modifiedat, + task.modifiedby, + task.flag, + task.isdel, + task.constructionunit, + task.securitydep, + task.isholiday, + task.analyst, + task.supervisoropinion, + task.content, + task.opinion, + task.path, + task.description, + task.isanalysis, + task.analysisarea, + task.analysismedium + from task + <where> + task.isdel = 0 + and task.isanalysis = 1 + <if test="condition.searchflag != null and condition.searchflag == '0'.toString()"> + and task.status = 8 + </if> + <if test="condition.searchflag != null and condition.searchflag == '1'.toString()"> + and task.flag = 4 + </if> + <if test="condition.specificDepartment != null and condition.specificDepartment != ''"> + and task.department = #{condition.specificDepartment} + </if> + </where> + group by task.code + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInvolveDepartmentMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInvolveDepartmentMapper.xml new file mode 100644 index 0000000..64f43b0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskInvolveDepartmentMapper.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskInvolveDepartmentMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskInvolveDepartment" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="unit" property="unit" jdbcType="VARCHAR" /> + <result column="department" property="department" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="TINYINT" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="reviewedat" property="reviewedat" jdbcType="TIMESTAMP" /> + <result column="reviewedby" property="reviewedby" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, unit, department, status, content, reviewedat, reviewedby, createdat, + createdby, modifiedat, modifiedby, flag + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLocationInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLocationInfoMapper.xml new file mode 100644 index 0000000..02caf30 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLocationInfoMapper.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskLocationInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskLocationInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="taskworker" property="taskworker" jdbcType="VARCHAR" /> + <result column="longitude" property="longitude" jdbcType="VARCHAR" /> + <result column="latitude" property="latitude" jdbcType="VARCHAR" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, taskworker, longitude, latitude, updatetime + </sql> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLogMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLogMapper.xml new file mode 100644 index 0000000..4fab60e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskLogMapper.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskLogMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskLog" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="operator" property="operator" jdbcType="VARCHAR" /> + <result column="operationat" property="operationat" jdbcType="TIMESTAMP" /> + <result column="unit" property="unit" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskReviewMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskReviewMapper.xml new file mode 100644 index 0000000..5fcec0f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskReviewMapper.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskReviewMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskReview" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="task_id" property="taskId" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="reviewer" property="reviewer" jdbcType="VARCHAR" /> + <result column="reviewat" property="reviewat" jdbcType="TIMESTAMP" /> + <result column="isagree" property="isagree" jdbcType="TINYINT" /> + <result column="opinion" property="opinion" jdbcType="VARCHAR" /> + <result column="level" property="level" jdbcType="VARCHAR" /> + <result column="scenepic" property="scenepic" jdbcType="VARCHAR" /> + <result column="autograph" property="autograph" jdbcType="VARCHAR" /> + <result column="longitude" property="longitude" jdbcType="VARCHAR" /> + <result column="latitude" property="latitude" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id,task_id, taskcode, reviewer, reviewat, isagree, opinion, level, scenepic, autograph, longitude, + latitude, createdat, createdby, flag + </sql> + + <resultMap id="location_map" type="com.gk.hotwork.Domain.Vo.specTask.TaskLocation"> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="task_id" property="taskId" jdbcType="BIGINT"/> + <result column="taskcode" property="code" jdbcType="VARCHAR" /> + <result column="longitude" property="lon" jdbcType="VARCHAR" /> + <result column="latitude" property="lat" jdbcType="VARCHAR" /> + </resultMap> + + <select id="getTaskLocationListByTaskCodes" resultMap="location_map"> + select id,task_id,longitude,latitude from taskreview where + task_id in + <foreach collection="taskIdList" item="id" separator="," open="(" close=")"> + #{id} + </foreach> + and level = "申请人作业申请" + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskRiskMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskRiskMapper.xml new file mode 100644 index 0000000..22e83de --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskRiskMapper.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskRiskMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskRisk" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="environment" property="environment" jdbcType="VARCHAR" /> + <result column="preventive" property="preventive" jdbcType="VARCHAR" /> + <result column="emergency" property="emergency" jdbcType="VARCHAR" /> + <result column="other" property="other" jdbcType="VARCHAR" /> + <result column="director" property="director" jdbcType="VARCHAR" /> + <result column="taskdirector" property="taskdirector" jdbcType="VARCHAR" /> + <result column="confirmat" property="confirmat" jdbcType="DATE" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, content, environment, preventive, emergency, other, director, taskdirector, + confirmat, createdat, createdby, modifiedat, modifiedby, flag + </sql> + <select id="getByTaskCode" resultType="com.gk.hotwork.Domain.TaskRisk"> + select * + from taskrisk + where taskcode = #{taskCode} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskSecurityMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskSecurityMapper.xml new file mode 100644 index 0000000..707d72b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskSecurityMapper.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskSecurityMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskSecurity" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="sn" property="sn" jdbcType="INTEGER" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="checktype" property="checktype" jdbcType="VARCHAR" /> + <result column="checked" property="checked" jdbcType="TINYINT" /> + <result column="num" property="num" jdbcType="INTEGER" /> + <result column="confirmedby" property="confirmedby" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + <result column="tasktype" property="tasktype" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, sn, content, checked, num, confirmedby, createdat, createdby, modifiedat, + modifiedby, flag, checktype, tasktype + </sql> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskWorkerMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskWorkerMapper.xml new file mode 100644 index 0000000..74d7e4d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/TaskWorkerMapper.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.TaskWorkerMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.TaskWorker" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="unit" property="unit" jdbcType="VARCHAR" /> + <result column="worker" property="worker" jdbcType="VARCHAR" /> + <result column="branch" property="branch" jdbcType="VARCHAR" /> + <result column="number" property="number" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="modifiedat" property="modifiedat" jdbcType="TIMESTAMP" /> + <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, taskcode, unit, worker, branch, number, createdat, createdby, modifiedat, modifiedby, + flag + </sql> + <select id="getVoByTaskCode" resultType="com.gk.hotwork.Domain.Vo.TaskWorkerVo"> + select + taskworker.id, + taskworker.taskcode, + taskworker.unit, + taskworker.worker, + taskworker.branch, + taskworker.number, + taskworker.createdat, + taskworker.createdby, + taskworker.modifiedat, + taskworker.modifiedby, + taskworker.flag + from taskworker + left join taskequipmentbind on taskequipmentbind.updateby = taskworker.worker and taskequipmentbind.taskcode = #{code} + left join equipment on equipment.number = taskequipmentbind.equipmentnumber + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/UserFaceMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserFaceMapper.xml new file mode 100644 index 0000000..a8a8885 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserFaceMapper.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.UserFaceMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.UserFace" > + <!-- --> + <result column="userid" property="userid" jdbcType="BIGINT" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + <result column="code" property="code" jdbcType="LONGVARCHAR" /> + </resultMap> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml new file mode 100644 index 0000000..6553580 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.UserInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.UserInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="username" property="username" jdbcType="VARCHAR" /> + <result column="password" property="password" jdbcType="VARCHAR" /> + <result column="email" property="email" jdbcType="VARCHAR" /> + <result column="company" property="company" jdbcType="VARCHAR" /> + <result column="department" property="department" jdbcType="VARCHAR" /> + <result column="job" property="job" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + <result column="status" property="status" jdbcType="TINYINT" /> + <result column="expiredate" property="expiredate" jdbcType="TIMESTAMP" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="type" property="type" jdbcType="INTEGER" /> + <result column="realname" property="realname" jdbcType="VARCHAR" /> + <result column="idcard" property="idcard" jdbcType="VARCHAR" /> + <result column="iscompany" property="iscompany" jdbcType="TINYINT" /> + <result column="isdepartment" property="isdepartment" jdbcType="TINYINT" /> + <result column="isupload" property="isupload" jdbcType="TINYINT" /> + <result column="empno" property="empNo" jdbcType="VARCHAR" /> + <result column="deviceno" property="deviceNo" jdbcType="VARCHAR" /> + <result column="cardid" property="cardId" jdbcType="BIGINT" /> + <result column="crossx" property="crossX" jdbcType="DECIMAL" /> + <result column="crossy" property="crossY" jdbcType="DECIMAL" /> + <result column="updateat" property="updateat" jdbcType="TIMESTAMP" /> + <result column="issecurityofficer" property="issecurityofficer" jdbcType="TINYINT" /> + <result column="departmentname" property="departmentname" jdbcType="VARCHAR" /> + </resultMap> + + <resultMap id="UserVo" type="com.gk.hotwork.Domain.Vo.UserVo" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="username" property="username" jdbcType="VARCHAR" /> + <result column="password" property="password" jdbcType="VARCHAR" /> + <result column="email" property="email" jdbcType="VARCHAR" /> + <result column="company" property="company" jdbcType="VARCHAR" /> + <result column="department" property="department" jdbcType="VARCHAR" /> + <result column="job" property="job" jdbcType="VARCHAR" /> + <result column="createdby" property="createdby" jdbcType="VARCHAR" /> + <result column="createddate" property="createddate" jdbcType="TIMESTAMP" /> + <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" /> + <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" /> + <result column="status" property="status" jdbcType="TINYINT" /> + <result column="expiredate" property="expiredate" jdbcType="TIMESTAMP" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="type" property="type" jdbcType="INTEGER" /> + <result column="realname" property="realname" jdbcType="VARCHAR" /> + <result column="idcard" property="idcard" jdbcType="VARCHAR" /> + <result column="iscompany" property="iscompany" jdbcType="TINYINT" /> + <result column="isdepartment" property="isdepartment" jdbcType="TINYINT" /> + <result column="isupload" property="isupload" jdbcType="TINYINT" /> + <result column="ispass" property="ispass" jdbcType="TINYINT" /> + <result column="starttime" property="starttime" jdbcType="TIMESTAMP" /> + <result column="endtime" property="endtime" jdbcType="TIMESTAMP" /> + <result column="departmentname" property="departmentname" jdbcType="VARCHAR" /> + <result column="empno" property="empNo" jdbcType="VARCHAR" /> + <result column="deviceno" property="deviceNo" jdbcType="VARCHAR" /> + <result column="cardid" property="cardId" jdbcType="BIGINT" /> + <result column="crossx" property="crossX" jdbcType="DECIMAL" /> + <result column="crossy" property="crossY" jdbcType="DECIMAL" /> + <result column="issecurityofficer" property="issecurityofficer" jdbcType="TINYINT" /> + <result column="updateat" property="updateat" jdbcType="TIMESTAMP" /> + <association property="companyInfo" javaType="com.gk.hotwork.Domain.CompanyInfo"> + <result column="company_id" property="id" /> + <result column="company" property="company" /> + </association> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, username, password, email,company, department, job, createdby, + createddate, lastmodifiedby, lastmodifieddate,status, expiredate, isdel, type, + realname, idcard, iscompany, isdepartment, isupload, empno, deviceno, cardid,issecurityofficer + crossx, crossy, updateat + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from user + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from user + where id = #{id,jdbcType=BIGINT} + </delete> + <select id="selectUserDataGrid" resultMap="UserVo"> + SELECT + user.id, + user.username, + user.email, + c.company, + c.id company_id, + user.department, + user.job, + user.createdby, + user.createddate, + user.lastmodifiedby, + user.lastmodifieddate, + user.status, + user.expiredate, + user.isdel, + user.type, + user.realname, + user.idcard, + user.iscompany, + user.isdepartment, + user.isupload, + user.empno, + user.deviceno, + user.cardid, + user.crossx, + user.crossy, + user.updateat, + user.issecurityofficer, + d.department departmentname + FROM + `user` as user + left join company as c on c.id = user.companyid + left join department as d on d.id = user.department and d.isdel = 0 + <where> + `user`.status = 1 + and user.type != 1 + <if test="record.username != null and record.username !=''"> + and user.username like concat ('%',#{record.username,jdbcType=VARCHAR},'%') + </if> + <if test="record.realname != null and record.realname !=''"> + and user.realname like concat ('%',#{record.realname,jdbcType=VARCHAR},'%') + </if> + <if test="record.company != null and record.company !=''"> + and c.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%') + </if> + <if test="record.department != null and record.department !=''"> + and user.department like concat ('%',#{record.department,jdbcType=VARCHAR},'%') + </if> + <if test="record.isMain != null "> + and c.isMain = #{record.isMain} + </if> + </where> + </select> + + <select id="selectUserInfo" resultType="com.gk.hotwork.Domain.UserInfo"> + select user.*,d.department departmentname + from user as user + left join department as d on d.id = user.department and d.isdel = 0 + <where> + 1=1 + and user.status = 1 + <if test="id != null"> + and user.id != #{id} + </if> + <if test="username != null and username !=''"> + and user.username = #{username} + </if> + </where> + </select> + <select id="selectUserVoByName" resultType="com.gk.hotwork.Domain.Vo.UserVo"> + select + `user`.*, + c.ismain AS isMainCompany, + d.department departmentname + from `user` as user + LEFT JOIN company as c ON c.id = `user`.companyid + left join department as d on d.id = user.department and d.isdel = 0 + where + `user`.username = #{username,jdbcType=VARCHAR} + and `user`.status = 1 + </select> + <select id="selectByRealName" resultType="com.gk.hotwork.Domain.UserInfo"> + select user.*,d.department departmentname + from user as user + left join department as d on d.id = user.department and d.isdel = 0 + <where> + 1=1 + and user.status = 1 + <if test="id != null"> + and user.id != #{id} + </if> + <if test="realname != null and realname !=''"> + and user.realname = #{realname} + </if> + </where> + </select> + + <select id="getByRealName" resultType="com.gk.hotwork.Domain.UserInfo"> + select user.*,d.department departmentname + from user as user + left join department as d on d.id = user.department and d.isdel = 0 + where user.realname = #{realname} + and d.department = #{depName} + and user.isdel = 0 + </select> + + <select id="selectByIdCard" resultType="com.gk.hotwork.Domain.UserInfo"> + select user.*,d.department departmentname + from user as user + left join department as d on d.id = user.department and d.isdel = 0 + <where> + 1=1 + and user.status = 1 + <if test="id != null"> + and user.id != #{id} + </if> + <if test="idcard != null and idcard !=''"> + and user.idcard = #{idcard} + </if> + </where> + </select> + <select id="selectNotUpload" resultType="com.gk.hotwork.Domain.UserInfo"> + select user.*,d.department departmentname + from user as user + left join department as d on d.id = user.department and d.isdel = 0 + where + user.status = 1 + and user.isupload = 0 + and user.type = 3 + </select> + <select id="selectAll" resultType="com.gk.hotwork.Domain.Vo.UserVo"> + SELECT + `user`.*,d.department departmentname + FROM + `user` as user + left join company as c on c.id = user.companyid and c.isdel = 0 + left join department as d on d.id = user.department and d.isdel = 0 + <where> + `user`.status = 1 + and user.type != 1 + <if test="record.company != null and record.company !=''"> + and c.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%') + </if> + <if test="record.department != null and record.department !=''"> + and d.department like concat ('%',#{record.department,jdbcType=VARCHAR},'%') + </if> + </where> + </select> + + <select id="getUserList" resultType="com.gk.hotwork.Domain.Vo.UserVo"> + SELECT + `user`.*,d.department departmentname,u.roleid + FROM + `user` as user + left join department as d on d.id = user.department and d.isdel = 0 + left join userroles as u on user.id = u.userid + where + user.status = 1 + and user.type != 1 + </select> + <select id="selectCountForExam" parameterType="java.util.Map" resultType="java.lang.Integer"> + select count(0) + from user as user + left join company as c on c.id = user.companyid and c.isdel = 0 + left join department as d on d.id = user.department and d.isdel = 0 + where + user.status = 1 + and user.type != 1 + <if test="name != null and name != ''"> + and user.realname like concat("%",#{name},"%") + </if> + <if test="department != null and department != ''"> + and d.department like concat("%",#{department},"%") + </if> + <if test="company != null and company != ''"> + and c.company like concat("%",#{company},"%") + </if> + <if test="idno != null and idno != ''"> + and user.idcard like concat("%",#{idno},"%") + </if> + <if test="tel != null and tel != ''"> + and user.username like concat("%",#{tel},"%") + </if> + </select> + <select id="selectPageForExam" parameterType="java.util.Map" resultMap="BaseResultMap"> + + select user.*,d.department departmentname + from user as user + left join company as c on c.id = user.companyid and c.isdel = 0 + left join department as d on d.id = user.department and d.isdel = 0 + where + status = 1 + and type != 1 + <if test="name != null and name != ''"> + and user.realname like concat("%",#{name},"%") + </if> + <if test="department != null and department != ''"> + and d.department like concat("%",#{department},"%") + </if> + <if test="company != null and company != ''"> + and c.company like concat("%",#{company},"%") + </if> + <if test="idno != null and idno != ''"> + and user.idcard like concat("%",#{idno},"%") + </if> + <if test="tel != null and tel != ''"> + and user.username like concat("%",#{tel},"%") + </if> + order by createddate desc + <if test="first != null and pageSize != null"> + limit #{first},#{pageSize} + </if> + </select> + + <select id="getAccountByDepartment" resultType="com.gk.hotwork.Domain.Vo.AccountUserVo"> + select + `username`,password + from + account_user + <where> + <if test="department != null and department != ''"> + department = #{department} + </if> + </where> + order by + RAND() + LIMIT 1 + </select> + + <!--UserInfo getUserByRealName(String trim);--> + <select id="getUserByRealName" resultType="com.gk.hotwork.Domain.UserInfo"> + select * from user where isdel = 0 and realname = #{trim} + limit 1 + </select> + +<!-- UserInfo getUserByRealNameAndDep(String name, String dep);--> + <select id="getUserByRealNameAndDep" resultType="com.gk.hotwork.Domain.UserInfo"> + select * from user where isdel = 0 and realname = #{name} and department = #{dep} + </select> + + + <select id="getAccountByUsername" resultType="com.gk.hotwork.Domain.Vo.AccountUserVo"> + select + `username`, password + from + account_user + <where> + <if test="username != null and username != ''"> + `username` = #{username} + </if> + </where> + </select> + + <!--UserInfo getByUserId(Long userId);--> + <select id="getByUserId" resultMap="BaseResultMap"> + select * from user where id = #{userId} + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/UserRolesInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserRolesInfoMapper.xml new file mode 100644 index 0000000..2781ffd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserRolesInfoMapper.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.UserRolesInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.UserRolesInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="userid" property="userid" jdbcType="BIGINT" /> + <result column="roleid" property="roleid" jdbcType="BIGINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, userid, roleid + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from userroles + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from userroles + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteByUserId"> + delete from userroles + where userid = #{userid,jdbcType=BIGINT} + </delete> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.UserRolesInfo" > + <!-- --> + update userroles + <set > + <if test="userid != null" > + userid = #{userid,jdbcType=BIGINT}, + </if> + <if test="roleid != null" > + roleid = #{roleid,jdbcType=BIGINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.UserRolesInfo" > + <!-- --> + update userroles + set userid = #{userid,jdbcType=BIGINT}, + roleid = #{roleid,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/VideoInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/VideoInfoMapper.xml new file mode 100644 index 0000000..8d592f0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/VideoInfoMapper.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.VideoInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.VideoInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="appkey" property="appkey" jdbcType="VARCHAR" /> + <result column="secret" property="secret" jdbcType="VARCHAR" /> + <result column="token" property="token" jdbcType="VARCHAR" /> + <result column="expiretime" property="expiretime" jdbcType="TIMESTAMP" /> + <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, appkey, secret, token, expiretime, updatetime + </sql> + <select id="selectByTime" resultType="com.gk.hotwork.Domain.VideoInfo"> + select * + from video + where expiretime <= #{endtime} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/WarningInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/WarningInfoMapper.xml new file mode 100644 index 0000000..6a62ec4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/WarningInfoMapper.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.WarningInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.WarningInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="type" property="type" jdbcType="VARCHAR" /> + <result column="content" property="content" jdbcType="VARCHAR" /> + <result column="createdat" property="createdat" jdbcType="TIMESTAMP" /> + <result column="taskcode" property="taskcode" jdbcType="VARCHAR" /> + <result column="worker" property="worker" jdbcType="VARCHAR" /> + <result column="isdeal" property="isdeal" jdbcType="TINYINT" /> + <result column="dealat" property="dealat" jdbcType="TIMESTAMP" /> + <result column="dealby" property="dealby" jdbcType="VARCHAR" /> + <result column="flag" property="flag" jdbcType="TINYINT" /> + <result column="issms" property="issms" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, type, content, createdat, taskcode, worker, isdeal, dealat, dealby, flag, issms, tasktype + </sql> + <select id="selectTaskDataGrid" resultType="com.gk.hotwork.Domain.WarningInfo"> + select * + from warning + <where> + tasktype = '动火作业' + <if test="condition.code != null and condition.code != ''"> + and taskcode like concat('%',#{condition.code},'%') + </if> + <if test="condition.isDeal != null and condition.isDeal != ''"> + and isdeal = #{condition.isDeal} + </if> + <if test="condition.type != null and condition.type != ''"> + and type = #{condition.type} + </if> + <if test="condition.startTime != null and condition.startTime != ''"> + and createdat >= #{condition.startTime} + </if> + <if test="condition.endTime != null and condition.endTime != ''"> + and createdat <= #{condition.endTime} + </if> + </where> + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/WorkCertInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/WorkCertInfoMapper.xml new file mode 100644 index 0000000..38ad541 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/WorkCertInfoMapper.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.Mapper.WorkCertInfoMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.WorkCertInfo" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="realname" property="realname" jdbcType="VARCHAR" /> + <result column="mobile" property="mobile" jdbcType="VARCHAR" /> + <result column="idcard" property="idcard" jdbcType="VARCHAR" /> + <result column="certname" property="certname" jdbcType="VARCHAR" /> + <result column="certpath" property="certpath" jdbcType="VARCHAR" /> + <result column="starttime" property="starttime" jdbcType="TIMESTAMP" /> + <result column="endtime" property="endtime" jdbcType="TIMESTAMP" /> + <result column="createby" property="createby" jdbcType="VARCHAR" /> + <result column="createtime" property="createtime" jdbcType="TIMESTAMP" /> + <result column="isdel" property="isdel" jdbcType="TINYINT" /> + <result column="branch" property="branch" jdbcType="VARCHAR" /> + <result column="ishealth" property="ishealth" jdbcType="TINYINT" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, realname, mobile, idcard, certname, certpath, starttime, endtime, createby, createtime, + isdel, branch, ishealth + </sql> + <select id="selectByMobile" resultType="com.gk.hotwork.Domain.WorkCertInfo"> + select * + from workcert + where isdel = 0 + and mobile = #{mobile} + order by createtime desc + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemMeasureMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemMeasureMapper.xml new file mode 100644 index 0000000..7bb0853 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemMeasureMapper.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleItemMeasureRepository" > + <resultMap id="measureResultMap" type="com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasure" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="work_type" property="workType" jdbcType="TINYINT"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="correct_val" property="correctVal" jdbcType="TINYINT"/> + <result column="context" property="context" jdbcType="VARCHAR"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + + <resultMap id="ApprovalRuleItemMeasureDO" type="com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasureDO" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="work_type" property="workType" jdbcType="TINYINT"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="correct_val" property="correctVal" jdbcType="TINYINT"/> + <result column="context" property="context" jdbcType="VARCHAR"/> + </resultMap> + + + <select id="listByConditions" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery" + resultMap="measureResultMap"> + select + id, + work_type, + type, + correct_val, + context, + status, + gmt_create, + create_uname, + create_uid, + gmt_modified, + modified_uname, + modified_uid + from approval_rule_item_measure + <where> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.workType != null"> + and work_type = #{query.workType} + </if> + <if test="query.type != null"> + and type = #{query.type} + </if> + <if test="query.context != null and query.context != ''"> + and context like concat("%",#{query.context},"%") + </if> + </where> + </select> + <!--删除-单条--> + <update id="updateStatusById" > + update approval_rule_item_measure + set status = #{status} + where + id = #{id} + </update> + <!--删除-批量--> + <update id="updateStatusByIds" > + update approval_rule_item_measure + set status = #{status} + where + id in + <foreach collection="ids" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + + <select id="listMeasureId" resultType="java.lang.Long"> + select id from approval_rule_item_measure where status = #{status} + </select> + <select id="listItemMeasureByIds" + parameterType="long" + resultMap="ApprovalRuleItemMeasureDO"> + select + measure.id, + measure.work_type, + measure.type, + measure.correct_val, + measure.context, + measure.status + from approval_rule_item_measure as measure + where measure.id in + <foreach collection="measureIds" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemStandMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemStandMapper.xml new file mode 100644 index 0000000..88a8746 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleItemStandMapper.xml @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleItemStandRepository" > + <resultMap id="ApprovalRuleItemStand" type="com.gk.hotwork.specialWork.entity.ApprovalRuleItemStand" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="eid" property="eid" jdbcType="BIGINT"/> + <result column="dep_id" property="depId" jdbcType="BIGINT"/> + <result column="min_val" property="minVal" jdbcType="DECIMAL"/> + <result column="min_val_match_pattern" property="minValMatchPattern" jdbcType="TINYINT"/> + <result column="max_val" property="maxVal" jdbcType="DECIMAL"/> + <result column="max_val_match_pattern" property="maxValMatchPattern" jdbcType="TINYINT"/> + <result column="title" property="title" jdbcType="VARCHAR"/> + <result column="info" property="info" jdbcType="VARCHAR"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + + + <resultMap id="ApprovalRuleItemStandDO" type="com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="eid" property="eid" jdbcType="BIGINT"/> + <result column="dep_id" property="depId" jdbcType="BIGINT"/> + <result column="min_val" property="minVal" jdbcType="DECIMAL"/> + <result column="min_val_match_pattern" property="minValMatchPattern" jdbcType="TINYINT"/> + <result column="max_val" property="maxVal" jdbcType="DECIMAL"/> + <result column="max_val_match_pattern" property="maxValMatchPattern" jdbcType="TINYINT"/> + <result column="title" property="title" jdbcType="VARCHAR"/> + <result column="info" property="info" jdbcType="VARCHAR"/> + <result column="status" property="status" jdbcType="TINYINT"/> + </resultMap> + <update id="updateStatusBatch" + parameterType="com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO"> + update + approval_rule_item_stand + <set> + status = #{status}, + gmt_modified = #{gmtModified}, + modified_uid = #{modifiedUid}, + modified_uname = #{modifiedUname}, + </set> + where id in + <foreach collection="ids" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + + </update> + + + <select id="getRuleStandDOById" + resultMap="ApprovalRuleItemStandDO"> + select + ruleItemStand.id, + ruleItemStand.type, + ruleItemStand.eid, + ruleItemStand.dep_id, + ruleItemStand.min_val, + ruleItemStand.min_val_match_pattern, + ruleItemStand.max_val, + ruleItemStand.max_val_match_pattern, + ruleItemStand.title, + ruleItemStand.info, + ruleItemStand.status + from approval_rule_item_stand as ruleItemStand + where ruleItemStand.id = #{ruleStandId} and ruleItemStand.status = #{status} + </select> + <select id="listRuleStandDO" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandListDBQuery" + resultMap="ApprovalRuleItemStandDO"> + + select + ruleItemStand.id, + ruleItemStand.type, + ruleItemStand.eid, + ruleItemStand.dep_id, + ruleItemStand.min_val, + ruleItemStand.min_val_match_pattern, + ruleItemStand.max_val, + ruleItemStand.max_val_match_pattern, + ruleItemStand.title, + ruleItemStand.info, + ruleItemStand.status + from approval_rule_item_stand as ruleItemStand + <where> + <if test="query.status != null"> + and ruleItemStand.status = #{query.status} + </if> + <if test="query.title != null and query.title != ''"> + and ruleItemStand.title like concat("%",#{query.title},"%") + </if> + <if test="query.ruleStandType != null"> + and ruleItemStand.type = #{query.ruleStandType} + </if> + </where> + + + </select> + <select id="listRuleStandByPage" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandPageDBQuery" + resultMap="ApprovalRuleItemStand"> + + select + ruleItemStand.id, + ruleItemStand.type, + ruleItemStand.eid, + ruleItemStand.dep_id, + ruleItemStand.min_val, + ruleItemStand.min_val_match_pattern, + ruleItemStand.max_val, + ruleItemStand.max_val_match_pattern, + ruleItemStand.title, + ruleItemStand.info, + ruleItemStand.status, + ruleItemStand.gmt_create, + ruleItemStand.create_uname, + ruleItemStand.create_uid, + ruleItemStand.gmt_modified, + ruleItemStand.modified_uname, + ruleItemStand.modified_uid + from approval_rule_item_stand as ruleItemStand + <where> + <if test="query.status != null"> + and ruleItemStand.status = #{query.status} + </if> + <if test="query.title != null and query.title != ''"> + and ruleItemStand.title like concat("%",#{query.title},"%") + </if> + <if test="query.ruleStandType != null"> + and ruleItemStand.type = #{query.ruleStandType} + </if> + </where> + </select> + + <select id="listStandId" resultType="java.lang.Long"> + select + id + from approval_rule_item_stand + where status = #{status} + </select> + <select id="listItemStandByIds" + parameterType="long" + resultMap="ApprovalRuleItemStandDO"> + select + ruleItemStand.id, + ruleItemStand.type, + ruleItemStand.eid, + ruleItemStand.dep_id, + ruleItemStand.min_val, + ruleItemStand.min_val_match_pattern, + ruleItemStand.max_val, + ruleItemStand.max_val_match_pattern, + ruleItemStand.title, + ruleItemStand.info, + ruleItemStand.status + from approval_rule_item_stand as ruleItemStand + where ruleItemStand.id in + <foreach collection="standIds" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleMapper.xml new file mode 100644 index 0000000..3a95e3a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleMapper.xml @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleRepository" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.specialWork.entity.ApprovalRule" > + <id column="rule_id" property="ruleId" jdbcType="BIGINT" /> + <result column="eid" property="eid" jdbcType="BIGINT"/> + <result column="dep_id" property="depId" jdbcType="BIGINT"/> + <result column="rule_name" property="ruleName" jdbcType="VARCHAR"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="work_type" property="workType" jdbcType="TINYINT"/> + <result column="work_level" property="workLevel" jdbcType="TINYINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + + </resultMap> + <sql id="all_Column_List" > + rule_id,rule_name,eid,dep_id,status,work_type,work_level,gmt_create,gmt_modified,create_uid,create_uname,modified_uid,modified_uname + </sql> + <sql id="base_table_name">approval_rule</sql> + <insert id="insertRuleInfo" + parameterType="com.gk.hotwork.specialWork.entity.ApprovalRule"> + insert + into approval_rule + <trim prefix="(" suffix=") values" suffixOverrides=","> + <if test="ruleId != null"> + rule_id, + </if> + <if test="eid != null"> + eid, + </if> + <if test="depId != null"> + dep_id, + </if> + <if test="ruleName != null"> + rule_name, + </if> + <if test="status != null"> + status, + </if> + <if test="workType != null"> + work_type, + </if> + <if test="workLevel != null"> + work_level, + </if> + <if test="gmtCreate != null"> + gmt_create, + </if> + <if test="createUid != null"> + create_uid, + </if> + <if test="createUname != null"> + create_uname, + </if> + </trim> + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="ruleId != null"> + #{ruleId}, + </if> + <if test="eid != null"> + #{eid}, + </if> + <if test="depId != null"> + #{depId}, + </if> + <if test="ruleName != null"> + #{ruleName}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="workType != null"> + #{workType}, + </if> + <if test="workLevel != null"> + #{workLevel}, + </if> + <if test="gmtCreate != null"> + #{gmtCreate}, + </if> + <if test="createUid != null"> + #{createUid}, + </if> + <if test="createUname != null"> + #{createUname}, + </if> + </trim> + + + </insert> + <select id="listByConditions" resultMap="BaseResultMap" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + <where> + <if test="query.eid != null and query.eid > 0"> + and eid = #{query.eid} + </if> + <if test="query.depId != null and query.depId > 0"> + and dep_id = #{query.depId} + </if> + <if test="query.workType != null and query.workType > 0"> + and work_type = #{query.workType} + </if> + <if test="query.workLevel != null and query.workLevel > 0"> + and work_Level = #{query.workLevel} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.createUid != null and query.createUid > 0"> + and create_uid = #{query.createUid} + </if> + <if test="query.createUname != null and query.createUname != ''"> + and create_uname like concat("%",#{query.createUname},"%") + </if> + <if test="query.ruleName != null and query.ruleName != ''"> + and rule_name like concat("%",#{query.ruleName},"%") + </if> + </where> + </select> + <!--批量删除规则--> + <update id="updateStutsByRuleIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id in + <foreach collection="ruleIds" item="ruleId" open="(" close=")" separator=","> + #{ruleId} + </foreach> + </update> + + <update id="updateStutsByRuleId"> + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id = #{ruleId} + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleStepMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleStepMapper.xml new file mode 100644 index 0000000..1488fd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleStepMapper.xml @@ -0,0 +1,262 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleStepRepository" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.specialWork.entity.ApprovalRuleStep" > + <id column="step_id" property="stepId" jdbcType="BIGINT" /> + <result column="rule_id" property="ruleId" jdbcType="BIGINT"/> + <result column="step_name" property="stepName" jdbcType="VARCHAR"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="step_serial" property="stepSerial" jdbcType="INTEGER"/> + <result column="enable_order" property="enableOrder" jdbcType="BOOLEAN"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="continue_time" property="continueTime" jdbcType="INTEGER"/> + <result column="continue_time_unit" property="continueTimeUnit" jdbcType="TINYINT"/> + <result column="pre_step_id" property="preStepId" jdbcType="BIGINT"/> + <result column="next_step_id" property="nextStepId" jdbcType="BIGINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + + </resultMap> + <sql id="all_Column_List" > + <!-- --> + step_id,rule_id,step_name,status,step_serial,enable_order,type,continue_time,continue_time_unit,pre_step_id,next_step_id,gmt_create,gmt_modified,create_uid,create_uname,modified_uname,modified_uid + </sql> + <sql id="base_table_name">approval_rule_step</sql> + <select id="listByConditions" resultMap="BaseResultMap" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStepListDbQuery"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + <where> + <if test="query.ruleId != null and query.ruleId > 0"> + and rule_id = #{query.ruleId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.type != null"> + and type = #{query.type} + </if> + <if test="query.stepName != null and query.stepName != ''"> + and step_name like concat('%',#{query.stepName},'%') + </if> + </where> + </select> + + <select id="listByRuleId" resultMap="BaseResultMap"> + select step_id,rule_id,step_name,status,step_serial,enable_order,type,continue_time,continue_time_unit,pre_step_id,next_step_id from <include refid="base_table_name"></include> + where rule_id = #{ruleId} and status = #{status} order by step_serial asc + </select> + + + <!--批量删除层级-根据主键--> + <update id="updateStatusByStepIds" > + update <include refid="base_table_name"></include> + set status = #{status} + where + step_id in + <foreach collection="stepIds" item="stepId" open="(" close=")" separator=","> + #{stepId} + </foreach> + </update> + <!--删除层级-单挑--> + <update id="updateStatusByStepId" > + update <include refid="base_table_name"></include> + set status = #{status} + where + step_id = #{stepId} + </update> + + <!--批量删除层级-根据规则ids--> + <update id="updateStatusByRuleIds" > + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id in + <foreach collection="ruleIds" item="ruleId" open="(" close=")" separator=","> + #{ruleId} + </foreach> + </update> + + <!--删除层级-根据规则id--> + <update id="updateStatusByRuleId" > + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id = #{ruleId} + </update> + + <select id="getStepById" resultMap="BaseResultMap"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + where step_id = #{stepId} and status = #{status} + </select> + + <!--批量删除层级-根据规则ids--> + <update id="updateStatusByRuleIdAndNotInIds" > + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id = #{ruleId} + and step_id not in + <foreach collection="idList" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + <!--根据规则获取层级id集合--> + <select id="listStepIdByRuleId" resultType="java.lang.Long"> + select step_id from <include refid="base_table_name"></include> + where rule_id = #{ruleId} and status = #{status} + </select> + + <update id="updateStepAndEmptyPreStepId" + parameterType="com.gk.hotwork.specialWork.entity.ApprovalRuleUnit" > + update + approval_rule_step + <trim suffixOverrides=","> + <if test="ruleId != null"> + set rule_id = #{ruleId}, + </if> + <if test="stepName != null and stepName != '' "> + step_name = #{stepName}, + </if> + <if test="status != null"> + status = #{status}, + </if> + <if test="stepSerial != null"> + step_serial = #{stepSerial}, + </if> + <if test="enableOrder != null"> + enable_order = #{enableOrder}, + </if> + <if test="type != null"> + type = #{type}, + </if> + <if test="continueTime != null"> + continue_time = #{continueTime}, + </if> + <if test="continueTime != null"> + continue_time_unit = #{continueTime}, + </if> + + pre_step_id = null, + + <if test="nextStepId != null"> + next_step_id = #{nextStepId}, + </if> + <if test="modifiedUname != null"> + modified_uname = #{modifiedUname}, + </if> + <if test="gmtModified != null"> + gmt_modified = #{gmtModified}, + </if> + <if test="modifiedUid != null"> + modified_uid = #{modifiedUid}, + </if> + </trim> + where step_id = #{stepId} + </update> + + <update id="updateBatchStep" parameterType="java.util.List"> + <foreach collection="list" item="step" index="index" open="" close="" separator=";"> + update approval_rule_step + <set> + <if test="step.ruleId != null"> + rule_id = #{step.ruleId}, + </if> + <if test="step.stepName != null and step.stepName != '' "> + step_name = #{step.stepName}, + </if> + <if test="step.status != null"> + status = #{step.status}, + </if> + <if test="step.stepSerial != null"> + step_serial = #{step.stepSerial}, + </if> + <if test="step.enableOrder != null"> + enable_order = #{step.enableOrder}, + </if> + <if test="step.type != null"> + type = #{step.type}, + </if> + <if test="step.continueTime != null"> + continue_time = #{step.continueTime}, + </if> + <if test="step.continueTimeUnit != null"> + continue_time_unit = #{step.continueTimeUnit}, + </if> + <if test="step.preStepId == null"> + pre_step_id = null, + </if> + <if test="step.preStepId != null"> + pre_step_id = #{step.preStepId}, + </if> + <if test="step.nextStepId != null"> + next_step_id = #{step.nextStepId}, + </if> + <if test="step.modifiedUname != null"> + modified_uname = #{step.modifiedUname}, + </if> + <if test="step.gmtModified != null"> + gmt_modified = #{step.gmtModified}, + </if> + <if test="step.modifiedUid != null"> + modified_uid = #{step.modifiedUid}, + </if> + <if test="step.auditType != null"> + audit_type = #{step.auditType}, + </if> + </set> + where step_id = #{step.stepId} + </foreach> + + </update> + + <insert id="saveStepList" > + insert into + approval_rule_step + <trim prefix="(" suffix=") values" suffixOverrides=","> + step_id, + step_name, + rule_id, + status, + step_serial, + enable_order, + type, + continue_time, + continue_time_unit, + pre_step_id, + next_step_id, + gmt_create, + gmt_modified, + create_uid, + create_uname, + modified_uid, + modified_uname, + audit_type + </trim> + <foreach collection="list" item="stand" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{stand.stepId}, + #{stand.stepName}, + #{stand.ruleId}, + #{stand.status}, + #{stand.stepSerial}, + #{stand.enableOrder}, + #{stand.type}, + #{stand.continueTime}, + #{stand.continueTimeUnit}, + #{stand.preStepId}, + #{stand.nextStepId}, + #{stand.gmtCreate}, + #{stand.gmtModified}, + #{stand.createUid}, + #{stand.createUname}, + #{stand.modifiedUid}, + #{stand.modifiedUname}, + #{stand.auditType} + </trim> + </foreach> + </insert> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitItemMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitItemMapper.xml new file mode 100644 index 0000000..191f827 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitItemMapper.xml @@ -0,0 +1,380 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleUnitItemRepository" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="rule_id" property="ruleId" jdbcType="BIGINT"/> + <result column="item_name" property="itemName" jdbcType="VARCHAR"/> + <result column="step_id" property="stepId" jdbcType="BIGINT"/> + <result column="unit_id" property="unitId" jdbcType="BIGINT"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="stand_id" property="standId" jdbcType="BIGINT"/> + <result column="measure_id" property="measureId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + + <resultMap id="ApprovalRuleUnitItemDO" type="com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItemDO" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="rule_id" property="ruleId" jdbcType="BIGINT"/> + <result column="item_name" property="itemName" jdbcType="VARCHAR"/> + <result column="step_id" property="stepId" jdbcType="BIGINT"/> + <result column="unit_id" property="unitId" jdbcType="BIGINT"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="measure_id" property="measureId" jdbcType="BIGINT"/> + <result column="stand_id" property="standId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + </resultMap> + + <resultMap id="ApprovalRuleUnitItem" type="com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="rule_id" property="ruleId" jdbcType="BIGINT"/> + <result column="item_name" property="itemName" jdbcType="VARCHAR"/> + <result column="step_id" property="stepId" jdbcType="BIGINT"/> + <result column="unit_id" property="unitId" jdbcType="BIGINT"/> + <result column="type" property="type" jdbcType="TINYINT"/> + <result column="stand_id" property="standId" jdbcType="BIGINT"/> + <result column="measure_id" property="measureId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + + <sql id="all_Column_List" > + <!-- --> + id,item_name,rule_id,step_id,unit_id,type,stand_id,measure_id,status,gmt_create,create_uname,create_uid,gmt_modified,modified_uname,modified_uid + </sql> + <sql id="insert_columns" > + <!-- --> + (id,rule_id,item_name,step_id,unit_id,type,stand_id,measure_id,status,gmt_create,create_uname,create_uid,gmt_modified,modified_uname,modified_uid) + </sql> + <sql id="base_table_name">approval_rule_item</sql> + + <insert id="batchInsert"> + insert into approval_rule_item <include refid="insert_columns"></include> values + <foreach collection="itemList" item="item" index="index" separator=","> + (#{item.id},#{item.ruleId},#{item.itemName},#{item.stepId},#{item.unitId},#{item.type},#{item.standId},#{item.measureId},#{item.status},#{item.gmtCreate},#{item.createUname},#{item.createUid},#{item.gmtModified},#{item.modifiedUname},#{item.modifiedUid}) + </foreach> + </insert> + <insert id="insertRuleItem" + parameterType="com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem" > + insert + into approval_rule_item + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="itemName != null and itemName != ''"> + item_name, + </if> + <if test="type != null"> + type, + </if> + <if test="standId != null"> + stand_id, + </if> + <if test="measureId != null"> + measure_id, + </if> + <if test="status != null"> + status, + </if> + <if test="gmtCreate != null"> + gmt_create, + </if> + <if test="createUname != null"> + create_uname, + </if> + <if test="createUid != null"> + create_uid, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="itemName != null and itemName != ''"> + #{itemName}, + </if> + <if test="type != null"> + #{type}, + </if> + <if test="standId != null"> + #{standId}, + </if> + <if test="measureId != null"> + #{measureId}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="gmtCreate != null"> + #{gmtCreate}, + </if> + <if test="createUname != null"> + #{createUname}, + </if> + <if test="createUid != null"> + #{createUid}, + </if> + </trim> + + + + </insert> + + + <select id="listActiveByRuleId" resultMap="BaseResultMap"> + select id,item_name,rule_id,step_id,unit_id,type,stand_id,measure_id from <include refid="base_table_name"></include> + where + rule_id = #{ruleId} and status = #{status} + </select> + + <select id="listActiveByRuleStepId" resultMap="BaseResultMap"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + where + step_id = #{stepId} and status = #{status} + </select> + + <!--根据standIds查询--> + <select id="listActiveByRuleStandId" resultMap="BaseResultMap"> + select <include refid="all_Column_List"></include> + from <include refid="base_table_name"></include> + <where> + status = #{status} + and stand_id in + <foreach collection="standIdList" item="standId" open="(" close=")" separator=","> + #{standId} + </foreach> + </where> + </select> + <select id="getApprovalRuleUnitItemDOById" + parameterType="long" + resultMap="ApprovalRuleUnitItemDO"> + select + ruleItem.id, + ruleItem.item_name, + ruleItem.rule_id, + ruleItem.step_id, + ruleItem.unit_id, + ruleItem.type, + ruleItem.stand_id, + ruleItem.status + from approval_rule_item as ruleItem + where ruleItem.id = #{ruleItemId} + + </select> + <select id="listRuleItemByPage" + parameterType="com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemPageDBQuery" + resultMap="ApprovalRuleUnitItem"> + + select + ruleItem.id, + ruleItem.item_name, + ruleItem.rule_id, + ruleItem.step_id, + ruleItem.unit_id, + ruleItem.type, + ruleItem.stand_id, + ruleItem.status, + ruleItem.create_uid, + ruleItem.create_uname, + ruleItem.gmt_create, + ruleItem.modified_uid, + ruleItem.modified_uname, + ruleItem.gmt_modified + from approval_rule_item as ruleItem + <where> + <if test="query.status != null"> + ruleItem.status = #{query.status} + </if> + <if test="query.itemName != null and query.itemName != ''"> + ruleItem.item_name like concat("%",#{query.itemName},"%") + </if> + <if test="query.type != null"> + ruleItem.type = #{type} + </if> + </where> + + + </select> + <select id="listRuleItemDO" + + resultMap="ApprovalRuleUnitItemDO"> + select + ruleItem.id, + ruleItem.item_name, + ruleItem.rule_id, + ruleItem.step_id, + ruleItem.unit_id, + ruleItem.type, + ruleItem.stand_id, + ruleItem.status + from approval_rule_item as ruleItem + <where> + <if test="query.status != null"> + ruleItem.status = #{query.status} + </if> + <if test="query.itemName != null and query.itemName != ''"> + ruleItem.item_name like concat("%",#{query.itemName},"%") + </if> + <if test="query.type != null"> + ruleItem.type = #{type} + </if> + </where> + </select> + + <!--根据审批项itemIds 批量删除--> + <update id="updateStatusByIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + id in + <foreach collection="ids" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + <!--根据审批项itemId 删除--> + <update id="updateStatusById"> + update <include refid="base_table_name"></include> + set status = #{status} + where + id = #{id} + </update> + + <!--根据层级stepIds 批量删除--> + <update id="updateStatusByStepIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + step_id in + <foreach collection="stepIds" item="stepId" open="(" close=")" separator=","> + #{stepId} + </foreach> + </update> + <!--根据单元层级stepId 删除--> + <update id="updateStatusByStepId"> + update <include refid="base_table_name"></include> + set status = #{status} + where + stand_id = #{stepId} + </update> + + <!--根据规则ids 批量删除--> + <update id="updateStatusByRuleIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id in + <foreach collection="ruleIds" item="ruleId" open="(" close=")" separator=","> + #{ruleId} + </foreach> + </update> + + <!--根据规则id 删除--> + <update id="updateStatusByRuleId"> + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id = #{ruleId} + </update> + <update id="updateRuleItem" + parameterType="com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem" > + update approval_rule_item + <set> + <if test="itemName != null and itemName != ''"> + item_name = #{itemName}, + </if> + <if test="type != null"> + type = #{type}, + </if> + <if test="standId != null"> + stand_id = #{standId}, + </if> + <if test="status != null"> + status = #{status}, + </if> + <if test="gmtModified != null"> + gmt_modified = #{gmtModified}, + </if> + <if test="modifiedUname != null"> + modified_uname = #{modifiedUname}, + </if> + <if test="modifiedUid != null"> + modified_uid = #{modifiedUid}, + </if> + </set> + where id = #{id} + + </update> + <update id="updateStatusBatch" + parameterType="com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO"> + update approval_rule_item + <set> + status = #{status}, + modified_uname = #{modifiedUname}, + modified_uid = #{modifiedUid}, + gmt_modified = #{gmtModified}, + </set> + where id in + <foreach collection="ids" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + + <select id="countByMeasureIds" resultType="java.lang.Integer"> + select count(1) from approval_rule_item where status = #{status} and measure_id in + <foreach collection="measureIds" item="measureId" open="(" close=")" separator=","> + #{measureId} + </foreach> + </select> + <!--批量更新--> + <update id="updateItemBatch" parameterType="java.util.List"> + <foreach collection="itemList" item="item" index="index" open="" close="" separator=";"> + update approval_rule_item + <set> + <if test="item.ruleId != null"> + rule_id = #{item.ruleId}, + </if> + <if test="item.stepId != null"> + step_id = #{item.stepId}, + </if> + <if test="item.itemName != null and item.itemName != ''"> + item_name = #{item.itemName}, + </if> + <if test="item.type != null"> + type = #{item.type}, + </if> + <if test="item.standId != null"> + stand_id = #{item.standId}, + </if> + <if test="item.standId == null"> + stand_id = null, + </if> + <if test="item.measureId != null"> + measure_id = #{item.measureId}, + </if> + <if test="item.measureId == null"> + measure_id = null, + </if> + <if test="item.status != null"> + status = #{item.status}, + </if> + <if test="item.gmtModified != null"> + gmt_modified = #{item.gmtModified}, + </if> + <if test="item.modifiedUname != null"> + modified_uname = #{item.modifiedUname}, + </if> + <if test="item.modifiedUid != null"> + modified_uid = #{item.modifiedUid}, + </if> + + </set> + where id = #{item.id} + </foreach> + </update> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitMapper.xml new file mode 100644 index 0000000..822f51a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/ApprovalRuleUnitMapper.xml @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleUnitRepository" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.specialWork.entity.ApprovalRuleUnit" > + <id column="unit_id" property="unitId" jdbcType="BIGINT" /> + <result column="rule_id" property="ruleId" jdbcType="BIGINT"/> + <result column="step_id" property="stepId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="unit_serial" property="unitSerial" jdbcType="TINYINT"/> + <result column="bind_dep_id" property="bindDepId" jdbcType="BIGINT"/> + <result column="bind_uid" property="bindUid" jdbcType="BIGINT"/> + <result column="bind_dep_name" property="bindDepName" jdbcType="VARCHAR"/> + <result column="bind_uname" property="bindUname" jdbcType="VARCHAR"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + <sql id="all_Column_List" > + <!-- -->`` + unit_id,rule_id,step_id,status,unit_serial,bind_dep_id,bind_uid,bind_dep_name,bind_uname,gmt_create,gmt_modified,create_uid,create_uname,modified_uname,modified_uid + </sql> + <sql id="base_table_name">approval_rule_unit</sql> + + <insert id="insert" + parameterType="com.gk.hotwork.specialWork.entity.ApprovalRuleUnit" > + insert + into approval_rule_unit + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="unit.ruleId != null"> + rule_id, + </if> + <if test="unit.stepId != null"> + step_id, + </if> + <if test="unit.status != null"> + status, + </if> + <if test="unit.unitSerial != null"> + unit_serial, + </if> + <if test="unit.bindDepId != null"> + bind_dep_id, + </if> + <if test="unit.bindUid != null"> + bind_uid, + </if> + <if test="unit.bindDepName != null and unit.bindDepName != '' "> + bind_dep_name, + </if> + <if test="unit.bindUname != null and unit.bindUname != '' "> + bind_uname, + </if> + <if test="unit.gmtCreate != null"> + gmt_create, + </if> + <if test="unit.createUid != null"> + create_uid, + </if> + <if test="unit.createUname != null"> + create_uname, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + + <if test="unit.ruleId != null"> + #{unit.ruleId}, + </if> + <if test="unit.stepId != null"> + #{unit.stepId}, + </if> + <if test="unit.status != null"> + #{unit.status}, + </if> + <if test="unit.unitSerial != null"> + #{unit.unitSerial}, + </if> + <if test="unit.bindDepId != null"> + #{unit.bindDepId}, + </if> + <if test="unit.bindUid != null"> + #{unit.bindUid}, + </if> + <if test="unit.bindDepName != null and unit.bindDepName != '' "> + #{unit.bindDepName}, + </if> + <if test="unit.bindUname != null and unit.bindUname != '' "> + #{unit.bindUname}, + </if> + <if test="unit.gmtCreate != null"> + #{unit.gmtCreate}, + </if> + <if test="unit.createUid != null"> + #{unit.createUid}, + </if> + <if test="unit.createUname != null"> + #{unit.createUname}, + </if> + </trim> + </insert> + + <insert id="batchInsert"> + insert into approval_rule_unit + (unit_id,rule_id,step_id,status,unit_serial,bind_dep_id,bind_uid,bind_dep_name,bind_uname,gmt_create,gmt_modified,create_uid,create_uname,modified_uname,modified_uid) + values + <foreach collection="unitList" item="unit" index="index" separator=","> + (#{unit.unitId},#{unit.ruleId},#{unit.stepId},#{unit.status},#{unit.unitSerial},#{unit.bindDepId},#{unit.bindUid}, + #{unit.bindDepName},#{unit.bindUname},#{unit.gmtCreate},#{unit.gmtModified},#{unit.createUid},#{unit.createUname}, + #{unit.modifiedUname},#{unit.modifiedUid}) + </foreach> + </insert> + + <select id="listActiveByRuleStepId" resultMap="BaseResultMap"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + where step_id = #{stepId} and status = #{status} + </select> + + <select id="listActiveByRuleId" resultMap="BaseResultMap"> + select unit_id,rule_id,step_id,status,unit_serial,bind_dep_id,bind_uid,bind_dep_name,bind_uname from <include refid="base_table_name"></include> + where rule_id = #{ruleId} and status = #{status} + </select> + + <update id="updateStatusByRuleStepId"> + update <include refid="base_table_name"></include> + set status = #{status} + where + step_id = #{stepId} + </update> + + <!--根据规则ids 批量删除--> + <update id="updateStatusByRuleIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + rule_id in + <foreach collection="ruleIds" item="ruleId" open="(" close=")" separator=","> + #{ruleId} + </foreach> + </update> + <!--根据层级ids 批量删除--> + <update id="updateStatusByStepIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + step_id in + <foreach collection="stepIds" item="stepId" open="(" close=")" separator=","> + #{stepId} + </foreach> + </update> + <!--根据层级ids获取单元id集合--> + <select id="listUnitIdByStepId" resultType="java.lang.Long"> + select unit_id from <include refid="base_table_name"></include> + where status = #{status} and step_id = #{stepId} + </select> + <!--根据单元ids 批量删除--> + <update id="updateStatusByUnitIds"> + update <include refid="base_table_name"></include> + set status = #{status} + where + unit_id in + <foreach collection="unitIds" item="unitId" open="(" close=")" separator=","> + #{unitId} + </foreach> + </update> + + <select id="listByConditions" resultMap="BaseResultMap"> + select <include refid="all_Column_List"></include> from <include refid="base_table_name"></include> + <where> + <if test="stepId != null"> + and step_id = #{stepId} + </if> + <if test="status != null"> + and status = #{status} + </if> + <if test="ruleId != null"> + and rule_id = #{ruleId} + </if> + <if test="bindDepId != null"> + and bind_dep_id = #{bindDepId} + </if> + <if test="bindUid != null"> + and bind_uid = #{bindUid} + </if> + </where> + </select> + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyInfoMapper.xml new file mode 100644 index 0000000..6261db1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyInfoMapper.xml @@ -0,0 +1,471 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApplyInfoRepository" > + <resultMap id="WorkApplyInfo" type="com.gk.hotwork.specialWork.entity.WorkApplyInfo" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="eid" property="eid" jdbcType="BIGINT"/> + <result column="dep_id" property="depId" jdbcType="BIGINT"/> + <result column="dep_name" property="depName" jdbcType="VARCHAR"/> + <result column="apply_uid" property="applyUid" jdbcType="BIGINT"/> + <result column="apply_uname" property="applyUname" jdbcType="VARCHAR"/> + <result column="work_permit_no" property="workPermitNo" jdbcType="VARCHAR"/> + <result column="work_type" property="workType" jdbcType="TINYINT"/> + <result column="work_level" property="workLevel" jdbcType="TINYINT"/> + <result column="work_content" property="workContent" jdbcType="VARCHAR"/> + <result column="work_location" property="workLocation" jdbcType="VARCHAR"/> + <result column="hazard_identification" property="hazardIdentification" jdbcType="VARCHAR"/> + <result column="work_detail_id" property="workDetailId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="approval_step" property="approvalStep" jdbcType="INTEGER"/> + <result column="apply_time" property="applyTime" jdbcType="TIMESTAMP"/> + <result column="operator_uid" property="operatorUid" jdbcType="TINYINT"/> + <result column="operator_uname" property="operatorUname" jdbcType="VARCHAR"/> + <result column="operator_unames" property="operatorUnames" jdbcType="VARCHAR"/> + <result column="operator_companys" property="operatorCompanys" jdbcType="VARCHAR"/> + <result column="exp_start_time" property="expStartTime" jdbcType="TIMESTAMP"/> + <result column="exp_end_time" property="expEndTime" jdbcType="TIMESTAMP"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + </resultMap> + + <resultMap id="WorkApplyInfoBO" type="com.gk.hotwork.specialWork.model.bo.WorkApplyPendingInfoBO" > + <id column="id" property="workApplyId" jdbcType="BIGINT" /> + <result column="eid" property="eid" jdbcType="BIGINT"/> + <result column="dep_id" property="depId" jdbcType="BIGINT"/> + <result column="dep_name" property="depName" jdbcType="VARCHAR"/> + <result column="apply_uid" property="applyUid" jdbcType="BIGINT"/> + <result column="apply_uname" property="applyUname" jdbcType="VARCHAR"/> + <result column="work_permit_no" property="workPermitNo" jdbcType="VARCHAR"/> + <result column="work_type" property="workType" jdbcType="TINYINT"/> + <result column="work_level" property="workLevel" jdbcType="TINYINT"/> + <result column="work_content" property="workContent" jdbcType="VARCHAR"/> + <result column="work_location" property="workLocation" jdbcType="VARCHAR"/> + <result column="hazard_identification" property="hazardIdentification" jdbcType="VARCHAR"/> + <result column="work_detail_id" property="workDetailId" jdbcType="BIGINT"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="approval_step" property="approvalStep" jdbcType="INTEGER"/> + <result column="apply_time" property="applyTime" jdbcType="TIMESTAMP"/> + <result column="operator_uid" property="operatorUid" jdbcType="TINYINT"/> + <result column="operator_uname" property="operatorUname" jdbcType="VARCHAR"/> + <result column="operator_unames" property="operatorUnames" jdbcType="VARCHAR"/> + <result column="operator_companys" property="operatorCompanys" jdbcType="VARCHAR"/> + <result column="exp_start_time" property="expStartTime" jdbcType="TIMESTAMP"/> + <result column="exp_end_time" property="expEndTime" jdbcType="TIMESTAMP"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="step_id" property="stepId" jdbcType="BIGINT"/> + <result column="step_type" property="stepType" jdbcType="TINYINT"/> + <result column="step_approval_result" property="stepApprovalResult" jdbcType="TINYINT"/> + <result column="step_serial" property="stepSerial" jdbcType="INTEGER"/> + <result column="step_start_approval_time" property="stepStartApprovalTime" jdbcType="TIMESTAMP"/> + <result column="step_finish_approval_time" property="stepFinishApprovalTime" jdbcType="TIMESTAMP"/> + <result column="step_exp_finish_approval_time" property="stepExpFinishApprovalTime" jdbcType="TIMESTAMP"/> + <result column="pre_step_id" property="preStepId" jdbcType="BIGINT"/> + <result column="next_step_id" property="nextStepId" jdbcType="BIGINT"/> + <result column="is_contain_item" property="containItem" jdbcType="TINYINT"/> + <result column="unit_id" property="unitId" jdbcType="BIGINT"/> + <result column="unit_approval_uid" property="unitApprovalUid" jdbcType="BIGINT"/> + <result column="unit_approval_uname" property="unitApprovalUname" jdbcType="VARCHAR"/> + <result column="unit_result" property="unitResult" jdbcType="TINYINT"/> + <result column="unit_approval_start_time" property="unitApprovalStartTime" jdbcType="TIMESTAMP"/> + <result column="unit_approval_end_time" property="unitApprovalEndTime" jdbcType="TIMESTAMP"/> + <result column="unit_approval_actual_time" property="unitApprovalActualTime" jdbcType="TIMESTAMP"/> + <result column="unit_fill_content" property="unitFillContent" jdbcType="VARCHAR"/> + </resultMap> + + <insert id="insertWorkApplyInfo" + parameterType="com.gk.hotwork.specialWork.entity.WorkApplyInfo"> + insert + into work_apply + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="depId != null"> + dep_id, + </if> + <if test="applyUid != null"> + apply_uid, + </if> + <if test="workType != null"> + work_type, + </if> + <if test="workLevel != null"> + work_level, + </if> + <if test="status != null"> + status, + </if> + <if test="approvalStep != null"> + approval_step, + </if> + <if test="applyTime != null"> + apply_time, + </if> + <if test="expStartTime != null"> + exp_start_time, + </if> + <if test="expEndTime != null"> + exp_end_time, + </if> + <if test="gmtCreate != null"> + gmt_create, + </if> + <if test="approvalStepId != null"> + approval_step_id, + </if> + <if test="operatorUname != null"> + operator_uname, + </if> + <if test="applyUname != null"> + apply_uname, + </if> + <if test="depName != null"> + dep_name, + </if> + <if test="operatorUid != null"> + operator_uid, + </if> + <if test="workPermitNo != null"> + work_permit_no, + </if> + <if test="workContent != null"> + work_content, + </if> + <if test="workLocation != null"> + work_location, + </if> + <if test="hazardIdentification != null"> + hazard_identification, + </if> + <if test="workDetailId != null"> + work_detail_id, + </if> + <if test="operatorUnames != null"> + operator_unames, + </if> + <if test="operatorCompanys != null"> + operator_companys, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id}, + </if> + <if test="depId != null"> + #{depId}, + </if> + <if test="applyUid != null"> + #{applyUid}, + </if> + <if test="workType != null"> + #{workType}, + </if> + <if test="workLevel != null"> + #{workLevel}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="approvalStep != null"> + #{approvalStep}, + </if> + <if test="applyTime != null"> + #{applyTime}, + </if> + <if test="expStartTime != null"> + #{expStartTime}, + </if> + <if test="expEndTime != null"> + #{expEndTime}, + </if> + <if test="gmtCreate != null"> + #{gmtCreate}, + </if> + <if test="approvalStepId != null"> + #{approvalStepId}, + </if> + <if test="operatorUname != null"> + #{operatorUname}, + </if> + <if test="applyUname != null"> + #{applyUname}, + </if> + <if test="depName != null"> + #{depName}, + </if> + <if test="operatorUid != null"> + #{operatorUid}, + </if> + <if test="workPermitNo != null"> + #{workPermitNo}, + </if> + <if test="workContent != null"> + #{workContent}, + </if> + <if test="workLocation != null"> + #{workLocation}, + </if> + <if test="hazardIdentification != null"> + #{hazardIdentification}, + </if> + <if test="workDetailId != null"> + #{workDetailId}, + </if> + <if test="operatorUnames != null"> + #{operatorUnames}, + </if> + <if test="operatorCompanys != null"> + #{operatorCompanys}, + </if> + </trim> + + </insert> + <update id="updateStatusById"> + update work_apply + set status = #{status} + where id = #{workApplyId} + + </update> + <update id="updateApprovalStepIdById"> + update work_apply + set approval_step_id = #{nextStepId} + where id = #{workApplyId} + + </update> + <select id="listWorkApplyInfoByPage" + parameterType="com.gk.hotwork.specialWork.model.query.db.WorkApplyApplyingPageDBQuery" + resultMap="WorkApplyInfo"> + select + workApply.id, + workApply.eid, + workApply.dep_id, + workApply.dep_name, + workApply.apply_uid, + workApply.apply_uname, + workApply.work_type, + workApply.work_level, + workApply.status, + workApply.approval_step, + workApply.approval_step_id, + workApply.apply_time, + workApply.exp_start_time, + workApply.exp_end_time, + workApply.gmt_create, + workApply.gmt_modified, + workApply.work_permit_no, + workApply.operator_uid, + workApply.operator_uname, + workApply.operator_certificate, + workApply.work_content, + workApply.work_location, + workApply.hazard_identification, + workApply.operator_unames, + workApply.operator_companys, + workApply.work_detail_id + from work_apply as workApply + <where> + <if test="query.status != null"> + and workApply.status = #{query.status} + </if> + <if test="query.workType != null"> + and workApply.work_type = #{query.workType} + </if> + <if test="query.applyUid != null"> + and workApply.apply_uid = #{query.applyUid} + </if> + </where> + order by workApply.gmt_create desc + + + + </select> + <select id="listPendingWorkApplyInfo" + parameterType="com.gk.hotwork.specialWork.model.query.db.WorkApplyPendingPageDBQuery" + resultMap="WorkApplyInfoBO"> + select + workApply.id, + workApply.eid, + workApply.dep_id, + workApply.dep_name, + workApply.apply_uid, + workApply.apply_uname, + workApply.work_type, + workApply.work_level, + workApply.status, + workApply.approval_step, + workApply.approval_step_id, + workApply.apply_time, + workApply.exp_start_time, + workApply.exp_end_time, + workApply.gmt_create, + workApply.gmt_modified, + workApply.work_permit_no, + workApply.operator_uid, + workApply.operator_uname, + workApply.operator_certificate, + workApply.work_content, + workApply.work_location, + workApply.hazard_identification, + workApply.operator_unames, + workApply.operator_companys, + workApply.work_detail_id, + ruleStep.id step_id, + ruleStep.type step_type, + ruleStep.approval_result step_approval_result, + ruleStep.step_serial step_serial, + ruleStep.start_approval_time step_start_approval_time, + ruleStep.finish_approval_time step_finish_approval_time, + ruleStep.exp_finish_approval_time step_exp_finish_approval_time, + ruleStep.pre_step_id, + ruleStep.next_step_id, + ruleStep.is_contain_item, + ruleUnit.id unit_id, + ruleUnit.approval_uid unit_approval_uid, + ruleUnit.approval_uname unit_approval_uname, + ruleUnit.result unit_result, + ruleUnit.approval_start_time unit_approval_start_time, + ruleUnit.approval_end_time unit_approval_end_time, + ruleUnit.approval_actual_time unit_approval_actual_time, + ruleUnit.fill_content unit_fill_content + from work_apply as workApply + inner join work_approval_step as ruleStep on ruleStep.id = workApply.approval_step_id + inner join work_approval_unit as ruleUnit on ruleUnit.step_id = ruleStep.id and ruleUnit.approval_uid = #{query.approvalUid} + <where> + <if test="query.status != null"> + and workApply.status = #{query.status} + </if> + <if test="query.workType != null"> + and workApply.work_type = #{query.workType} + </if> + <if test="query.applyUname != null"> + and workApply.apply_uname like concat("%",#{query.applyUname},"%") + </if> + </where> + order by workApply.gmt_create desc + + + + </select> + <select id="getWorkApprovalByApprovalUid" + resultMap="WorkApplyInfo"> + select + workApply.id, + workApply.eid, + workApply.dep_id, + workApply.dep_name, + workApply.apply_uid, + workApply.apply_uname, + workApply.work_type, + workApply.work_level, + workApply.status, + workApply.approval_step, + workApply.approval_step_id, + workApply.apply_time, + workApply.exp_start_time, + workApply.exp_end_time, + workApply.gmt_create, + workApply.gmt_modified, + workApply.work_permit_no, + workApply.operator_uid, + workApply.operator_uname, + workApply.operator_certificate, + workApply.work_content, + workApply.work_location, + workApply.hazard_identification, + workApply.operator_unames, + workApply.operator_companys, + workApply.work_detail_id + from work_apply as workApply + inner join work_approval_step as ruleStep on ruleStep.id = workApply.approval_step_id + inner join work_approval_unit as ruleUnit on ruleUnit.step_id = ruleStep.id and ruleUnit.approval_uid = #{approvalUid} + where workApply.id = #{workApplyId} + + </select> + <select id="countWorkApplyInfo" resultType="java.lang.Integer"> + select count(0) + from work_apply + </select> + <select id="listAllWorkApplyByPage" + resultMap="WorkApplyInfo"> + select + workApply.id, + workApply.eid, + workApply.dep_id, + workApply.dep_name, + workApply.apply_uid, + workApply.apply_uname, + workApply.work_type, + workApply.work_level, + workApply.status, + workApply.approval_step, + workApply.approval_step_id, + workApply.apply_time, + workApply.exp_start_time, + workApply.exp_end_time, + workApply.gmt_create, + workApply.gmt_modified, + workApply.work_permit_no, + workApply.operator_uid, + workApply.operator_uname, + workApply.operator_certificate, + workApply.work_content, + workApply.work_location, + workApply.hazard_identification, + workApply.operator_unames, + workApply.operator_companys, + workApply.work_detail_id + from work_apply as workApply + <where> + <if test="query.status != null"> + and workApply.status = #{query.status} + </if> + <if test="query.workType != null"> + and workApply.work_type = #{query.workType} + </if> + <if test="query.workLevel != null"> + and workApply.work_level = #{query.workLevel} + </if> + <if test="query.applyDepId != null"> + and workApply.dep_id = #{query.applyDepId} + </if> + <if test="query.applyStartTime != null"> + and workApply.apply_time > #{query.applyStartTime} + </if> + <if test="query.applyEndTime != null"> + and workApply.apply_time < #{query.applyEndTime} + </if> + </where> + order by workApply.gmt_create desc + + </select> + <select id="getWorkApplyCountByDep" resultType="com.gk.hotwork.specialWork.entity.WorkApplyCountDO"> + select count(1) as count,dep_id,work_type from work_apply where DATE(gmt_create) = curdate() GROUP BY dep_id,work_type; + </select> + <select id="listReportableWorkApply" + resultType="com.gk.hotwork.specialWork.entity.WorkApplyReportableDO"> + select + workApply.id, + workApply.work_permit_no, + workApply.work_type, + workApply.work_level, + workApply.work_content, + workApply.work_location, + workApply.exp_start_time, + workApply.exp_end_time, + workApply.hazard_identification, + workApply.status + from work_apply as workApply + where workApply.status = #{query.status} + and workApply.exp_start_time < #{query.now} + and workApply.exp_end_time > #{query.now} + <if test="query.workPermitNo != null and query.workPermitNo != ''"> + and workApply.work_permit_no like concat("%",#{query.workPermitNo},"%") + </if> + <if test="query.workType != null"> + and workApply.work_type = #{query.workType} + </if> + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyOperatorInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyOperatorInfoMapper.xml new file mode 100644 index 0000000..fa5c4b4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApplyOperatorInfoMapper.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApplyOperatorInfoRepository" > + <resultMap id="WorkApplyInfo" type="com.gk.hotwork.specialWork.entity.WorkApplyOperatorInfo" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="operator_uid" property="operatorUid" jdbcType="BIGINT"/> + <result column="work_apply_id" property="workApplyId" jdbcType="BIGINT"/> + <result column="operator_uname" property="operatorUname" jdbcType="VARCHAR"/> + <result column="operator_certificate" property="operatorCertificate" jdbcType="VARCHAR"/> + <result column="operator_phone" property="operatorPhone" jdbcType="VARCHAR"/> + <result column="operator_identify" property="operatorIdentify" jdbcType="VARCHAR"/> + </resultMap> + <insert id="insertBatchOperator"> + insert + into work_apply_operator + <trim prefix="(" suffix=") values" suffixOverrides="," > + id, + operator_uid, + work_apply_id, + operator_uname, + operator_certificate, + operator_phone, + operator_identify, + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.operatorUid}, + #{item.workApplyId}, + #{item.operatorUname}, + #{item.operatorCertificate}, + #{item.operatorPhone}, + #{item.operatorIdentify}, + </trim> + </foreach> + + </insert> + <select id="listWorkOperatorByWorkApplyId" + parameterType="long" + resultMap="WorkApplyInfo"> + select + operator.id, + operator.operator_uid, + operator.work_apply_id, + operator.operator_uname, + operator.operator_certificate, + operator.operator_phone, + operator.operator_identify + from work_apply_operator as operator + where operator.work_apply_id = #{workApplyId} + </select> + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalFilledItemInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalFilledItemInfoMapper.xml new file mode 100644 index 0000000..b421455 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalFilledItemInfoMapper.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalFilledItemInfoRepository" > + + <resultMap id="WorkApprovalFilledItemInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalFilledItemInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="unit_id" property="unitId"/> + <result column="item_id" property="itemId"/> + <result column="val" property="val"/> + <result column="measure_val" property="measureVal"/> + <result column="measure_text" property="measureText"/> + <result column="fill_type" property="fillType"/> + </resultMap> + <insert id="insertBatchFilledItemInfo" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalFilledItemInfo"> + insert + into work_approval_filled_item + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + work_apply_id, + unit_id, + item_id, + val, + measure_val, + measure_text, + analysis_location, + fill_type, + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.workApplyId}, + #{item.unitId}, + #{item.itemId}, + #{item.val}, + #{item.measureVal}, + #{item.measureText}, + #{item.analysisLocation}, + #{item.fillType}, + </trim> + </foreach> + + </insert> + + + <select id="listApprovalFilledItemInfoByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalFilledItemInfo"> + select + approvalFilledItem.id, + approvalFilledItem.work_apply_id, + approvalFilledItem.unit_id, + approvalFilledItem.item_id, + approvalFilledItem.val, + approvalFilledItem.measure_val, + approvalFilledItem.measure_text, + approvalFilledItem.analysis_location, + approvalFilledItem.fill_type + from work_approval_filled_item as approvalFilledItem + where approvalFilledItem.work_apply_id = #{workApplyId} + </select> + <select id="listApprovalFilledItemInfoByUnitId" + resultMap="WorkApprovalFilledItemInfo"> + select + approvalFilledItem.id, + approvalFilledItem.work_apply_id, + approvalFilledItem.unit_id, + approvalFilledItem.item_id, + approvalFilledItem.val, + approvalFilledItem.measure_val, + approvalFilledItem.measure_text, + approvalFilledItem.analysis_location, + approvalFilledItem.fill_type + from work_approval_filled_item as approvalFilledItem + where approvalFilledItem.unit_id = #{unitId} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemInfoMapper.xml new file mode 100644 index 0000000..754c4ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemInfoMapper.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalItemInfoRepository" > + + <resultMap id="WorkApprovalItemInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="item_name" property="itemName"/> + <result column="step_id" property="stepId"/> + <result column="unit_id" property="unitId"/> + <result column="type" property="type"/> + <result column="stand_id" property="standId"/> + <result column="measure_id" property="measureId"/> + <result column="measure_involve" property="measureInvolve"/> + </resultMap> + + <insert id="insertBatch" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo"> + insert + into work_approval_item + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + item_name, + work_apply_id, + step_id, + unit_id, + type, + stand_id, + measure_id, + measure_involve, + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.itemName}, + #{item.workApplyId}, + #{item.stepId}, + #{item.unitId}, + #{item.type}, + #{item.standId}, + #{item.measureId}, + #{item.measureInvolve}, + </trim> + + </foreach> + + </insert> + <select id="listWorkApprovalItemByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalItemInfo"> + select + approvalItem.id, + approvalItem.item_name, + approvalItem.work_apply_id, + approvalItem.step_id, + approvalItem.unit_id, + approvalItem.type, + approvalItem.stand_id, + approvalItem.measure_id, + approvalItem.measure_involve + from work_approval_item as approvalItem + where approvalItem.work_apply_id = #{workApplyId} + </select> + <select id="listWorkApprovalItemInfoByStepId" + parameterType="long" + resultMap="WorkApprovalItemInfo"> + select + approvalItem.id, + approvalItem.item_name, + approvalItem.work_apply_id, + approvalItem.step_id, + approvalItem.unit_id, + approvalItem.type, + approvalItem.stand_id, + approvalItem.measure_id, + approvalItem.measure_involve + from work_approval_item as approvalItem + where approvalItem.step_id = #{stepId} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemMeasureInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemMeasureInfoMapper.xml new file mode 100644 index 0000000..63f5e52 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemMeasureInfoMapper.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalItemMeasureInfoRepository" > + + + <resultMap id="WorkApprovalItemMeasureInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalItemMeasureInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="work_type" property="workType"/> + <result column="type" property="type"/> + <result column="correct_val" property="correctVal"/> + <result column="context" property="context"/> + </resultMap> + + <insert id="insertBatch" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalItemMeasureInfo"> + insert + into work_approval_item_measure + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + work_type, + type, + correct_val, + context, + work_apply_id, + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.workType}, + #{item.type}, + #{item.correctVal}, + #{item.context}, + #{item.workApplyId}, + </trim> + + </foreach> + + </insert> + <select id="listWorkApprovalItemMeasureByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalItemMeasureInfo"> + select + itemMeasure.id, + itemMeasure.work_type, + itemMeasure.type, + itemMeasure.correct_val, + itemMeasure.context, + itemMeasure.work_apply_id + from work_approval_item_measure as itemMeasure + where itemMeasure.work_apply_id = #{workApplyId} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemStandnfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemStandnfoMapper.xml new file mode 100644 index 0000000..a2541fb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalItemStandnfoMapper.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalItemStandInfoRepository" > + + + <resultMap id="WorkApprovalItemStandInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="type" property="type"/> + <result column="eid" property="eid"/> + <result column="dep_id" property="depId"/> + <result column="dep_name" property="depName"/> + <result column="min_val" property="minVal"/> + <result column="min_val_match_pattern" property="minValMatchPattern"/> + <result column="max_val" property="maxVal"/> + <result column="max_val_match_pattern" property="maxValMatchPattern"/> + <result column="title" property="title"/> + </resultMap> + + <insert id="insertBatch" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo"> + insert + into work_approval_item_stand + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + type, + dep_id, + dep_name, + min_val, + min_val_match_pattern, + max_val, + max_val_match_pattern, + title, + work_apply_id + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.type}, + #{item.depId}, + #{item.depName}, + #{item.minVal}, + #{item.minValMatchPattern}, + #{item.maxVal}, + #{item.maxValMatchPattern}, + #{item.title}, + #{item.workApplyId} + </trim> + + </foreach> + + </insert> + <select id="listWorkApprovalItemStandByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalItemStandInfo"> + select + itemStand.id, + itemStand.type, + itemStand.dep_id, + itemStand.dep_name, + itemStand.min_val, + itemStand.min_val_match_pattern, + itemStand.max_val, + itemStand.max_val_match_pattern, + itemStand.title, + itemStand.work_apply_id + from work_approval_item_stand as itemStand + where itemStand.work_apply_id = #{workApplyId} + + + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalStepInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalStepInfoMapper.xml new file mode 100644 index 0000000..f4bacc3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalStepInfoMapper.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalStepInfoRepository" > + + <resultMap id="WorkApprovalStepInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="type" property="type"/> + <result column="approval_result" property="approvalResult"/> + <result column="step_serial" property="stepSerial"/> + <result column="start_approval_time" property="startApprovalTime"/> + <result column="exp_finish_approval_time" property="expFinishApprovalTime"/> + <result column="finish_approval_time" property="finishApprovalTime"/> + <result column="pre_step_id" property="preStepId"/> + <result column="next_step_id" property="nextStepId"/> + <result column="is_contain_item" property="containItem"/> + <result column="continue_time" property="continueTime"/> + <result column="continue_time_unit" property="continueTimeUnit"/> + <result column="step_name" property="stepName"/> + <result column="audit_type" property="auditType"/> + + + + </resultMap> + + + <insert id="insertBatch" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo"> + insert + into work_approval_step + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + work_apply_id, + type, + approval_result, + step_serial, + start_approval_time, + exp_finish_approval_time, + finish_approval_time, + pre_step_id, + next_step_id, + is_contain_item, + continue_time, + continue_time_unit, + step_name, + audit_type + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.workApplyId}, + #{item.type}, + #{item.approvalResult}, + #{item.stepSerial}, + #{item.startApprovalTime}, + #{item.expFinishApprovalTime}, + #{item.finishApprovalTime}, + #{item.preStepId}, + #{item.nextStepId}, + #{item.containItem}, + #{item.continueTime}, + #{item.continueTimeUnit}, + #{item.stepName}, + #{item.auditType}, + </trim> + + </foreach> + + </insert> + <update id="updateStatusById"> + update + work_approval_step + set approval_result = #{result} + where id = #{stepId} + + </update> + <update id="updateFinishApprovalTimeById"> + update + work_approval_step + set finish_approval_time = #{finishTime} + where id = #{stepId} + + </update> + <update id="updateStartApprovalTimeById"> + update + work_approval_step + set start_approval_time = #{startTime} + where id = #{stepId} + + </update> + <select id="listApprovalRuleStepByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalStepInfo"> + select + apprvoalStep.id, + apprvoalStep.work_apply_id, + apprvoalStep.type, + apprvoalStep.approval_result, + apprvoalStep.step_serial, + apprvoalStep.start_approval_time, + apprvoalStep.exp_finish_approval_time, + apprvoalStep.finish_approval_time, + apprvoalStep.pre_step_id, + apprvoalStep.next_step_id, + apprvoalStep.is_contain_item, + apprvoalStep.continue_time, + apprvoalStep.continue_time_unit, + apprvoalStep.step_name, + apprvoalStep.audit_type + from work_approval_step apprvoalStep + where work_apply_id = #{workApplyId} + + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalUnitInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalUnitInfoMapper.xml new file mode 100644 index 0000000..72ef668 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkApprovalUnitInfoMapper.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkApprovalUnitInfoRepository" > + + + <resultMap id="WorkApprovalUnitInfo" type="com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo"> + <result column="id" property="id"/> + <result column="work_apply_id" property="workApplyId"/> + <result column="step_id" property="stepId"/> + <result column="approval_uid" property="approvalUid"/> + <result column="approval_uname" property="approvalUname"/> + <result column="type" property="type"/> + <result column="result" property="result"/> + <result column="approval_start_time" property="approvalStartTime"/> + <result column="approval_end_time" property="approvalEndTime"/> + <result column="approval_actual_time" property="approvalActualTime"/> + <result column="fill_content" property="fillContent"/> + </resultMap> + + <insert id="insertBatch" + parameterType="com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo"> + insert + into work_approval_unit + <trim prefix="(" suffix=") values" suffixOverrides=","> + id, + work_apply_id, + step_id, + approval_uid, + approval_uname, + type, + result, + approval_start_time, + approval_end_time, + approval_actual_time, + </trim> + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + #{item.id}, + #{item.workApplyId}, + #{item.stepId}, + #{item.approvalUid}, + #{item.approvalUname}, + #{item.type}, + #{item.result}, + #{item.approvalStartTime}, + #{item.approvalEndTime}, + #{item.approvalActualTime}, + </trim> + + </foreach> + + </insert> + <update id="updateStatusById"> + update + work_approval_unit + set result = #{result}, + approval_actual_time = now() + where id = #{unitId} + + </update> + <update id="updateStatusByStepId"> + update + work_approval_unit + set + result = #{result} + where step_id = #{stepId} + + + </update> + <update id="updateStatusByIds"> + update + work_approval_unit + set + result = #{result}, + approval_actual_time = now() + where id in + <foreach collection="list" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + + + + </update> + <update id="updateStatusAndFillContentById"> + update + work_approval_unit + set result = #{result}, + fill_content = #{unitFillContent}, + approval_actual_time = now() + where id = #{unitId} + + </update> + <update id="batchUpdateStatusByIds"> + update + work_approval_unit + set + result = #{result} + where id in + <foreach collection="list" item="id" open="(" close=")" separator=","> + #{id} + </foreach> + + </update> + <select id="listApprovalRuleUnitByWorkApplyId" + parameterType="long" + resultMap="WorkApprovalUnitInfo"> + select + approvalUnit.id, + approvalUnit.work_apply_id, + approvalUnit.step_id, + approvalUnit.approval_uid, + approvalUnit.approval_uname, + approvalUnit.type, + approvalUnit.result, + approvalUnit.approval_start_time, + approvalUnit.approval_end_time, + approvalUnit.approval_actual_time, + approvalUnit.fill_content + from work_approval_unit as approvalUnit + where approvalUnit.work_apply_id = #{workApplyId} + </select> + <select id="listWorkApprovalUnitByStepIdAndUid" + resultMap="WorkApprovalUnitInfo"> + select + approvalUnit.id, + approvalUnit.work_apply_id, + approvalUnit.step_id, + approvalUnit.approval_uid, + approvalUnit.approval_uname, + approvalUnit.type, + approvalUnit.result, + approvalUnit.approval_start_time, + approvalUnit.approval_end_time, + approvalUnit.approval_actual_time, + approvalUnit.fill_content + from work_approval_unit as approvalUnit + where approvalUnit.step_id = #{stepId} + and approvalUnit.approval_uid = #{approvalUid} + + </select> + <select id="listApprovalRuleUnitByStepId" + parameterType="long" + resultMap="WorkApprovalUnitInfo"> + select + approvalUnit.id, + approvalUnit.work_apply_id, + approvalUnit.step_id, + approvalUnit.approval_uid, + approvalUnit.approval_uname, + approvalUnit.type, + approvalUnit.result, + approvalUnit.approval_start_time, + approvalUnit.approval_end_time, + approvalUnit.approval_actual_time, + approvalUnit.fill_content + from work_approval_unit as approvalUnit + where approvalUnit.step_id = #{stepId} + </select> +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkAtHeightInfo.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkAtHeightInfo.xml new file mode 100644 index 0000000..d5760d9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkAtHeightInfo.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkAtHeightInfoRepository"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkAtHeightInfo" id="WorkAtHeightInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="operationDepId" column="operation_dep_id" jdbcType="BIGINT"/> + <result property="operationDepName" column="operation_dep_name" jdbcType="VARCHAR"/> + <result property="operationHeight" column="operation_height" jdbcType="DECIMAL"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="otherSpecialWork" column="other_special_work" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkAtHeightInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkAtHeightQuery"> + select + id, operation_dep_id, operation_dep_name, operation_height, work_apply_id, other_special_work, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_at_height + <where> + + <if test="query.operationDepId != null"> + and operation_dep_id = #{query.operationDepId} + </if> + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + </select> + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_at_height + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBlindPlatePluggingInfo.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBlindPlatePluggingInfo.xml new file mode 100644 index 0000000..7514e11 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBlindPlatePluggingInfo.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace=".dao.WorkBlindPlatePluggingDao"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkBlindPlatePluggingInfo" id="WorkBlindPlatePluggingInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="bpCode" column="bp_code" jdbcType="VARCHAR"/> + <result property="mainMedia" column="main_media" jdbcType="VARCHAR"/> + <result property="temperature" column="temperature" jdbcType="DECIMAL"/> + <result property="pressure" column="pressure" jdbcType="DECIMAL"/> + <result property="bpMaterialQuality" column="bp_material_quality" jdbcType="VARCHAR"/> + <result property="bpSpecification" column="bp_specification" jdbcType="VARCHAR"/> + <result property="bpLocation" column="bp_location" jdbcType="VARCHAR"/> + <result property="bpLocationMapPath" column="bp_location_map_path" jdbcType="VARCHAR"/> + <result property="installBpTime" column="install_bp_time" jdbcType="TIMESTAMP"/> + <result property="uninstallBpTime" column="uninstall_bp_time" jdbcType="TIMESTAMP"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="otherSpecialWork" column="other_special_work" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkBlindPlatePluggingInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkBlindPlatePluggingQuery"> + select + id, bp_code, main_media, temperature, pressure, bp_material_quality, bp_specification, bp_location, bp_location_map_path, install_bp_time, uninstall_bp_time, work_apply_id, other_special_work, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_blind_plate_plugging + <where> + + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + </select> + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_blind_plate_plugging + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBrokenCircuitInfo.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBrokenCircuitInfo.xml new file mode 100644 index 0000000..e09560c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkBrokenCircuitInfo.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace=".dao.WorkBrokenCircuitDao"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkBrokenCircuitInfo" id="WorkBrokenCircuitInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="operationDepId" column="operation_dep_id" jdbcType="BIGINT"/> + <result property="operationDepName" column="operation_dep_name" jdbcType="VARCHAR"/> + <result property="bcReason" column="bc_reason" jdbcType="VARCHAR"/> + <result property="bcPath" column="bc_path" jdbcType="VARCHAR"/> + <result property="bcExplain" column="bc_explain" jdbcType="VARCHAR"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="involvedDepIds" column="involved_dep_ids" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkBrokenCircuitInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkBrokenCircuitQuery"> + select + id, operation_dep_id, operation_dep_name, bc_reason, bc_path, bc_explain, work_apply_id, involved_dep_ids, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_broken_circuit + <where> + + <if test="query.operationDepId != null"> + and operation_dep_id = #{query.operationDepId} + </if> + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + </select> + + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_broken_circuit + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkConfinedSpaceInfo.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkConfinedSpaceInfo.xml new file mode 100644 index 0000000..e084a64 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkConfinedSpaceInfo.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.test.dao.WorkConfinedSpaceDao"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkConfinedSpaceInfo" id="WorkConfinedSpaceInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="csDepId" column="cs_dep_id" jdbcType="BIGINT"/> + <result property="csDepName" column="cs_dep_name" jdbcType="VARCHAR"/> + <result property="csName" column="cs_name" jdbcType="VARCHAR"/> + <result property="csOriginalName" column="cs_original_name" jdbcType="VARCHAR"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="otherSpecialWork" column="other_special_work" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkConfinedSpaceInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkConfinedSpaceQuery"> + select + id, cs_dep_id, cs_depName, cs_name, cs_original_name, work_apply_id, other_special_work, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_confined_space + <where> + + <if test="query.csDepId != null"> + and cs_dep_id = #{query.cs_dep_name} + </if> + + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + </select> + + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_confined_space + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkGroundBreakingInfo.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkGroundBreakingInfo.xml new file mode 100644 index 0000000..f1a33cc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkGroundBreakingInfo.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkGroundBreakingInfoRepository"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkGroundBreakingInfo" id="WorkGroundBreakingInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="operationDepId" column="operation_dep_id" jdbcType="BIGINT"/> + <result property="operationDepName" column="operation_dep_name" jdbcType="VARCHAR"/> + <result property="gbScope" column="gb_scope" jdbcType="VARCHAR"/> + <result property="gbMethod" column="gb_method" jdbcType="VARCHAR"/> + <result property="gbPath" column="gb_path" jdbcType="VARCHAR"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="otherSpecialWork" column="other_special_work" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkGroundBreakingInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkGroundBreakingQuery"> + select + id, operation_dep_id, operation_dep_name, gb_scope, gb_method, gb_path, work_apply_id, other_special_work, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_ground_breaking + <where> + + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + </select> + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_ground_breaking + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHoistingInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHoistingInfoMapper.xml new file mode 100644 index 0000000..9f0e730 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHoistingInfoMapper.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkHoistingInfoRepository"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkHoistingInfo" id="WorkHoistingInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="hoistingToolName" column="hoisting_tool_name" jdbcType="VARCHAR"/> + <result property="weightMass" column="weight_mass" jdbcType="DECIMAL"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkHoistingInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkHoistingQuery"> + select + id, hoisting_tool_name, weight_mass, work_apply_id, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_hoisting + <where> + + <if test="query.workApplyId != null"> + and work_apply_id = #{query.workApplyId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + + </where> + + </select> + + <!--通过主键idList批量删除数据--> + <update id="updateStatutsByIds"> + update work_hoisting + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHotInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHotInfoMapper.xml new file mode 100644 index 0000000..19d86dd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkHotInfoMapper.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="com.gk.hotwork.specialWork.repository.ApprovalRuleItemStandRepository" > + <resultMap id="WorkHotInfo" type="com.gk.hotwork.specialWork.entity.WorkHotInfo" > + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="hot_method" property="hotMethod" jdbcType="VARCHAR"/> + <result column="work_apply_id" property="workApplyId" jdbcType="BIGINT"/> + <result column="other_special_work" property="otherSpecialWork" jdbcType="VARCHAR"/> + <result column="status" property="status" jdbcType="TINYINT"/> + <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> + <result column="create_uname" property="createUname" jdbcType="VARCHAR"/> + <result column="create_uid" property="createUid" jdbcType="BIGINT"/> + <result column="gmt_modified" property="gmtModified" jdbcType="TIMESTAMP"/> + <result column="modified_uname" property="modifiedUname" jdbcType="VARCHAR"/> + <result column="modified_uid" property="modifiedUid" jdbcType="BIGINT"/> + </resultMap> + + <update id="updateOneStatus"> + update work_hot + set status = #{status} + where id = #{id} + </update> + <update id="batchUpdate"> + update work_hot + set status = #{status} + where id in + <foreach collection="ids" index="index" item="id" separator="," open="(" close=")"> + #{id} + </foreach> + </update> + <select id="listByConditions" parameterType="com.gk.hotwork.specialWork.model.query.db.WorkHotQuery" resultMap="WorkHotInfo"> + select + wh.id, + wh.hot_method, + wh.work_apply_id, + wh.other_special_work, + wh.status, + wh.gmt_create, + wh.create_uname, + wh.create_uid, + wh.gmt_modified, + wh.modified_uname, + wh.modified_uid + from work_hot wh + <where> + <if test="status != null" > + and wh.status = #{status} + </if> + <if test="workApplyId != null" > + and wh.work_apply_id = #{workApplyId} + </if> + </where> + </select> + + + +</mapper> diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessDetectionInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessDetectionInfoMapper.xml new file mode 100644 index 0000000..88d12ca --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessDetectionInfoMapper.xml @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkProcessDetectionInfoRepository"> + + <resultMap id="WorkProcessDetectionInfo" type="com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo"> + <result column="id" property="id" /> + <result column="work_apply_id" property="workApplyId" /> + <result column="work_permit_no" property="workPermitNo" /> + <result column="work_type" property="workType" /> + <result column="work_level" property="workLevel" /> + <result column="operation_time" property="operationTime" /> + <result column="operator_uid" property="operatorUid" /> + <result column="operator_uname" property="operatorUname" /> + <result column="info" property="info" /> + <result column="combustible" property="combustible" /> + <result column="oxygen" property="oxygen" /> + <result column="carbon_monoxide" property="carbonMonoxide" /> + <result column="hydrogen_sulfide" property="hydrogenSulfide" /> + <result column="status" property="status" /> + <result column="result" property="result" /> + <result column="source" property="source" /> + </resultMap> + + + <insert id="insertWorkProcessDetectionInfo" + parameterType="com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo"> + insert + into work_process_detection + <trim prefix="(" suffix=") values" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="workApplyId != null"> + work_apply_id, + </if> + <if test="workPermitNo != null"> + work_permit_no, + </if> + <if test="workType != null"> + work_type, + </if> + <if test="workLevel != null"> + work_level, + </if> + <if test="operationTime != null"> + operation_time, + </if> + <if test="operatorUid != null"> + operator_uid, + </if> + <if test="operatorUname != null"> + operator_uname, + </if> + <if test="info != null"> + info, + </if> + <if test="combustible != null"> + combustible, + </if> + <if test="oxygen != null"> + oxygen, + </if> + <if test="carbonMonoxide != null"> + carbon_monoxide, + </if> + <if test="hydrogenSulfide != null"> + hydrogen_sulfide, + </if> + <if test="status != null"> + status, + </if> + <if test="result != null"> + result, + </if> + <if test="source != null"> + source, + </if> + </trim> + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id}, + </if> + <if test="workApplyId != null"> + #{workApplyId}, + </if> + <if test="workPermitNo != null"> + #{workPermitNo}, + </if> + <if test="workType != null"> + #{workType}, + </if> + <if test="workLevel != null"> + #{workLevel}, + </if> + <if test="operationTime != null"> + #{operationTime}, + </if> + <if test="operatorUid != null"> + #{operatorUid}, + </if> + <if test="operatorUname != null"> + #{operatorUname}, + </if> + <if test="info != null"> + #{info}, + </if> + <if test="combustible != null"> + #{combustible}, + </if> + <if test="oxygen != null"> + #{oxygen}, + </if> + <if test="carbonMonoxide != null"> + #{carbonMonoxide}, + </if> + <if test="hydrogenSulfide != null"> + #{hydrogenSulfide}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="result != null"> + #{result}, + </if> + <if test="source != null"> + #{source}, + </if> + </trim> + + </insert> + <select id="listWorkDetectionInfoByPage" + resultMap="WorkProcessDetectionInfo"> + select + detection.id, + detection.work_apply_id, + detection.work_permit_no, + detection.work_type, + detection.work_level, + detection.operator_uname, + detection.operator_uid, + detection.operation_time, + detection.status, + detection.info, + detection.combustible, + detection.oxygen, + detection.carbon_monoxide, + detection.hydrogen_sulfide, + detection.source, + detection.result + from work_process_detection as detection + <where> + <if test="query.workType != null"> + and detection.work_type = #{query.workType} + </if> + <if test="query.workPermitNo != null and query.workPermitNo != ''"> + and detection.work_permit_no like concat("%",#{query.workPermitNo},"%") + </if> + <if test="query.result != null"> + and detection.result = #{query.result} + </if> + </where> + order by detection.operation_time desc + </select> +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessWarningInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessWarningInfoMapper.xml new file mode 100644 index 0000000..2aca983 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkProcessWarningInfoMapper.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkProcessWarningInfoRepository"> + + <resultMap id="WorkProcessWarningInfo" type="com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo"> + <result column="id" property="id" /> + <result column="work_apply_id" property="workApplyId" /> + <result column="work_permit_no" property="workPermitNo" /> + <result column="work_type" property="workType" /> + <result column="work_level" property="workLevel" /> + <result column="warning_content" property="warningContent" /> + <result column="warning_info" property="warningInfo" /> + <result column="warning_type" property="warningType" /> + <result column="operation_time" property="operationTime" /> + <result column="operator_uid" property="operatorUid" /> + <result column="operator_uname" property="operatorUname" /> + <result column="operation_time" property="operationTime" /> + <result column="original_id" property="originalId" /> + <result column="status" property="status" /> + <result column="source" property="source" /> + </resultMap> + + + + <insert id="insertWorkProcessWarningInfo" + parameterType="com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo"> + insert + into + work_process_warning + <trim prefix="(" suffix=") values" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="workApplyId != null"> + work_apply_id, + </if> + <if test="workPermitNo != null"> + work_permit_no, + </if> + <if test="workType != null"> + work_type, + </if> + <if test="workLevel != null"> + work_level, + </if> + <if test="operationTime != null"> + operation_time, + </if> + <if test="operatorUid != null"> + operator_uid, + </if> + <if test="operatorUname != null"> + operator_uname, + </if> + <if test="source != null"> + source, + </if> + <if test="status != null"> + status, + </if> + <if test="originalId != null"> + original_id, + </if> + <if test="warningInfo != null"> + warning_info, + </if> + <if test="warningType != null"> + warning_type, + </if> + <if test="warningContent != null"> + warning_content, + </if> + </trim> + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id}, + </if> + <if test="workApplyId != null"> + #{workApplyId}, + </if> + <if test="workPermitNo != null"> + #{workPermitNo}, + </if> + <if test="workType != null"> + #{workType}, + </if> + <if test="workLevel != null"> + #{workLevel}, + </if> + <if test="operationTime != null"> + #{operationTime}, + </if> + <if test="operatorUid != null"> + #{operatorUid}, + </if> + <if test="operatorUname != null"> + #{operatorUname}, + </if> + <if test="source != null"> + #{source}, + </if> + <if test="status != null"> + #{status}, + </if> + <if test="originalId != null"> + #{originalId}, + </if> + <if test="warningInfo != null"> + #{warningInfo}, + </if> + <if test="warningType != null"> + #{warningType}, + </if> + <if test="warningContent != null"> + #{warningContent}, + </if> + </trim> + + + + </insert> + + <select id="listWorkProcessWarningInfoByPage" + resultMap="WorkProcessWarningInfo"> + + select + warningInfo.id, + warningInfo.work_apply_id, + warningInfo.work_permit_no, + warningInfo.work_type, + warningInfo.work_level, + warningInfo.operator_uname, + warningInfo.operator_uid, + warningInfo.operation_time, + warningInfo.status, + warningInfo.warning_info, + warningInfo.warning_content, + warningInfo.warning_type, + warningInfo.original_id, + warningInfo.source + from work_process_warning as warningInfo + <where> + <if test="query.workType != null"> + and warningInfo.work_type = #{query.workType} + </if> + <if test="query.workPermitNo != null and query.workPermitNo != ''"> + and warningInfo.work_permit_no like concat("%",#{query.workPermitNo},"%") + </if> + <if test="query.warningType != null"> + and warningInfo.warning_type = #{query.warningType} + </if> + </where> + order by warningInfo.operation_time desc + </select> +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkTemporaryPowerInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkTemporaryPowerInfoMapper.xml new file mode 100644 index 0000000..2861e0b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/specialWork/WorkTemporaryPowerInfoMapper.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.gk.hotwork.specialWork.repository.WorkTemporaryPowerInfoRepository"> + + <resultMap type="com.gk.hotwork.specialWork.entity.WorkTemporaryPowerInfo" id="WorkTemporaryPowerInfoMap"> + <result property="id" column="id" jdbcType="BIGINT"/> + <result property="powerAccessPoint" column="power_access_point" jdbcType="VARCHAR"/> + <result property="workingVoltage" column="working_voltage" jdbcType="DECIMAL"/> + <result property="workApplyId" column="work_apply_id" jdbcType="BIGINT"/> + <result property="equipmentAndPower" column="equipment_and_power" jdbcType="VARCHAR"/> + <result property="status" column="status" jdbcType="TINYINT"/> + <result property="gmtCreate" column="gmt_create" jdbcType="TIMESTAMP"/> + <result property="createUid" column="create_uid" jdbcType="BIGINT"/> + <result property="createUname" column="create_uname" jdbcType="VARCHAR"/> + <result property="gmtModified" column="gmt_modified" jdbcType="TIMESTAMP"/> + <result property="modifiedUid" column="modified_uid" jdbcType="BIGINT"/> + <result property="modifiedUname" column="modified_uname" jdbcType="VARCHAR"/> + </resultMap> + + + <!--查询数据--> + <select id="listByConditions" resultMap="WorkTemporaryPowerInfoMap" parameterType="com.gk.hotwork.specialWork.model.query.WorkTemporaryPowerQuery"> + select + id, power_access_point, working_voltage, work_apply_id, equipment_and_power, status, gmt_create, create_uid, create_uname, gmt_modified, modified_uid, modified_uname + from work_temporary_power + <where> + + <if test="workApplyId != null"> + and work_apply_id = #{workApplyId} + </if> + + <if test="status != null"> + and status = #{status} + </if> + + </where> + </select> + + <!--通过主键idList删除数据--> + <update id="updateStatutsByIds"> + update work_temporary_power + set status = #{status} + where id in + <foreach collection="idList" item="id" index="index" open="(" close=")" separator=","> + #{id} + </foreach> + </update> + +</mapper> + diff --git a/src/main/java/com/gk/hotwork/Scheduls/TaskPdf/TaskPdfRobot.java b/src/main/java/com/gk/hotwork/Scheduls/TaskPdf/TaskPdfRobot.java new file mode 100644 index 0000000..5ff2f30 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/TaskPdf/TaskPdfRobot.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Scheduls.TaskPdf; + + +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Service.TaskService; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +@Component +@EnableScheduling +@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true") +public class TaskPdfRobot { + + private Logger logger = LogManager.getLogger(TaskPdfRobot.class); + + + @Autowired + private TaskService taskService; + + + @Scheduled(cron = "0/20 * * * * ?") //每隔30秒执行一次 + public void AllTaskCertRobot(){ + try { + //1.所有状态为7的单子编号 + + List<TaskInfo> toPdfData = taskService.selectAllWorkCertUndone(); + for (TaskInfo task : toPdfData) { + String relativePath = taskService.generateAllWorkCert(task.getCode()); + task.setPath(relativePath); + //更新path + taskService.updateById(task); + logger.info("===票证生成:" + task.getCode() +"==="); + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/location/DeviceDataPersisting.java b/src/main/java/com/gk/hotwork/Scheduls/location/DeviceDataPersisting.java new file mode 100644 index 0000000..6525e6a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/location/DeviceDataPersisting.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.Scheduls.location; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Domain.DeviceLocation; +import com.gk.hotwork.Domain.DevicePing; +import com.gk.hotwork.Domain.DevicePressKey; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Service.DeviceLocationService; +import com.gk.hotwork.Service.DevicePingService; +import com.gk.hotwork.Service.DevicePressKeyService; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.Date; + +//@Component +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling",name = "enabled",havingValue = "true") +public class DeviceDataPersisting { + + private Logger logger = LogManager.getLogger(DeviceDataPersisting.class); + + @Value("${scheduling.enabled}") + private boolean isSwitch; + @Value("${slice.size}") + private Integer sliceSize; + @Autowired + private IRedisService redisService; + @Autowired + private DevicePingService devicePingService; + @Autowired + private DevicePressKeyService devicePressKeyService; + @Autowired + private DeviceLocationService deviceLocationService; + +// @Scheduled(cron = "0/1 * * * * ?") //每隔1秒执行一次 + public void locationDataPersisting() { + redisService.setDbIndex(1); + String key = "device:location"; + while (redisService.hasKey(key) && redisService.listSize(key) > 0) { + try { String res = redisService.leftPop(key); + if (StringUtils.isBlank(res)) return; + DeviceLocation deviceLocation = JSONObject.parseObject(res, DeviceLocation.class); + deviceLocation.setCreateTime(new Date()); + deviceLocationService.insertRecord(deviceLocation); + } catch (BusinessException e) { + e.printStackTrace(); + logger.warn(e.getMessage()); + } + } + } + + + + + + +// @Scheduled(cron = "0/10 * * * * ?") //每隔10秒执行一次 + public void pingDataPersisting() { + redisService.setDbIndex(2); + String key = "device:ping"; + while (redisService.hasKey(key) && redisService.listSize(key) > 0){ + String res = redisService.leftPop(key); + if (StringUtils.isBlank(res)) return; + DevicePing devicePing = JSONObject.parseObject(res, DevicePing.class); + devicePing.setCreateTime(new Date()); + devicePingService.save(devicePing); + } + + } + + + + + @Scheduled(cron = "0/10 * * * * ?") //每隔10秒执行一次 + public void pressKeyDataPersisting() { + redisService.setDbIndex(3); + String key = "device:presskey"; + while (redisService.hasKey(key) && redisService.listSize(key) > 0){ + String res = redisService.leftPop(key); + if (StringUtils.isBlank(res)) return; + DevicePressKey devicePressKey = JSONObject.parseObject(res, DevicePressKey.class); + devicePressKey.setCreateTime(new Date()); + devicePressKeyService.save(devicePressKey); + } + + } + + + /** + * @Description: 定位信息只保留90天信息 每天0点执行 + * @date 2021/12/27 15:12 + */ + @Scheduled(cron = "0 0 0 * * ?") + public void deviceLocationCleanUp() { + //location + deviceLocationService.cleanUp(sliceSize,90); + } +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/location/LocationReceiver.java b/src/main/java/com/gk/hotwork/Scheduls/location/LocationReceiver.java new file mode 100644 index 0000000..bd4caeb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/location/LocationReceiver.java @@ -0,0 +1,130 @@ +package com.gk.hotwork.Scheduls.location; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Domain.Exception.BusinessException; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.nio.charset.StandardCharsets; +import java.util.Base64; + + +//@Configuration +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling",name = "enabled",havingValue = "true") +public class LocationReceiver { + private Logger logger = LogManager.getLogger(getClass()); + + private boolean isopen = false; + + @Value("${location.port}") + private int receiverPort; + @Autowired + private IRedisService redisService; + + @Scheduled(initialDelay = 10000, fixedDelay = 30000) + public void start() { + if (isopen) { + return; + } + try { + isopen = true; + DatagramSocket server = new DatagramSocket(receiverPort); + // 2,准备接收容器 + byte[] container = new byte[1024]; + // 3,封装成包 new DatagramPacket(byte[] b,int length) + DatagramPacket receiver = new DatagramPacket(container, container.length); + logger.error("UDP服务端"+receiverPort+"已经开启,等待设备上报数据......"); + while (true) { + try { + //服务器端接收来自客户端的数据 + server.receive(receiver); + InetAddress address = receiver.getAddress();//获取发送端的 IP 对象 + byte[] data = receiver.getData();//获取接收到的数据 + int length = receiver.getLength();//获取具体收到数据的长度 + String dataStr = new String(data, 0, length); +// handleData(dataStr); + }catch (Exception e){ + e.printStackTrace(); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + public void handleData(String dataStr) { + String content = ""; + if (dataStr.startsWith("json")) { + //括号截取 + int i = dataStr.indexOf("{"); + int j = dataStr.lastIndexOf("}"); + content = dataStr.substring(i, j + 1); + } + + else if (dataStr.startsWith("base64-json")) { + //,分隔 第4个 + String base64Content = dataStr.split(",")[3]; + content = new String(Base64.getDecoder().decode(base64Content), StandardCharsets.UTF_8); + + } + + else{ + throw new BusinessException("协议头对应不上"); + } + + JSONObject contentObj = JSONObject.parseObject(content); + String params = contentObj.getString("params"); + String method = contentObj.getString("method"); + + //根据method判断处理方式 + + { + + String standardMethod = method.toLowerCase(); + if ("location".equals(standardMethod)) { + //DeviceLocation deviceLocation = JSONObject.parseObject(params, DeviceLocation.class); + String key = "device:location"; + redisService.setDbIndex(1); + redisService.setExpiredTime(key,30*60); + redisService.rightPush(key, params); + } + if ("ping".equals(standardMethod)) { + //DevicePing devicePing = JSONObject.parseObject(params, DevicePing.class); + String key = "device:ping"; + redisService.setDbIndex(2); + redisService.setExpiredTime(key,30*60); + redisService.rightPush(key, params); + } + if ("presskey".equals(standardMethod)) { + //DevicePressKey devicePressKey = JSONObject.parseObject(params, DevicePressKey.class); + String key = "device:presskey"; + redisService.setDbIndex(3); + redisService.setExpiredTime(key,30*60); + redisService.rightPush(key, params); + } + + } + } + + + + + + + + + + +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/location/LocationTask.java b/src/main/java/com/gk/hotwork/Scheduls/location/LocationTask.java new file mode 100644 index 0000000..9e1044f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/location/LocationTask.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.Scheduls.location; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author : jingjy + * @date : 2021/12/7 17:29 + */ +//@Configuration +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true") +public class LocationTask { + private final UserService userService; + + public LocationTask(UserService userService) { + this.userService = userService; + } + +// @Scheduled(cron = "0/10 * * * * ?") //每隔10秒执行一次 + public void getCross() throws Exception { + Msg msg = userService.getRealGps(); + if (msg.getCode().equals(ErrorCode.SUCCESS.getCode())){ +// JSONObject jsonResult = JSONObject.parseObject(); +// String status = jsonResult.getString("status"); +// String msgInfo = jsonResult.getString("msginfo"); +// +// if (status.equals("1")){ +// return; +// } + JSONArray array = JSONArray.parseArray(msg.getResult().toString()); + if (array == null){ + return; + } + + for(int i = 0; i < array.size(); i++){ + JSONObject object = array.getJSONObject(i); + String deviceNo = object.getString("deviceNo"); + String empNo = object.getString("empNo"); + String name = object.getString("empName"); + if (StringUtils.isBlank(deviceNo)){ + return; + } + UserInfo userInfo = userService.selectUserByCard(deviceNo,empNo,name); + if (userInfo == null){ + continue; + } + String crossX = object.getString("crossX"); + crossX =StringUtils.isBlank(crossX)?"0":crossX; + String crossY = object.getString("crossY"); + crossY =StringUtils.isBlank(crossY)?"0":crossY; + userInfo.setCrossX(new BigDecimal(crossX)); + userInfo.setCrossY(new BigDecimal(crossY)); + + BigDecimal latitude = object.getBigDecimal("latitude"); + BigDecimal longitude = object.getBigDecimal("longitude"); + Integer area = object.getInteger("area"); + String layer = object.getString("layer"); + userInfo.setLatitude(latitude); + userInfo.setLongitude(longitude); + userInfo.setArea(area); + userInfo.setLayer(layer); + userInfo.setUpdateat(new Date()); + userService.updateById(userInfo); + } + } + + } +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/updateToken/updateTokenTask.java b/src/main/java/com/gk/hotwork/Scheduls/updateToken/updateTokenTask.java new file mode 100644 index 0000000..05650b2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/updateToken/updateTokenTask.java @@ -0,0 +1,83 @@ +package com.gk.hotwork.Scheduls.updateToken; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Base64Encrypt; +import com.gk.hotwork.Domain.Utils.HttpUtils; +import com.gk.hotwork.Domain.VideoInfo; +import com.gk.hotwork.Service.UserService; +import com.gk.hotwork.Service.VideoService; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +//@Configuration +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling",name = "enabled",havingValue = "true") +public class updateTokenTask { + private Logger logger = LogManager.getLogger(updateTokenTask.class); + + @Value("${nanowebUrl}") + private String nanoweb; + @Value("${nanowebEnable}") + private Boolean nanowebEnable; + @Autowired + private VideoService videoService; + +// @Scheduled(cron = "0 0 0/1 * * ?") //每小时执行一次 +// @Scheduled(cron = "0/10 * * * * ?") //每十秒执行一次 + public void startRefreshToken() throws Exception{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date now = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(now); + calendar.add(Calendar.DATE, 1); + Date endtime = calendar.getTime(); + String endtimeStr = sdf.format(endtime); + List<VideoInfo> videoInfoList = videoService.selectByTime(endtimeStr); + if (videoInfoList.size() > 0){ + for (VideoInfo videoInfo : videoInfoList) { + String url="https://open.ys7.com/api/lapp/token/get?appKey="+videoInfo.getAppkey()+"&appSecret="+videoInfo.getSecret(); + CloseableHttpClient client = HttpClients.createDefault(); + HttpPost post = new HttpPost(url); + post.setHeader("Content-Type", "application/x-www-form-urlencoded"); + CloseableHttpResponse response = client.execute(post); + String resData = EntityUtils.toString(response.getEntity(),"UTF-8"); + client.close(); + + System.out.println(resData); + + JSONObject result = JSONObject.parseObject(resData); + Integer code = result.getInteger("code"); + if(code!=null && code==200){ + JSONObject data = JSONObject.parseObject(result.getString("data")); + String accessToken = data.getString("accessToken"); + Long expireTime = data.getLong("expireTime"); + videoInfo.setExpiretime(new Date(expireTime)); + videoInfo.setToken(accessToken); + videoInfo.setUpdatetime(new Date()); + videoService.updateById(videoInfo); + } + } + } + } + + +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/uploadUser/uploadUserTask.java b/src/main/java/com/gk/hotwork/Scheduls/uploadUser/uploadUserTask.java new file mode 100644 index 0000000..815705b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/uploadUser/uploadUserTask.java @@ -0,0 +1,77 @@ +package com.gk.hotwork.Scheduls.uploadUser; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Base64Encrypt; +import com.gk.hotwork.Domain.Utils.HttpUtils; +import com.gk.hotwork.Service.UserService; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +//@Configuration +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling",name = "enabled",havingValue = "true") +public class uploadUserTask { + private Logger logger = LogManager.getLogger(uploadUserTask.class); + + @Value("${nanowebUrl}") + private String nanoweb; + @Value("${nanowebEnable}") + private Boolean nanowebEnable; + @Autowired + private UserService userService; + + @Scheduled(cron = "0/30 * * * * ?") //每隔30秒执行一次 + public void uploadUser() throws UnsupportedEncodingException { + if (nanowebEnable){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List<UserInfo> users = userService.selectNotUpload(); + if (users.size() > 0){ + String respnse = null; + JSONArray jsonArray = new JSONArray(); + for (UserInfo userInfo : users) { + JSONObject jsonParam = new JSONObject(); + jsonParam.put("name", userInfo.getRealname()); + jsonParam.put("password", new String(Base64Encrypt.decode(users.get(0).getPassword()),"utf-8")); + jsonParam.put("tel", userInfo.getUsername()); + jsonParam.put("idno", userInfo.getIdcard()); + jsonParam.put("company", userInfo.getCompany()); + jsonParam.put("department", userInfo.getDepartment()); + jsonParam.put("email", userInfo.getEmail()); + jsonArray.add(jsonParam); + } + String param = jsonArray.toJSONString(); + try { + respnse = HttpUtils.sendPost(nanoweb, param); + JSONObject jsonResult = JSONObject.parseObject(respnse); + String code = jsonResult.getString("code"); + if (("success").equals(code)) { + logger.error("在时间为" + sdf.format(new Date()) + "上传成功" ); + for (UserInfo userInfo : users) { + userInfo.setIsupload((byte)1); + userService.updateById(userInfo); + } + } else { + logger.error("在时间为" + sdf.format(new Date()) + "上传失败" + code); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + + +} diff --git a/src/main/java/com/gk/hotwork/Scheduls/warning/Warning.java b/src/main/java/com/gk/hotwork/Scheduls/warning/Warning.java new file mode 100644 index 0000000..667556e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Scheduls/warning/Warning.java @@ -0,0 +1,173 @@ +package com.gk.hotwork.Scheduls.warning; + +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Enum.TaskType; +import com.gk.hotwork.Domain.Vo.TaskVo; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; +import com.gk.hotwork.Scheduls.uploadUser.uploadUserTask; +import com.gk.hotwork.Service.TaskGasService; +import com.gk.hotwork.Service.TaskService; +import com.gk.hotwork.Service.WarningService; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.util.Date; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/9/9 10:38 + */ +//@Configuration +//@EnableScheduling +//@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true") +public class Warning { + @Autowired + private TaskGasService taskGasService; + @Autowired + private WarningService warningService; + @Autowired + private TaskService taskService; + + @Scheduled(cron = "0/30 * * * * ?") //每隔30秒执行一次 + public void setWarning(){ + Date now = new Date(); + Date startTime = new Date(now.getTime() - 2*60*1000); + List<TaskVo> taskVos = taskService.getDoingTask(); + if (taskVos == null || taskVos.size() < 1){ + return; + } + for (TaskVo taskVo : taskVos){ + List<TaskWorkerVo>taskWorkers = taskVo.getTaskWorkers(); + for (TaskWorkerVo taskWorkerVo : taskWorkers){ + //检查设备是否齐全 + boolean result = hasNecessaryEquipment(taskWorkerVo); + //判断当前动火人是否有设备,没有则不进行下面判断 + if (!result){ + continue; + } + //报警 + List<TaskGasInfo>taskGasInfos = taskGasService.getWarnList(taskVo.getCode(),taskWorkerVo.getWorker(),startTime,now); + dealWarn(taskGasInfos,taskWorkerVo,"报警",now); + + //预警 + List<TaskGasInfo>taskGasInfoList = taskGasService.getEarlyWarnList(taskVo.getCode(),taskWorkerVo.getWorker(),startTime,now); + dealWarn(taskGasInfoList,taskWorkerVo,"预警",now); + + //故障 + boolean isEquipmentError = taskGasService.isEquipmentError(taskVo.getCode(),taskWorkerVo.getWorker(),startTime,now); + if (isEquipmentError){ + WarningInfo warningInfo = new WarningInfo(); + String content = "在任务 "+taskWorkerVo.getTaskcode()+" 中,动火人:"+taskWorkerVo.getWorker()+"气体探测器故障"; + warningInfo.setCreatedat(now); + warningInfo.setTaskcode(taskWorkerVo.getTaskcode()); + warningInfo.setTasktype(TaskType.getTaskType(taskWorkerVo.getTasktype())); + warningInfo.setContent(content); + warningInfo.setType(WarningInfo.FAULT); + warningInfo.setWorker(taskWorkerVo.getWorker()); + warningService.save(warningInfo); + }else { + String type = "故障"; + List<WarningInfo>warningInfos = warningService.getBeforeWarn(taskWorkerVo.getTaskcode(),taskWorkerVo.getWorker(),type,now); + if (warningInfos != null && warningInfos.size() > 0){ + for (WarningInfo warningInfo : warningInfos){ + warningInfo.setIsdeal((byte)1); + } + warningService.updateBatchById(warningInfos); + } + } + } + + } + + } + + private void dealWarn(List<TaskGasInfo> taskGasInfos, TaskWorkerVo taskWorkerVo, String type, Date now) { + if (taskGasInfos != null && taskGasInfos.size() > 0){ + for (TaskGasInfo taskGasInfo : taskGasInfos){ + String content = "在任务 "+taskWorkerVo.getTaskcode()+" 中,动火人:"+taskWorkerVo.getWorker()+"气体探测器数据异常," + +taskGasInfo.getGastype()+":"+taskGasInfo.getGasvalue()+taskGasInfo.getGasunit(); + WarningInfo warningInfo = new WarningInfo(); + warningInfo.setCreatedat(taskGasInfo.getUpdatetime()); + warningInfo.setTaskcode(taskGasInfo.getTaskcode()); + warningInfo.setWorker(taskWorkerVo.getWorker()); + warningInfo.setTasktype(TaskType.getTaskType(taskWorkerVo.getTasktype())); + if (taskGasInfo.getIswarn() == 1){ + warningInfo.setContent(content); + warningInfo.setType(WarningInfo.WARNING); + WarningInfo warningInfoExist = warningService.getByContent(taskWorkerVo.getTaskcode(),taskWorkerVo.getWorker(),content); + if (warningInfoExist == null){ + warningService.save(warningInfo); + } + } + if (taskGasInfo.getIsyujing() == 1){ + warningInfo.setContent(content); + warningInfo.setType(WarningInfo.EARLY_WARNING); + WarningInfo warningInfoExist = warningService.getByContent(taskWorkerVo.getTaskcode(),taskWorkerVo.getWorker(),content); + if (warningInfoExist == null){ + warningService.save(warningInfo); + } + } + } + }else { + List<WarningInfo>warningInfos = warningService.getBeforeWarn(taskWorkerVo.getTaskcode(),taskWorkerVo.getWorker(),type,now); + if (warningInfos != null && warningInfos.size() > 0){ + for (WarningInfo warningInfo : warningInfos){ + warningInfo.setIsdeal((byte)1); + } + warningService.updateBatchById(warningInfos); + } + } + } + + private boolean hasNecessaryEquipment(TaskWorkerVo taskWorkerVo) { + List<EquipmentInfo> equipmentInfos = taskWorkerVo.getEquipments(); + if (equipmentInfos == null || equipmentInfos.size() < 1){ + return false; + } + boolean hasGasDetector = false; + boolean hasHelmet = false; + String content; + for (EquipmentInfo equipmentInfo : equipmentInfos){ + if (equipmentInfo.getName().equals("气体探测器")){ + hasGasDetector = true; + } + if (equipmentInfo.getName().equals("头盔")){ + hasHelmet = true; + } + } + + WarningInfo warningInfo = new WarningInfo(); + warningInfo.setCreatedat(new Date()); + warningInfo.setTaskcode(taskWorkerVo.getTaskcode()); + warningInfo.setTasktype(TaskType.getTaskType(taskWorkerVo.getTasktype())); + warningInfo.setType(WarningInfo.WARNING); + warningInfo.setWorker(taskWorkerVo.getWorker()); + if (!hasGasDetector){ + content = "在任务 "+taskWorkerVo.getTaskcode()+" 中,动火人:"+taskWorkerVo.getWorker()+"缺少气体探测器"; + warningInfo.setContent(content); + WarningInfo warningInfoExist = warningService.getByContent(taskWorkerVo.getTaskcode(), taskWorkerVo.getWorker(), content); + if (warningInfoExist == null){ + warningService.save(warningInfo); + } + } + if (!hasHelmet){ + content = "在任务 "+taskWorkerVo.getTaskcode()+" 中,动火人:"+taskWorkerVo.getWorker()+"缺少头盔"; + warningInfo.setContent(content); + WarningInfo warningInfoExist = warningService.getByContent(taskWorkerVo.getTaskcode(),taskWorkerVo.getWorker(),content); + if (warningInfoExist == null){ + warningService.save(warningInfo); + } + } + + return true; + } + + + +} diff --git a/src/main/java/com/gk/hotwork/Service/AppFileService.java b/src/main/java/com/gk/hotwork/Service/AppFileService.java new file mode 100644 index 0000000..4a712da --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/AppFileService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.AppFileInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +public interface AppFileService extends IService<AppFileInfo> { + + void selectDataGrid(PageInfo pageInfo); + + AppFileInfo selectNew(String filetype); +} diff --git a/src/main/java/com/gk/hotwork/Service/AuthorizationService.java b/src/main/java/com/gk/hotwork/Service/AuthorizationService.java new file mode 100644 index 0000000..d829f7f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/AuthorizationService.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.AuthorizationInfo; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/7/2 9:41 + */ +public interface AuthorizationService extends IService<AuthorizationInfo> { + + AuthorizationInfo selectByUser(String enterprisenumber, String authcode); + + List<AuthorizationInfo> getAuthByEnterprise(String enterpriseNumber); + + boolean checkPrefixExist(String prefix); + + boolean checkCodeExist(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/BlackListService.java b/src/main/java/com/gk/hotwork/Service/BlackListService.java new file mode 100644 index 0000000..4b45571 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/BlackListService.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.BlackListInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +/** + * @author : jingjy + * @date : 2021/10/18 16:38 + */ +public interface BlackListService extends IService<BlackListInfo> { + BlackListInfo getBlackListByName(String company); + + void selectDataGrid(PageInfo pageInfo); +} diff --git a/src/main/java/com/gk/hotwork/Service/CompanyService.java b/src/main/java/com/gk/hotwork/Service/CompanyService.java new file mode 100644 index 0000000..ff5bd56 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/CompanyService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.CompanyInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +import java.util.List; + +public interface CompanyService extends IService<CompanyInfo> { + + void selectDataGrid(PageInfo pageInfo); + + CompanyInfo selectExistByName(Long id, String company); + + CompanyInfo selectByName(String company); + + List<CompanyInfo> selectByAll(); + + CompanyInfo selectExistMain(Long id); + + boolean isMain(String company); +} diff --git a/src/main/java/com/gk/hotwork/Service/DepartmentService.java b/src/main/java/com/gk/hotwork/Service/DepartmentService.java new file mode 100644 index 0000000..00e2b70 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DepartmentService.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Vo.DepartmentVo; + +import java.util.List; + +public interface DepartmentService extends IService<DepartmentInfo> { + + void selectDataGrid(PageInfo pageInfo); + + DepartmentInfo selectExistByName(Long id, String department); + + List<DepartmentVo> selectByAll(); + + DepartmentInfo selectSafety(Long id); + + DepartmentInfo selectSafetyDepartment(); + + DepartmentInfo selectAnalysis(Long id); + + boolean isAnalysis(String department); + + Integer selectCountForExam(String name); + + List<DepartmentInfo> selectPageForExam(String name, Integer first, Integer pageSize); + + DepartmentInfo getInfoByName(String departmentName); + + DepartmentInfo getDepartmentInfoById(Long execDepId); + + List<DepartmentInfo> listDepByDepIds(List<Long> depIds); + + List<DepartmentInfo> listDepartmentInfoById(); +} diff --git a/src/main/java/com/gk/hotwork/Service/DeviceLocationService.java b/src/main/java/com/gk/hotwork/Service/DeviceLocationService.java new file mode 100644 index 0000000..2e8c8dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DeviceLocationService.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Service; + + +import com.gk.hotwork.Domain.DeviceLocation; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.Date; +import java.util.List; + +public interface DeviceLocationService { + + void insertRecord(DeviceLocation location); + + DeviceLocation selectByUser(UserInfo user); + + List<DeviceLocation> selectUserLocations(String username, Date starttime, Date endtime); + + void cleanUp(Integer slice,Integer days); + +} diff --git a/src/main/java/com/gk/hotwork/Service/DevicePingService.java b/src/main/java/com/gk/hotwork/Service/DevicePingService.java new file mode 100644 index 0000000..f661073 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DevicePingService.java @@ -0,0 +1,7 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DevicePing; + +public interface DevicePingService extends IService<DevicePing> { +} diff --git a/src/main/java/com/gk/hotwork/Service/DevicePressKeyService.java b/src/main/java/com/gk/hotwork/Service/DevicePressKeyService.java new file mode 100644 index 0000000..69496f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DevicePressKeyService.java @@ -0,0 +1,7 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DevicePressKey; + +public interface DevicePressKeyService extends IService<DevicePressKey> { +} diff --git a/src/main/java/com/gk/hotwork/Service/DictionaryItemService.java b/src/main/java/com/gk/hotwork/Service/DictionaryItemService.java new file mode 100644 index 0000000..3cfae18 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DictionaryItemService.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DictionaryItemInfo; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +import java.util.List; + +public interface DictionaryItemService extends IService<DictionaryItemInfo> { + + void selectDataGrid(PageInfo pageInfo); + + DictionaryItemInfo selctByText(String text); + + DictionaryItemInfo selctByValue(String value); + + List<DictionaryTypeInfo> selectExistInfo(Long id, String value, String text); + + List<DictionaryItemInfo> selectByType(String dictionaryType); +} diff --git a/src/main/java/com/gk/hotwork/Service/DictionaryTypeService.java b/src/main/java/com/gk/hotwork/Service/DictionaryTypeService.java new file mode 100644 index 0000000..408061e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DictionaryTypeService.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +import java.util.List; + +public interface DictionaryTypeService extends IService<DictionaryTypeInfo> { + + void selectDataGrid(PageInfo pageInfo); + + DictionaryTypeInfo selctByCode(String code); + + DictionaryTypeInfo selctByText(String text); + + List<DictionaryTypeInfo> selectExistInfo(Long id, String code, String text); +} diff --git a/src/main/java/com/gk/hotwork/Service/DistrictService.java b/src/main/java/com/gk/hotwork/Service/DistrictService.java new file mode 100644 index 0000000..2133e28 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/DistrictService.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DistrictInfo; + +import java.util.List; + +public interface DistrictService extends IService<DistrictInfo> { + + List<DistrictInfo> selectDistrictInfo(String type, String parentcode); + + DistrictInfo selectInfoByName(String name, Byte type); + + DistrictInfo selectInfoByCode(String code, Byte type); + + List<DistrictInfo> selectDistrictByName(String type, String parentname, String parenttype); + + List<DistrictInfo> selectInfoByParentCode(String s); + + List<DistrictInfo> selectInfoByParentCodeAndCity(String s, Object city); +} diff --git a/src/main/java/com/gk/hotwork/Service/ElementManagementService.java b/src/main/java/com/gk/hotwork/Service/ElementManagementService.java new file mode 100644 index 0000000..542e744 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ElementManagementService.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.ElementManagement; +import com.gk.hotwork.Domain.ElementTree; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; + +public interface ElementManagementService extends IService<ElementManagement> { + + /** + * @Description: 分页 + */ + IPage<ElementManagement> selectPage(Page<ElementManagement> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(ElementManagement param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(ElementManagement param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + /** + * 获取所有的父要素 + * @return + */ + List<ElementManagement> getParentElement(); + + List<ElementTree> getElementTree(); + +} diff --git a/src/main/java/com/gk/hotwork/Service/EmergencyPlanService.java b/src/main/java/com/gk/hotwork/Service/EmergencyPlanService.java new file mode 100644 index 0000000..3fc8e70 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/EmergencyPlanService.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.EmergencyPlan; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.Map; + +public interface EmergencyPlanService extends IService<EmergencyPlan> { + + /** + * @Description: 分页 + */ + IPage<EmergencyPlan> selectPage(Page<EmergencyPlan> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(EmergencyPlan param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(EmergencyPlan param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/EquipmentService.java b/src/main/java/com/gk/hotwork/Service/EquipmentService.java new file mode 100644 index 0000000..4d1c4ed --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/EquipmentService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +import java.util.List; + +public interface EquipmentService extends IService<EquipmentInfo> { + + void selectDataGrid(PageInfo pageInfo); + + EquipmentInfo selectExistByNumber(Long id, String number); + + EquipmentInfo selectByNumber(String equipmentnumber); + + List<EquipmentInfo> selectByTask(String taskcode); + + List<EquipmentInfo> selectByTaskAndWorker(String code, String worker); + + List<EquipmentInfo> selectUsingByTask(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/ExamScoreService.java b/src/main/java/com/gk/hotwork/Service/ExamScoreService.java new file mode 100644 index 0000000..9a40241 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ExamScoreService.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.Vo.ExamScoreVo; + +import java.util.List; +import java.util.Map; + +public interface ExamScoreService extends IService<ExamScoreInfo> { + + ExamScoreInfo selectByMobile(String examtype,String mobile); + + List<ExamScoreVo> selectByAll(String username); +} diff --git a/src/main/java/com/gk/hotwork/Service/ExcelExportService.java b/src/main/java/com/gk/hotwork/Service/ExcelExportService.java new file mode 100644 index 0000000..6cc49fa --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ExcelExportService.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Service; + +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.BooleanReason; + +import java.io.InputStream; + +public interface ExcelExportService { + + BooleanReason importDistrictExcel(InputStream in,String operator, Boolean isExcel2007); + + + void importUserExcel(InputStream in, String operator, Boolean isExcel2007); + + + BooleanReason imporSelfCheckExcel(InputStream in, String username, Boolean isExcel2007); + + BooleanReason importSupplierUserExcel(InputStream in, String realname, String company, Boolean isExcel2007); + + void importRiskEventExcel(InputStream in, String operator, Boolean isExcel2007); + + void importRiskAnaUnitExcel(InputStream in, String operator, Boolean isExcel2007); + + void importRiskControlMeasureExcel(InputStream in, String operator, Boolean isExcel2007); + + /** 生产装置导入*/ + void importRiskSourceExcel(InputStream in, String realname, Boolean isExcel2007); +} diff --git a/src/main/java/com/gk/hotwork/Service/FourColorMap2Service.java b/src/main/java/com/gk/hotwork/Service/FourColorMap2Service.java new file mode 100644 index 0000000..ceed26d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/FourColorMap2Service.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Service; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.FourColorMap2; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; + +public interface FourColorMap2Service extends IService<FourColorMap2> { + + void addOne(JSONObject mapJson, UserInfo userInfo); + + List<FourColorMap2> getList2(Integer eType); + + void delOne(Long id); +} diff --git a/src/main/java/com/gk/hotwork/Service/FourColorMapService.java b/src/main/java/com/gk/hotwork/Service/FourColorMapService.java new file mode 100644 index 0000000..b3479fd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/FourColorMapService.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.Service; + +import cn.hutool.json.JSONObject; +import com.gk.hotwork.Domain.dto.FourColorMapDto; + +import java.util.List; + +public interface FourColorMapService { + + String insertOneMapPoint(FourColorMapDto mapDto); + + boolean deleteMap(String id); + + JSONObject getOnePointJsonById(String id); + + List<JSONObject> getPointListJson(int etype); +} diff --git a/src/main/java/com/gk/hotwork/Service/FourColorPointCoordService.java b/src/main/java/com/gk/hotwork/Service/FourColorPointCoordService.java new file mode 100644 index 0000000..070f0e4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/FourColorPointCoordService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.FourColorPointCoord; + +import java.util.List; + +public interface FourColorPointCoordService extends IService<FourColorPointCoord> { + + List<FourColorPointCoord> findCoordListByPointId(String pointId); +} diff --git a/src/main/java/com/gk/hotwork/Service/FourColorPointService.java b/src/main/java/com/gk/hotwork/Service/FourColorPointService.java new file mode 100644 index 0000000..324ae32 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/FourColorPointService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.FourColorPoint; + +import java.util.List; + +public interface FourColorPointService extends IService<FourColorPoint> { + + List<FourColorPoint> findPointListByEtype(int etype); +} diff --git a/src/main/java/com/gk/hotwork/Service/GasWarnService.java b/src/main/java/com/gk/hotwork/Service/GasWarnService.java new file mode 100644 index 0000000..4fe2969 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/GasWarnService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.GasWarnInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +public interface GasWarnService extends IService<GasWarnInfo> { + + void selectDataGrid(PageInfo pageInfo); + + GasWarnInfo selectExistByType(Long id,String warntype, String gastype); + + GasWarnInfo selectByType(String gastype,String warntype); +} diff --git a/src/main/java/com/gk/hotwork/Service/HelpDocService.java b/src/main/java/com/gk/hotwork/Service/HelpDocService.java new file mode 100644 index 0000000..6a12924 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/HelpDocService.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.HelpDocInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +/** + * @author : jingjy + * @date : 2021/6/16 10:20 + */ +public interface HelpDocService extends IService<HelpDocInfo> { + void selectDataGrid(PageInfo pageInfo); +} diff --git a/src/main/java/com/gk/hotwork/Service/HiddenDangerLogService.java b/src/main/java/com/gk/hotwork/Service/HiddenDangerLogService.java new file mode 100644 index 0000000..a802766 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/HiddenDangerLogService.java @@ -0,0 +1,7 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.HiddenDangerLog; + +public interface HiddenDangerLogService extends IService<HiddenDangerLog> { +} diff --git a/src/main/java/com/gk/hotwork/Service/HiddenDangerResourceService.java b/src/main/java/com/gk/hotwork/Service/HiddenDangerResourceService.java new file mode 100644 index 0000000..a9ebca7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/HiddenDangerResourceService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.HiddenDangerResource; + +import java.util.List; + +public interface HiddenDangerResourceService extends IService<HiddenDangerResource> { + List<HiddenDangerResource> getResourcesByDangerId(Long id, String operation); +} diff --git a/src/main/java/com/gk/hotwork/Service/HiddenDangerService.java b/src/main/java/com/gk/hotwork/Service/HiddenDangerService.java new file mode 100644 index 0000000..439e89c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/HiddenDangerService.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Service; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.Enum.HiddenDangerApplyStatus; +import com.gk.hotwork.Domain.Enum.HiddenDangerLevel; +import com.gk.hotwork.Domain.Enum.HiddenDangerReportSource; +import com.gk.hotwork.Domain.HiddenDanger; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Vo.HiddenDangerAppVo; +import com.gk.hotwork.Domain.Vo.HiddenDangerBySafeCheckVo; +import com.gk.hotwork.Domain.Vo.HiddenDangerVo; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; + +import java.util.List; +import java.util.Map; + +public interface HiddenDangerService extends IService<HiddenDanger> { + + HiddenDanger addReport(HiddenDangerVo hiddenDangerVo, UserInfo userInfo, HiddenDangerReportSource source); + + boolean addReportBySafeCheck(HiddenDangerBySafeCheckVo vo, UserInfo operator); + + HiddenDanger hiddenDangerRectify(HiddenDangerVo hiddenDangerVo); + + HiddenDanger addReportByApp(HiddenDangerAppVo hiddenDangerAppVo, UserInfo user); + + HiddenDanger rectifyHiddenDangerByApp(HiddenDangerAppVo hiddenDangerAppVo, UserInfo user); + + IPage selectReportPages(Page<HiddenDanger> page, Map filter, UserInfo user); + + IPage selectRectifyPages(Page<HiddenDanger> page, Map filter, UserInfo user); + + PageInfoExtension<Map> selectRectifyStatisticsPages(Page<HiddenDanger> page, Map filter, UserInfo user); + + Integer selectNum(HiddenDangerApplyStatus status); + + + void selectDataGrid(PageInfo pageInfo); + + void selectStatisticsData(PageInfo pageInfo); + + /** + * @Description: 验收整改 + */ + HiddenDanger acceptHiddenDanger(Long id, UserInfo user); + + /** + * @Description: 驳回整改 + */ + HiddenDanger rejectHiddenDanger(Long id, String rejectNote, UserInfo user); + + /** + * @Description: 验收页 + */ + IPage<HiddenDanger> selectAcceptPages(Page<HiddenDanger> page, Map<String, Object> filter, UserInfo user); + + /** + * @Description: 获取一个月当前用户的上报数量 + */ + int countNumInMonth(Long id); + + /** + * @Description: 超期限的某个状态数量 + */ + Integer selectOverTimeNum(HiddenDangerApplyStatus status,Long userId); + + /** + * @Description: 获取几个统计数据 + */ + Map getAppAnalysis(UserInfo userInfo); + + /** + * @Description: 获取当前人数量 + */ + Integer selectCurrentNum(HiddenDangerApplyStatus status, Long userId); +} diff --git a/src/main/java/com/gk/hotwork/Service/InvolveDepService.java b/src/main/java/com/gk/hotwork/Service/InvolveDepService.java new file mode 100644 index 0000000..02fe9c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/InvolveDepService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.InvolveDepInfo; + +public interface InvolveDepService extends IService<InvolveDepInfo> { + + void deleteByName(String department); + +} diff --git a/src/main/java/com/gk/hotwork/Service/MajorEquipmentAlarmService.java b/src/main/java/com/gk/hotwork/Service/MajorEquipmentAlarmService.java new file mode 100644 index 0000000..a3a18d1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/MajorEquipmentAlarmService.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.MajorEquipmentAlarm; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.Map; + +public interface MajorEquipmentAlarmService extends IService<MajorEquipmentAlarm> { + + /** + * @Description: 分页 + */ + IPage<MajorEquipmentAlarm> selectPage(Page<MajorEquipmentAlarm> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(MajorEquipmentAlarm param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(MajorEquipmentAlarm param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/MajorEquipmentDataService.java b/src/main/java/com/gk/hotwork/Service/MajorEquipmentDataService.java new file mode 100644 index 0000000..2b193a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/MajorEquipmentDataService.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.MajorEquipmentData; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; + +public interface MajorEquipmentDataService extends IService<MajorEquipmentData> { + + /** + * @Description: 分页 + */ + IPage<MajorEquipmentData> selectPage(Page<MajorEquipmentData> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(MajorEquipmentData param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(MajorEquipmentData param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + void importData(List<MajorEquipmentData> param, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/MajorEquipmentService.java b/src/main/java/com/gk/hotwork/Service/MajorEquipmentService.java new file mode 100644 index 0000000..8c7d1a2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/MajorEquipmentService.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.MajorEquipment; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; + +public interface MajorEquipmentService extends IService<MajorEquipment> { + + /** + * @Description: 分页 + */ + IPage<MajorEquipment> selectPage(Page<MajorEquipment> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(MajorEquipment param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(MajorEquipment param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + List<MajorEquipment> getMajorEquipment(); +} diff --git a/src/main/java/com/gk/hotwork/Service/Middle/AccountAuthService.java b/src/main/java/com/gk/hotwork/Service/Middle/AccountAuthService.java new file mode 100644 index 0000000..b701f3c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/Middle/AccountAuthService.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.Service.Middle; + +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.UserInfoRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import java.util.List; + + +public interface AccountAuthService { + + ResultVO<UserRPCRespDTO> getUserById(Long uid); + + ResultVO<List<UserInfoRPCRespDTO>> listUserInfoByUids(List<Long> uids); + +} diff --git a/src/main/java/com/gk/hotwork/Service/Middle/AccountDepartmentService.java b/src/main/java/com/gk/hotwork/Service/Middle/AccountDepartmentService.java new file mode 100644 index 0000000..97fc77e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/Middle/AccountDepartmentService.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.Service.Middle; + +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.DepRPCRespDTO; + +import java.util.List; + +public interface AccountDepartmentService { + + + ResultVO<DepInfoRPCRespDTO> getDepInfoByDepId(Long uid,Long depId); + + ResultVO<List<DepInfoRPCRespDTO>> listDepByDepIds(List<Long> depIds); + + ResultVO<List<DepRPCRespDTO>> depList(); +} diff --git a/src/main/java/com/gk/hotwork/Service/PermissionService.java b/src/main/java/com/gk/hotwork/Service/PermissionService.java new file mode 100644 index 0000000..73987ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/PermissionService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.PermissionInfo; +import com.gk.hotwork.Domain.Vo.Menu; + +import java.util.List; + +public interface PermissionService extends IService<PermissionInfo> { + + List<Menu> selectByUserId(String userId); + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ReserveService.java b/src/main/java/com/gk/hotwork/Service/ReserveService.java new file mode 100644 index 0000000..eb5fa7e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ReserveService.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.Reserve; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; + +import java.util.Date; +import java.util.Map; + +public interface ReserveService extends IService<Reserve> { + + /** + * @Description: 新增单子 + */ + void addOne(Reserve reserve, UserInfo userInfo); + + /** + * @Description: 判断预约当日是否存在单子 + */ + boolean isExistAtAppointment(Date appointment,String department); + + /** + * @Description: 修改单子 + */ + void modOne(Reserve reserve, UserInfo user); + + /** + * @Description: 分页查询 + */ + IPage selectPage(Page<Reserve> page, Map<String,Object> filter, UserInfo user); + + /** + * @Description: 统计分页 + */ + PageInfoExtension<Map> statistics(Page<Map> page, Map<String, Object> filter, UserInfo user); + + /** + * @Description: 统计分页 尾部 总计行 + */ + Map statisticsTotal(Map<String, Object> params); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskAnaUnitService.java b/src/main/java/com/gk/hotwork/Service/RiskAnaUnitService.java new file mode 100644 index 0000000..f52068c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskAnaUnitService.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.RiskAnaUintExoprtVo; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** +* @author celin +*/ +public interface RiskAnaUnitService extends IService<RiskAnaUnit> { + + /** + * @Description: 分页 + */ + IPage<RiskAnaUnit> selectPage(Page<RiskAnaUnit> page, Map<String, Object> filter, UserInfo user); + /** + * @Description: 新增一条记录 + */ + void addOne(RiskAnaUnit riskAnaUnit, UserInfo userInfo); + + /** + * @Description: 修改一条记录 + */ + void modOne(RiskAnaUnit riskAnaUnit, UserInfo user); + + /** + * @Description: 删除一条记录 + */ + void delOne(Long id,UserInfo userInfo); + + /** + * @Description: 部门 风险单元个数分布 + */ + List<Map> selectDepartmentAnalysis(); + /** + * @Description: 查询记录 + */ + List<RiskAnaUintExoprtVo> getInfo(HttpServletRequest request, HttpServletResponse response); + /** + * @Description: 根据风险单元名称 查询一条记录 + */ + RiskAnaUnit getInfoByRiskUnitName(String riskUnitName); + /** + * @Description: 导入 + */ + void importRiskAnaUnit(List<RiskAnaUintExoprtVo> param, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskControlClassifyService.java b/src/main/java/com/gk/hotwork/Service/RiskControlClassifyService.java new file mode 100644 index 0000000..1d8f3f7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskControlClassifyService.java @@ -0,0 +1,63 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; +/** +* @author celin +* @date 2022/3/16 15:06 +*/ +public interface RiskControlClassifyService extends IService<RiskControlClassify> { + + /** + * @Description: 分页 + */ + IPage<RiskControlClassify> selectPage(Page<RiskControlClassify> page, Map<String, Object> filter, UserInfo user); + + /** + * @Description: 查询多级所有 + */ + List<RiskControlClassify> selectAll(UserInfo user); + + /** + * @Description: 新增 + */ + void addOne(RiskControlClassify riskControlClassifyVo, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(RiskControlClassify riskControlClassifyVo, UserInfo user); + + /** + * @Description: 删除 + */ + + void delOne(Long id, UserInfo user); + + /** + * @Description: 查询 by 1、2分级 + */ + RiskControlClassify getByClassify1AndClassify12(String classify1 , String classify2); + /** + * @Description: 查询 by 1、2分级 + */ + RiskControlClassify getByClassify1AndClassify2(String trim, String trim1); + /** + * @Description: 查询 by 名字 + */ + RiskControlClassify getByClassify(String classify); + /** + * @Description: 查询 by 名字与parentid + */ + RiskControlClassify getByClassify2(Long id, String trim); + /** + * @Description: 查询 by id + */ + RiskControlClassify getByControlId(Byte classify2); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskControlMeasureService.java b/src/main/java/com/gk/hotwork/Service/RiskControlMeasureService.java new file mode 100644 index 0000000..ba7ba4d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskControlMeasureService.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskControlMeasure; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.RiskControlMeasureExportVo; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** +* @author celin +*/ +public interface RiskControlMeasureService extends IService<RiskControlMeasure> { + + /** + * @Description: 分页 + */ + IPage<RiskControlMeasure> selectPage(Page<RiskControlMeasure> page, Map<String, Object> filter, UserInfo user); + + /** + * @Description: 新增 + */ + void addOne(RiskControlMeasure riskControlMeasureVo,UserInfo userInfo); + + /** + * @Description 修改 + */ + void modOne(RiskControlMeasure riskControlMeasureVo, UserInfo user); + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + /** + * @Description: 导出 + */ + List<RiskControlMeasureExportVo> getRiskControlMeasureList(HttpServletRequest request, HttpServletResponse response) + throws Exception; + + void importRiskControlMeasure(List<RiskControlMeasureExportVo> param, UserInfo user); + /** + * @Description: 查询 by 管控方式 + */ + String getByDataSrc(String trim); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskEventService.java b/src/main/java/com/gk/hotwork/Service/RiskEventService.java new file mode 100644 index 0000000..8c2843a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskEventService.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +public interface RiskEventService extends IService<RiskEvent> { + + /** + * @Description: 分页 + */ + IPage<RiskEvent> selectPage(Page<RiskEvent> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(RiskEvent riskEventVo, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(RiskEvent riskEventVo, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + /** + * @Description: 导出 + */ + List<RiskEventExportVo> getRiskEventList(HttpServletRequest request, HttpServletResponse response); + /** + * @Description: 导入 + */ + void importRiskEventData(List<RiskEventExportVo> param, UserInfo user); + + RiskEvent getByRiskEventName(String riskEventName); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskMapService.java b/src/main/java/com/gk/hotwork/Service/RiskMapService.java new file mode 100644 index 0000000..5bd7c15 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskMapService.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskMap; +import com.gk.hotwork.Domain.Vo.RiskMapVO; + +import java.util.List; + +public interface RiskMapService extends IService<RiskMap> { + + List<RiskMapVO> listByStatus(Byte status); + + String saveOne(RiskMapVO riskMapVO); + + boolean deleteOne(Long id,Long uid); +} diff --git a/src/main/java/com/gk/hotwork/Service/RiskSourceService.java b/src/main/java/com/gk/hotwork/Service/RiskSourceService.java new file mode 100644 index 0000000..fcfaaad --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RiskSourceService.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RiskSource; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.RiskSourceSearchVo; +import com.gk.hotwork.Domain.Vo.RiskSourceVo; +import com.gk.hotwork.Domain.dto.RiskSourceDto; +import com.gk.hotwork.Domain.dto.RiskSourceUpdateDto; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +public interface RiskSourceService extends IService<RiskSource> { + + IPage<RiskSource> findRiskSourceListByConditions(Page<RiskSource> page, RiskSourceSearchVo searchVo); + + RiskSource findById(Long id); + + boolean updateById(RiskSourceUpdateDto riskSourceUpdateDto); + + boolean insertOne(RiskSourceDto riskSourceDto); + + void delOne(Long id, UserInfo user); + + /** 生产装置导出*/ + List<RiskSourceVo> getRiskSourceExport(HttpServletRequest request, HttpServletResponse response); + +} diff --git a/src/main/java/com/gk/hotwork/Service/RolePermissionsService.java b/src/main/java/com/gk/hotwork/Service/RolePermissionsService.java new file mode 100644 index 0000000..aeb77cf --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RolePermissionsService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.RolePermissionsInfo; +import com.gk.hotwork.Domain.Vo.Menu; + +import java.util.List; + +public interface RolePermissionsService extends IService<RolePermissionsInfo> { + + List<Menu> selectMenuList(String roleId); + + void delRolePermissionByRoleId(Long roleid); +} diff --git a/src/main/java/com/gk/hotwork/Service/RoleService.java b/src/main/java/com/gk/hotwork/Service/RoleService.java new file mode 100644 index 0000000..58f39b5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/RoleService.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Config.Oauth2.OauthRole; +import com.gk.hotwork.Domain.RoleInfo; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface RoleService extends IService<RoleInfo> { + + List<RoleInfo> selectRoleByUser(Long id); + + List<RoleInfo> selectList(String name); + + RoleInfo selectRoleByName(RoleInfo roleInfo); + + List<RoleInfo> selectExistRole(Long id, String name); + + List<OauthRole> selectOauthRoleByUser(int i); + + /** + * @Description: 获取总数 + */ + Integer selectCountForRole(String name); + + + /** + * @Description: 根据角色分页 + */ + List<RoleInfo> selectPageForRole(String name, Integer first, Integer pageSize); + + + +} diff --git a/src/main/java/com/gk/hotwork/Service/SafetyInspectionItemService.java b/src/main/java/com/gk/hotwork/Service/SafetyInspectionItemService.java new file mode 100644 index 0000000..0135418 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SafetyInspectionItemService.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SafetyInspectionItem; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; +import java.util.Map; + +public interface SafetyInspectionItemService extends IService<SafetyInspectionItem> { + + /** + * @Description: 分页 + */ + IPage<SafetyInspectionItem> selectPage(Page<SafetyInspectionItem> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(SafetyInspectionItem param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(SafetyInspectionItem param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + List<SafetyInspectionItem> infoElementA(Long id, UserInfo user); + + SafetyInspectionItem info(Long id, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/SafetySelfInspectionService.java b/src/main/java/com/gk/hotwork/Service/SafetySelfInspectionService.java new file mode 100644 index 0000000..ff2b012 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SafetySelfInspectionService.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SafetySelfInspection; +import com.gk.hotwork.Domain.SafetySelfInspectionItem; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.Map; + +public interface SafetySelfInspectionService extends IService<SafetySelfInspection> { + + /** + * @Description: 分页 + */ + IPage<SafetySelfInspection> selectPage(Page<SafetySelfInspection> page, Map<String, Object> filter, UserInfo user); + + + /** + * @Description: 新增 + */ + void addOne(SafetySelfInspection param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(SafetySelfInspection param, UserInfo user); + + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + SafetySelfInspection infoOne(Long id,String unqualified, UserInfo user); + + SafetySelfInspectionItem itemInfoOne(Long id, UserInfo user); + + void modItemInfo(SafetySelfInspectionItem param, UserInfo user); + + void finish(Long id, UserInfo user); +} diff --git a/src/main/java/com/gk/hotwork/Service/SelfCheckService.java b/src/main/java/com/gk/hotwork/Service/SelfCheckService.java new file mode 100644 index 0000000..d4d8c8f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SelfCheckService.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SelfCheckInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Vo.SelfCheckVo; + +import java.util.List; + +public interface SelfCheckService extends IService<SelfCheckInfo> { + + List<SelfCheckVo> selectByType(String type); + + void selectDataGrid(PageInfo pageInfo); + + List<SelfCheckInfo> selectByIds(List<Long> idList); +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountAuthServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountAuthServiceImpl.java new file mode 100644 index 0000000..e953713 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountAuthServiceImpl.java @@ -0,0 +1,90 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.gk.hotwork.Domain.CompanyInfo; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.UserDepRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserEnterpriseRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserInfoRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.CompanyService; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("userTransferService") +public class AccountAuthServiceImpl implements AccountAuthService { + + + @Autowired + private UserService userService; + @Autowired + private DepartmentService departmentService; + @Autowired + private CompanyService companyService; + + @Override + public ResultVO<UserRPCRespDTO> getUserById(Long uid) { + UserRPCRespDTO result = new UserRPCRespDTO(); + if (uid == null) { + throw new BusinessException("用户id为空"); + } + UserInfo userInfo = userService.getById(uid); + if (userInfo != null) { + result.setRealName(userInfo.getRealname()); + result.setUsername(userInfo.getRealname()); + result.setPhone(userInfo.getUsername()); + result.setUid(userInfo.getId() + ""); + UserDepRPCRespDTO userDepRPCRespDTO = new UserDepRPCRespDTO(); + if (userInfo.getDepartment() != null) { + DepartmentInfo dep = departmentService.getById(userInfo.getDepartment()); + if (dep != null) { + userDepRPCRespDTO.setDepId(dep.getId()); + userDepRPCRespDTO.setDepName(dep.getDepartment()); + result.setDepartment(userDepRPCRespDTO); + } + } + + UserEnterpriseRPCRespDTO userEnterpriseRPCRespDTO = new UserEnterpriseRPCRespDTO(); + if (userInfo.getCompanyid() != null) { + CompanyInfo companyInfo = companyService.getById(userInfo.getCompanyid()); + userEnterpriseRPCRespDTO.setId(companyInfo.getId()); + userEnterpriseRPCRespDTO.setName(companyInfo.getCompany()); + result.setEnterprise(userEnterpriseRPCRespDTO); + } + + } + + return new ResultVO<>(ResultCodes.OK,result); + } + + @Override + public ResultVO<List<UserInfoRPCRespDTO>> listUserInfoByUids(List<Long> uids) { + List<UserInfo> userInfos = userService.listByIds(uids); + List<UserInfoRPCRespDTO> result = new ArrayList<>(userInfos.size()); + UserInfoRPCRespDTO respDTO; + for (UserInfo userInfo : userInfos) { + respDTO = new UserInfoRPCRespDTO(); + respDTO.setUid(userInfo.getId()); + respDTO.setUsername(userInfo.getRealname()); + respDTO.setRealName(userInfo.getRealname()); + respDTO.setStatus(userInfo.getStatus()); + respDTO.setPhone(userInfo.getUsername()); + respDTO.setIdentify(userInfo.getIdcard()); + respDTO.setEmail(userInfo.getEmail()); + respDTO.setDepId(userInfo.getDepartment()); + result.add(respDTO); + + } + + return new ResultVO<>(ResultCodes.OK,result); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountDepartmentServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountDepartmentServiceImpl.java new file mode 100644 index 0000000..ac0cf83 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AccountDepartmentServiceImpl.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.model.dto.resp.DepRPCRespDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@Service("accountDepartmentService") +public class AccountDepartmentServiceImpl implements AccountDepartmentService { + + @Autowired + private DepartmentService departmentService; + + @Override + public ResultVO<DepInfoRPCRespDTO> getDepInfoByDepId(Long uid,Long depId) { + + if (depId == null) { + throw new BusinessException("部门id为空"); + } + DepInfoRPCRespDTO depInfoDep = null; + DepartmentInfo department = departmentService.getById(depId); + if (department != null) { + depInfoDep = new DepInfoRPCRespDTO(); + depInfoDep.setDepId(department.getId()); + depInfoDep.setDepName(department.getDepartment()); + } + + return new ResultVO<>(ResultCodes.OK,depInfoDep); + } + + @Override + public ResultVO<List<DepInfoRPCRespDTO>> listDepByDepIds(List<Long> depIds) { + List<DepInfoRPCRespDTO> result; + if (depIds != null && depIds.size() > 0) { + List<DepartmentInfo> deps = departmentService.listDepByDepIds(depIds); + result = new ArrayList<>(depIds.size()); + for (DepartmentInfo dep : deps) { + DepInfoRPCRespDTO respDTO = new DepInfoRPCRespDTO(); + respDTO.setDepId(dep.getId()); + respDTO.setDepName(dep.getDepartment()); + respDTO.setStatus(dep.getIsdel()); + result.add(respDTO); + } + }else{ + result = Collections.emptyList(); + } + + return new ResultVO<>(ResultCodes.OK,result); + } + + @Override + public ResultVO<List<DepRPCRespDTO>> depList() { + List<DepartmentVo> depDos = departmentService.selectByAll(); + List<DepRPCRespDTO> result = new ArrayList<>(depDos.size()); + if (depDos.size() > 0) { + for (DepartmentVo depDo : depDos) { + DepRPCRespDTO respDTO = new DepRPCRespDTO(); + respDTO.setDepId(depDo.getId()); + respDTO.setDepName(depDo.getDepartment()); + respDTO.setStatus(depDo.getIsdel()); + respDTO.setChildren(Collections.emptyList()); + result.add(respDTO); + } + } + return new ResultVO<>(ResultCodes.OK,result); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/AppFileServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AppFileServiceImpl.java new file mode 100644 index 0000000..49aa689 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AppFileServiceImpl.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.AppFileInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.AppFileInfoMapper; +import com.gk.hotwork.Service.AppFileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("AppFileService") +public class AppFileServiceImpl extends ServiceImpl<AppFileInfoMapper, AppFileInfo> implements AppFileService { + @Autowired + AppFileInfoMapper appFileInfoMapper; + + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<AppFileInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("updated"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<AppFileInfo> list = appFileInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public AppFileInfo selectNew(String filetype) { + return appFileInfoMapper.selectNew(filetype); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/AuthorizationServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AuthorizationServiceImpl.java new file mode 100644 index 0000000..9ee9593 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AuthorizationServiceImpl.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.AuthorizationInfo; +import com.gk.hotwork.Mapper.AuthorizationInfoMapper; +import com.gk.hotwork.Service.AuthorizationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/7/2 9:41 + */ +@Service("AuthorizationService") +public class AuthorizationServiceImpl extends ServiceImpl<AuthorizationInfoMapper, AuthorizationInfo> implements AuthorizationService { + @Autowired + AuthorizationInfoMapper authorizationInfoMapper; + + @Override + public AuthorizationInfo selectByUser(String enterprisenumber, String authcode) { + return authorizationInfoMapper.selectByUser(enterprisenumber, authcode); + } + + @Override + public List<AuthorizationInfo> getAuthByEnterprise(String enterpriseNumber) { + LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(AuthorizationInfo::getEnterprisenumber,enterpriseNumber); + return authorizationInfoMapper.selectList(wrapper); + } + + @Override + public boolean checkPrefixExist(String prefix) { + LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(AuthorizationInfo::getAuthcodeprefix,prefix); + AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper); + return authorizationInfo != null; + } + + @Override + public boolean checkCodeExist(String code) { + LambdaQueryWrapper<AuthorizationInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(AuthorizationInfo::getAuthcode,code); + AuthorizationInfo authorizationInfo = authorizationInfoMapper.selectOne(wrapper); + return authorizationInfo != null; + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/BlackListServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/BlackListServiceImpl.java new file mode 100644 index 0000000..028507f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/BlackListServiceImpl.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.BlackListInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.PageUtil; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.BlackListInfoMapper; +import com.gk.hotwork.Service.BlackListService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/10/18 16:38 + */ +@Service("BlackListService") +public class BlackListServiceImpl extends ServiceImpl<BlackListInfoMapper, BlackListInfo> implements BlackListService { + @Autowired + private BlackListInfoMapper blackListInfoMapper; + + @Override + public BlackListInfo getBlackListByName(String company) { + LambdaQueryWrapper<BlackListInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(BlackListInfo::getCompany,company); + return baseMapper.selectOne(wrapper); + } + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<BlackListInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<BlackListInfo> blackListInfos = blackListInfoMapper.selectDataGrid(pageInfo.getCondition(),page); + pageInfo.setResult(blackListInfos); + pageInfo.setTotalCount(page.getTotal()); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/CompanyServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/CompanyServiceImpl.java new file mode 100644 index 0000000..da98dfb --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/CompanyServiceImpl.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.CompanyInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.CompanyInfoMapper; +import com.gk.hotwork.Service.CompanyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("CompanyService") +public class CompanyServiceImpl extends ServiceImpl<CompanyInfoMapper, CompanyInfo> implements CompanyService { + @Autowired + CompanyInfoMapper companyInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<CompanyInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("createddate"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<CompanyInfo> list = companyInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public CompanyInfo selectExistByName(Long id, String company) { + return companyInfoMapper.selectExistByName(id,company); + } + + @Override + public CompanyInfo selectByName(String company) { + LambdaQueryWrapper<CompanyInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CompanyInfo::getCompany,company); + return companyInfoMapper.selectOne(wrapper); + } + + @Override + public List<CompanyInfo> selectByAll() { + return companyInfoMapper.selectByAll(); + } + + @Override + public CompanyInfo selectExistMain(Long id) { + return companyInfoMapper.selectExistMain(id); + } + + @Override + public boolean isMain(String company) { + if (StringUtils.isBlank(company)){return true; } + CompanyInfo companyInfo = selectByName(company); + if (companyInfo == null){return false;} + return companyInfo.getIsmain() == 1; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DepartmentServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DepartmentServiceImpl.java new file mode 100644 index 0000000..7367c3e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DepartmentServiceImpl.java @@ -0,0 +1,148 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.InvolveDepInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import com.gk.hotwork.Mapper.InvolveDepInfoMapper; +import com.gk.hotwork.Mapper.DepartmentInfoMapper; +import com.gk.hotwork.Service.DepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("DepartmentService") +public class DepartmentServiceImpl extends ServiceImpl<DepartmentInfoMapper, DepartmentInfo> implements DepartmentService { + @Autowired + DepartmentInfoMapper departmentInfoMapper; + @Autowired + InvolveDepInfoMapper involveDepInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<DepartmentVo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("createddate"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<DepartmentVo> list = departmentInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + for (DepartmentVo departmentVo : list){ + InvolveDepInfo involveDepInfo = involveDepInfoMapper.selectByName(departmentVo.getDepartment()); + if (involveDepInfo != null){ + departmentVo.setIsinvolve((byte)1); + }else { + departmentVo.setIsinvolve((byte)0); + } + } + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public DepartmentInfo selectExistByName(Long id, String department) { + return departmentInfoMapper.selectExistByName(id,department); + } + + @Override + public List<DepartmentVo> selectByAll() { + List<DepartmentVo> departmentVoList = departmentInfoMapper.selectByAll(); + for (DepartmentVo departmentVo : departmentVoList){ + InvolveDepInfo involveDepInfo = involveDepInfoMapper.selectByName(departmentVo.getDepartment()); + if (involveDepInfo != null){ + departmentVo.setIsinvolve((byte)1); + }else { + departmentVo.setIsinvolve((byte)0); + } + } + return departmentVoList; + } + + @Override + public DepartmentInfo selectSafety(Long id) { + return departmentInfoMapper.selectSafety(id); + } + + @Override + public DepartmentInfo selectSafetyDepartment() { + LambdaQueryWrapper<DepartmentInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DepartmentInfo::getIssafety,(byte)1); + return baseMapper.selectOne(wrapper); + } + + @Override + public DepartmentInfo selectAnalysis(Long id) { + LambdaQueryWrapper<DepartmentInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DepartmentInfo::getIsanalysis,(byte)1); + if (id != null){ + wrapper.ne(DepartmentInfo::getId,id); + } + return baseMapper.selectOne(wrapper); + } + + @Override + public boolean isAnalysis(String department) { + DepartmentInfo departmentInfo = selectDepByName(department); + return departmentInfo.getIsanalysis() == 1; + } + + @Override + public Integer selectCountForExam(String name) { + Map<String, Object> params = new HashMap<>(); + params.put("name", name); + return departmentInfoMapper.selectCountForExam(params); + } + + @Override + public List<DepartmentInfo> selectPageForExam(String name, Integer first, Integer pageSize) { + Map<String, Object> params = new HashMap<>(); + params.put("name", name); + params.put("first", first); + params.put("pageSize", pageSize); + return departmentInfoMapper.selectPageForExam(params); + } + + @Override + public DepartmentInfo getInfoByName(String departmentName) { + + return departmentInfoMapper.getInfoByName(departmentName); + } + + + + public DepartmentInfo selectDepByName(String department){ + LambdaQueryWrapper<DepartmentInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DepartmentInfo::getDepartment,department); + return baseMapper.selectOne(wrapper); + } + + @Override + public DepartmentInfo getDepartmentInfoById(Long depId) { + return departmentInfoMapper.getDepartmentInfoById(depId); + } + + @Override + public List<DepartmentInfo> listDepByDepIds(List<Long> depIds) { + return departmentInfoMapper.listDepByDepIds(depIds); + } + + @Override + public List<DepartmentInfo> listDepartmentInfoById() { + return departmentInfoMapper.listDepartmentInfoById(); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DeviceLocationServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DeviceLocationServiceImpl.java new file mode 100644 index 0000000..c6c172b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DeviceLocationServiceImpl.java @@ -0,0 +1,65 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.gk.hotwork.Domain.DeviceLocation; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.DeviceLocationMapper; +import com.gk.hotwork.Service.DeviceLocationService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service("deviceLocationService") +public class DeviceLocationServiceImpl implements DeviceLocationService { + + @Autowired + private DeviceLocationMapper deviceLocationMapper; + @Autowired + private UserService userService; + + + @Override + public void insertRecord(DeviceLocation location) { + //根据locaiton的uid(设备Id)进行用户的对应 + UserInfo user = userService.getByDeviceNo(location.getUid()); + if (user == null) + throw new BusinessException("用户设备号不存在:"+location.getUid()); + String slice = user.getSlice(); + if (StringUtils.isBlank(slice)) + throw new BusinessException("系统用户分表标识不存在"); + deviceLocationMapper.insertOne(slice,location); + } + + @Override + public DeviceLocation selectByUser(UserInfo user) { + if (user.getId() == null) + throw new BusinessException("用户信息不能为空"); + if (StringUtils.isBlank(user.getSlice())) + throw new BusinessException("系统错误,用户分表标识为空"); + return deviceLocationMapper.selectLatestUserLocation(user.getSlice(),user.getDeviceNo()); + } + + @Override + public List<DeviceLocation> selectUserLocations(String username, Date starttime, Date endtime) { + if (StringUtils.isBlank(username)) + throw new BusinessException("用户名为空"); + UserInfo userInfo = userService.selectByUser(username); + if (userInfo == null) + throw new BusinessException("用户信息不存在"); + if (StringUtils.isBlank(userInfo.getSlice())) + throw new BusinessException("系统用户分表标识不存在"); + + return deviceLocationMapper.selectUserLocations(userInfo.getSlice(),userInfo.getDeviceNo(),starttime,endtime); + } + + @Override + public void cleanUp(Integer sliceSize,Integer days) { + for (int i = 1; i <= sliceSize; i++) { + deviceLocationMapper.deleteRecordBeforeDays(i + "", days); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePingServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePingServiceImpl.java new file mode 100644 index 0000000..8e0b7f0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePingServiceImpl.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DevicePing; +import com.gk.hotwork.Mapper.DevicePingMapper; +import com.gk.hotwork.Service.DevicePingService; +import org.springframework.stereotype.Service; + +@Service("devicePingService") +public class DevicePingServiceImpl extends ServiceImpl<DevicePingMapper, DevicePing> implements DevicePingService { +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePressKeyServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePressKeyServiceImpl.java new file mode 100644 index 0000000..aae79a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DevicePressKeyServiceImpl.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DevicePressKey; +import com.gk.hotwork.Mapper.DevicePresskeyMapper; +import com.gk.hotwork.Service.DevicePressKeyService; +import org.springframework.stereotype.Service; + +@Service("devicePressKeyService") +public class DevicePressKeyServiceImpl extends ServiceImpl<DevicePresskeyMapper, DevicePressKey> implements DevicePressKeyService { +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryItemServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryItemServiceImpl.java new file mode 100644 index 0000000..64871ff --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryItemServiceImpl.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DictionaryItemInfo; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Mapper.DictionaryItemInfoMapper; +import com.gk.hotwork.Service.DictionaryItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("DictionaryItemService") +public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemInfoMapper, DictionaryItemInfo> implements DictionaryItemService { + + @Autowired + DictionaryItemInfoMapper dictionaryItemInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<DictionaryItemInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + orderItem.setAsc(true); + orderItem.setColumn("sort"); + orderItems.add(orderItem); + page.setOrders(orderItems); + List<DictionaryItemInfo> list = dictionaryItemInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public DictionaryItemInfo selctByText(String text) { + DictionaryItemInfo dictionaryItemInfo = new DictionaryItemInfo(); + dictionaryItemInfo.setText(text); + QueryWrapper<DictionaryItemInfo> queryWrapper = new QueryWrapper<>(dictionaryItemInfo); + return dictionaryItemInfoMapper.selectOne(queryWrapper); + } + + @Override + public DictionaryItemInfo selctByValue(String value) { + DictionaryItemInfo dictionaryItemInfo = new DictionaryItemInfo(); + dictionaryItemInfo.setValue(value); + QueryWrapper<DictionaryItemInfo> queryWrapper = new QueryWrapper<>(dictionaryItemInfo); + return dictionaryItemInfoMapper.selectOne(queryWrapper); + } + + @Override + public List<DictionaryTypeInfo> selectExistInfo(Long id, String value, String text) { + return dictionaryItemInfoMapper.selectExistInfo(id,value,text); + } + + @Override + public List<DictionaryItemInfo> selectByType(String dictionaryType) { + return dictionaryItemInfoMapper.selectByType(dictionaryType); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryTypeServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryTypeServiceImpl.java new file mode 100644 index 0000000..842be8b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DictionaryTypeServiceImpl.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DictionaryTypeInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Mapper.DictionaryTypeInfoMapper; +import com.gk.hotwork.Service.DictionaryTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("DictionaryTypeService") +public class DictionaryTypeServiceImpl extends ServiceImpl<DictionaryTypeInfoMapper, DictionaryTypeInfo> implements DictionaryTypeService { + + @Autowired + DictionaryTypeInfoMapper dictionaryTypeInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<DictionaryTypeInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + orderItem.setAsc(false); + orderItem.setColumn("createddate"); + orderItems.add(orderItem); + page.setOrders(orderItems); + List<DictionaryTypeInfo> list = dictionaryTypeInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public DictionaryTypeInfo selctByCode(String code) { + DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo(); + dictionaryTypeInfo.setCode(code); + dictionaryTypeInfo.setStatus((byte)1); + QueryWrapper<DictionaryTypeInfo> queryWrapper = new QueryWrapper<>(dictionaryTypeInfo); + return dictionaryTypeInfoMapper.selectOne(queryWrapper); + } + + @Override + public DictionaryTypeInfo selctByText(String text) { + DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo(); + dictionaryTypeInfo.setText(text); + dictionaryTypeInfo.setStatus((byte)1); + QueryWrapper<DictionaryTypeInfo> queryWrapper = new QueryWrapper<>(dictionaryTypeInfo); + return dictionaryTypeInfoMapper.selectOne(queryWrapper); + } + + @Override + public List<DictionaryTypeInfo> selectExistInfo(Long id, String code, String text) { + return dictionaryTypeInfoMapper.selectExistInfo(id, code, text); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/DistrictServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DistrictServiceImpl.java new file mode 100644 index 0000000..28bb299 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/DistrictServiceImpl.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DistrictInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.DistrictInfoMapper; +import com.gk.hotwork.Service.DistrictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("DistrictService") +public class DistrictServiceImpl extends ServiceImpl<DistrictInfoMapper, DistrictInfo> implements DistrictService { + + @Autowired + DistrictInfoMapper districtInfoMapper; + + + @Override + public List<DistrictInfo> selectDistrictInfo(String type, String parentcode) { + return districtInfoMapper.selectDistrictInfo(type, parentcode); + } + + @Override + public DistrictInfo selectInfoByName(String name, Byte type) { + DistrictInfo districtInfo = new DistrictInfo(); + districtInfo.setName(name); + districtInfo.setType(type); + QueryWrapper<DistrictInfo> wrapper = new QueryWrapper<> (districtInfo); + return districtInfoMapper.selectOne(wrapper); + } + + @Override + public DistrictInfo selectInfoByCode(String code, Byte type) { + DistrictInfo districtInfo = new DistrictInfo(); + districtInfo.setCode(code); + districtInfo.setType(type); + QueryWrapper<DistrictInfo> wrapper = new QueryWrapper<> (districtInfo); + return districtInfoMapper.selectOne(wrapper); + } + + @Override + public List<DistrictInfo> selectDistrictByName(String type, String parentname, String parenttype) { + return districtInfoMapper.selectDistrictByName(type, parentname, parenttype); + } + + @Override + public List<DistrictInfo> selectInfoByParentCode(String s) { + LambdaQueryWrapper<DistrictInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DistrictInfo::getParentcode,s); + return districtInfoMapper.selectList(wrapper); + } + + @Override + public List<DistrictInfo> selectInfoByParentCodeAndCity(String s, Object city) { + LambdaQueryWrapper<DistrictInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DistrictInfo::getParentcode,s); + if (StringUtils.isNotBlank(city.toString())){ + wrapper.eq(DistrictInfo::getName,city); + } + return districtInfoMapper.selectList(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/ElementManagementImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ElementManagementImpl.java new file mode 100644 index 0000000..cf21e0d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ElementManagementImpl.java @@ -0,0 +1,166 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.ElementManagement; +import com.gk.hotwork.Domain.ElementTree; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.ElementManagementMapper; +import com.gk.hotwork.Service.ElementManagementService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("elementManagementService") +@Transactional +public class ElementManagementImpl extends ServiceImpl<ElementManagementMapper,ElementManagement> implements ElementManagementService { + + @Autowired + private ElementManagementMapper elementManagementMapper; + + /** + * @Description: 分页 + */ + @Override + public IPage<ElementManagement> selectPage(Page<ElementManagement> page, Map<String, Object> filter, UserInfo user) { + return elementManagementMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(ElementManagement param, UserInfo user) { + requiredVerification(param); + + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(user.getRealname()); + param.setCreateBy(user.getRealname()); + param.setUpdateTime(new Date()); + param.setCreateTime(new Date()); + this.save(param); + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(ElementManagement param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + + param.setUpdateTime(new Date()); + param.setUpdateBy(user.getRealname()); + this.updateById(param); + } + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + ElementManagement elementManagement = selectVerification(id); + deleteVerification(elementManagement); + + ElementManagement delOne = new ElementManagement(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + @Override + public List<ElementManagement> getParentElement() { + return elementManagementMapper.getElementByType(0); + } + + @Override + public List<ElementTree> getElementTree() { + List<ElementTree> elementTreeList = new ArrayList<>(); + + List<ElementManagement> list1 = elementManagementMapper.getElementByType(0); + List<ElementManagement> list2 = elementManagementMapper.getElementByType(1); + + if (CollectionUtils.isNotEmpty(list1)){ + for (ElementManagement elementManagement : list1){ + ElementTree elementTree=new ElementTree(); + elementTree.setType(0); + elementTree.setLabel(elementManagement.getName()); + elementTree.setValue(elementManagement.getId()); + elementTreeList.add(elementTree); + } + } + if (CollectionUtils.isNotEmpty(list2)) { + for (int i = 0; i < list2.size(); i++) { + for (int j = 0; j < elementTreeList.size(); j++) { + if (list2.get(i).getParentId().equals(elementTreeList.get(j).getValue())) { + if (CollectionUtils.isEmpty(elementTreeList.get(j).getChildren())) { + //如果为空 则new一个出来 + elementTreeList.get(j).setChildren(new ArrayList<>()); + } + ElementTree elementTree = new ElementTree(); + elementTree.setType(1); + elementTree.setLabel(list2.get(i).getName()); + elementTree.setValue(list2.get(i).getId()); + elementTreeList.get(j).getChildren().add(elementTree); + } + } + } + } + return elementTreeList; + } + + + /** + * 查询验证 + * 验证对象存在 + */ + public ElementManagement selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + ElementManagement elementManagement = this.getById(id); + if (elementManagement == null) throw new BusinessException("找不到对应实体"); + return elementManagement; + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(ElementManagement param){ + if(StringUtils.isBlank(param.getName())) throw new BusinessException("请填写要素名称"); + if (param.getType() == null) throw new BusinessException("请选择要素类型"); + if (param.getType() == 1 && param.getParentId()==null){ + throw new BusinessException("请选择父要素"); + } + } + + /** + * 操作验证 + * 删除已被B级要素绑定的A级要素 + * + */ + public void deleteVerification(ElementManagement param){ + if (param.getType()==0){ + int count = this.count(new LambdaQueryWrapper<ElementManagement>() + .eq(ElementManagement::getParentId, param.getId()) + .eq(ElementManagement::getType , 1) + .eq(ElementManagement::getValidFlag, Boolean.TRUE)); + if (count > 0) throw new BusinessException("当前A级要素仍然有已绑定的B级要素,无法删除"); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/EmergencyPlanImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/EmergencyPlanImpl.java new file mode 100644 index 0000000..70d41a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/EmergencyPlanImpl.java @@ -0,0 +1,175 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.EmergencyPlanFileMapper; +import com.gk.hotwork.Mapper.EmergencyPlanMapper; +import com.gk.hotwork.Service.EmergencyPlanService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("emergencyPlanService") +@Transactional +public class EmergencyPlanImpl extends ServiceImpl<EmergencyPlanMapper,EmergencyPlan> implements EmergencyPlanService { + + @Autowired + private EmergencyPlanMapper emergencyPlanMapper; + @Autowired + private EmergencyPlanFileMapper emergencyPlanFileMapper; + + /** + * @Description: 分页 + */ + @Override + public IPage<EmergencyPlan> selectPage(Page<EmergencyPlan> page, Map<String, Object> filter, UserInfo user) { + IPage<EmergencyPlan> res = emergencyPlanMapper.selectPages(page,filter); + if (CollectionUtils.isNotEmpty(res.getRecords())){ + for (int i = 0 ; i < res.getRecords().size(); i++){ + List<EmergencyPlanFile> fileList = emergencyPlanFileMapper.getByEmergencyPlanId(res.getRecords().get(i).getId()); + res.getRecords().get(i).setFileList(fileList); + } + } + return res; + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(EmergencyPlan param, UserInfo user) { + requiredVerification(param); + + Date date = new Date(); + String username = user.getRealname(); + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(username); + param.setCreateBy(username); + param.setUpdateTime(date); + param.setCreateTime(date); + this.save(param); + if (CollectionUtils.isNotEmpty(param.getFileList())){ + for (EmergencyPlanFile emergencyPlanFile : param.getFileList()){ + emergencyPlanFile.setValidFlag(Boolean.TRUE); + emergencyPlanFile.setUpdateBy(username); + emergencyPlanFile.setCreateBy(username); + emergencyPlanFile.setUpdateTime(date); + emergencyPlanFile.setCreateTime(date); + emergencyPlanFile.setEmergencyPlanId(param.getId()); + emergencyPlanFileMapper.insert(emergencyPlanFile); + } + } + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(EmergencyPlan param, UserInfo user) { + + Date date = new Date(); + String username = user.getRealname(); + selectVerification(param.getId()); + requiredVerification(param); + param.setUpdateTime(date); + param.setUpdateBy(username); + this.updateById(param); + + //对比删除文件 + List<EmergencyPlanFile> oldFileList = emergencyPlanFileMapper.getByEmergencyPlanId(param.getId()); + List<EmergencyPlanFile> newFileList = param.getFileList(); + + List<Long> oldIdList = new ArrayList<>(); + List<Long> newIdList = new ArrayList<>(); + + for (EmergencyPlanFile oldEmergencyPlanFile :oldFileList ){ + oldIdList.add(oldEmergencyPlanFile.getId()); + } + for (EmergencyPlanFile newEmergencyPlanFile :newFileList ){ + if (newEmergencyPlanFile.getId()==null){ + //1.添加新增的元素 + newEmergencyPlanFile.setValidFlag(Boolean.TRUE); + newEmergencyPlanFile.setUpdateBy(username); + newEmergencyPlanFile.setCreateBy(username); + newEmergencyPlanFile.setUpdateTime(date); + newEmergencyPlanFile.setCreateTime(date); + newEmergencyPlanFile.setEmergencyPlanId(param.getId()); + emergencyPlanFileMapper.insert(newEmergencyPlanFile); + }else{ + newIdList.add(newEmergencyPlanFile.getId()); + } + } + //2.删除不存在的元素 + List<Long> diffList = getDif(oldIdList,newIdList); + if (CollectionUtils.isNotEmpty(diffList)){ + for (Long id : diffList){ + emergencyPlanFileMapper.deleteById(id,username,date); + } + } + } + + public List<Long> getDif(List<Long> oldIdList , List<Long> newIdList ){ + ArrayList<Long> dif = new ArrayList<>(); + //查找出oldIdList表中不包含newIdList的元素 + for (Long id : oldIdList) { + if (!(newIdList.contains(id))) { + dif.add(id); + } + } + return dif; + } + + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); + EmergencyPlan delOne = new EmergencyPlan(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + /** + * 查询验证 + * 验证对象存在 + */ + public void selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + EmergencyPlan EmergencyPlan = this.getById(id); + if (EmergencyPlan == null) throw new BusinessException("找不到对应实体"); + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(EmergencyPlan param){ + if(StringUtils.isBlank(param.getName())) throw new BusinessException("请填写应急预案名称"); + if (param.getFileType() == null) throw new BusinessException("请选择应急预案文件类型"); + if (param.getFileType() == 0 && CollectionUtils.isEmpty(param.getFileList())){ + throw new BusinessException("请上传图片"); + } + if (param.getFileType() == 1 && CollectionUtils.isEmpty(param.getFileList())){ + throw new BusinessException("请上传文件"); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/EquipmentServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/EquipmentServiceImpl.java new file mode 100644 index 0000000..ae7970f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/EquipmentServiceImpl.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.EquipmentInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.EquipmentInfoMapper; +import com.gk.hotwork.Service.EquipmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("EquipmentService") +public class EquipmentServiceImpl extends ServiceImpl<EquipmentInfoMapper, EquipmentInfo> implements EquipmentService { + @Autowired + EquipmentInfoMapper equipmentInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<EquipmentInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("updatetime"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<EquipmentInfo> list = equipmentInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public EquipmentInfo selectExistByNumber(Long id, String number) { + return equipmentInfoMapper.selectExistByNumber(id,number); + } + + @Override + public EquipmentInfo selectByNumber(String equipmentnumber) { + return equipmentInfoMapper.selectByNumber(equipmentnumber); + } + + @Override + public List<EquipmentInfo> selectByTask(String taskcode) { + return equipmentInfoMapper.selectByTask(taskcode); + } + + @Override + public List<EquipmentInfo> selectByTaskAndWorker(String code, String worker) { + return equipmentInfoMapper.selectByTaskAndWorker(code,worker); + } + + @Override + public List<EquipmentInfo> selectUsingByTask(String code) { + return equipmentInfoMapper.selectUsingByTask(code); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExamScoreServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExamScoreServiceImpl.java new file mode 100644 index 0000000..77bb4a0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExamScoreServiceImpl.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.ExamScoreInfo; +import com.gk.hotwork.Domain.Vo.ExamScoreVo; +import com.gk.hotwork.Mapper.ExamScoreInfoMapper; +import com.gk.hotwork.Service.ExamScoreService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("ExamScoreService") +public class ExamScoreServiceImpl extends ServiceImpl<ExamScoreInfoMapper, ExamScoreInfo> implements ExamScoreService { + @Autowired + ExamScoreInfoMapper examScoreInfoMapper; + + + @Override + public ExamScoreInfo selectByMobile(String examtype,String mobile) { + return examScoreInfoMapper.selectByMobile(examtype,mobile); + } + + @Override + public List<ExamScoreVo> selectByAll(String username) { + return examScoreInfoMapper.selectByAll(username); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExcelExportServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExcelExportServiceImpl.java new file mode 100644 index 0000000..df621ce --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ExcelExportServiceImpl.java @@ -0,0 +1,1105 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import com.gk.hotwork.Service.*; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.FormulaEvaluator; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.usermodel.*; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +@Service("ExcelExportService") +public class ExcelExportServiceImpl implements ExcelExportService { + private Logger logger = LogManager.getLogger(getClass()); + + String[] districttitle = {"code", "name", "parentcode", "type"}; + + String[] userTitle = {"手机号", "密码", "姓名", "身份证", "单位", "部门"}; + + + String[] supplierUserTitle = {"手机号", "密码", "姓名", "身份证", "邮箱", "部门", "职务", + "是否单位负责人", "是否部门负责人", "用户类型", "状态"}; + + String[] selfCheckTitle = {"作业类型","类型","检查类型", "检查内容", "参考判断", "排序", "备注"}; + + + String[] riskEventTitle = {"安全风险分析单元名称", "安全风险事件名称"}; + + String[] riskAnaUnitTitle = {"安全风险分析对象编码", "安全风险分析单元名称", "责任部门", "责任人"}; + + String[] riskControlMeasureTitle = {"安全风险事件名称", "管控方式", "管控方式描述", "管控措施分类1" + , "管控措施分类2", "管控措施分类3", "隐患排查内容", "周期", "单位"}; + + String[] riskSourceTitle = {"生产装置", "风险等级", "可能导致事故的主要原因", "区域位置", "所属部门"}; + //正整数 + String pattern = "^[0-9]*[1-9][0-9]*$"; + + Pattern pattern2 = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); + + @Autowired + private DistrictService districtService; + @Autowired + private UserService userService; + @Autowired + private UserRolesService userRolesService; + @Autowired + private RoleService roleService; + @Autowired + SelfCheckService selfCheckService; + @Autowired + DepartmentService departmentService; + @Autowired + CompanyService companyService; + @Autowired + RiskEventService riskEventService; + @Autowired + RiskAnaUnitService riskAnaUnitService; + @Autowired + RiskControlMeasureService riskControlMeasureService; + @Autowired + RiskControlClassifyService riskControlClassifyService; + @Autowired + private RiskSourceService riskSourceService; + + + + @Override + public BooleanReason importDistrictExcel(InputStream in, String operator, Boolean isExcel2007) { + BooleanReason blret = new BooleanReason(); + List<DistrictInfo> districtInfoList = new ArrayList<>(); + String retmsg = ""; + blret.setValue(false); + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + blret.addReason("excel 第1页不能为空"); + return blret; + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != districttitle.length) { + blret.addReason("上传文件的列的个数错误"); + return blret; + } + + for (int i = 0; i < colNum; i++) { + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((districttitle[i]))) { + blret.addReason("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + districttitle[i]); + return blret; + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + DistrictInfo districtInfo = new DistrictInfo(); + Object value = null; + row = sheet.getRow(irow); + + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,编码不能为空.<br/>"; + continue; + } else { + districtInfo.setCode(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,名称不能为空.<br/>"; + continue; + } else { + districtInfo.setName(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,父编码不能为空.<br/>"; + continue; + } else { + districtInfo.setParentcode(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,类型不能为空.<br/>"; + continue; + } else { + districtInfo.setType(Byte.valueOf(value.toString())); + } + + districtInfoList.add(districtInfo); + } + + for (DistrictInfo districtInfo : districtInfoList) { + districtService.save(districtInfo); + } + + if (StringUtils.isNotBlank(retmsg)) { + retmsg = retmsg + "导入成功" + districtInfoList.size() + "个," + "导入失败" + (sheet.getLastRowNum() - districtInfoList.size()) + "个。"; + blret.addReason(retmsg); + return blret; + } + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + blret.addReason("导入错误"); + return blret; + } + + blret.setValue(true); + return blret; + } + + @Override + @Transactional + public void importUserExcel(InputStream in, String username, Boolean isExcel2007) { + List<UserInfo> userInfoList = new ArrayList<>(); + //准备单位和部门 + Set<String> companySet = new HashSet<>(); + List<CompanyInfo> companyInfos = companyService.selectByAll(); + for (CompanyInfo companyInfo : companyInfos) { + companySet.add(companyInfo.getCompany()); + } + Set<String> departmentSet = new HashSet<>(); + List<DepartmentVo> departmentVos = departmentService.selectByAll(); + for (DepartmentVo departmentVo : departmentVos) { + departmentSet.add(departmentVo.getDepartment()); + } + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException("excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != userTitle.length) { + throw new BusinessException("上传文件的列的个数错误"); + } + + for (int i = 0; i < colNum; i++) { + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((userTitle[i]))) { + throw new BusinessException("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + userTitle[i]); + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + UserInfo userInfo = new UserInfo(); + Object value = null; + row = sheet.getRow(irow); + + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,手机号不能为空.<br/>"); + } else { + userInfo.setUsername(value.toString().trim()); + if (userInfo.getUsername().length() != 11) { + throw new BusinessException("手机号不为11"); + } + if (userService.phoneIsOccupied(userInfo.getUsername())) { + throw new BusinessException("导入失败,第" + realrow + "行,手机号重复.<br/>"); + } + } + + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,密码不能为空.<br/>"); + } else { + userInfo.setPassword(MD5Utils.encode(value.toString().trim())); + } + + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,姓名不能为空.<br/>"); + } else { + userInfo.setRealname(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + userInfo.setIdcard(value.toString().trim()); + if (!IdCardUtil.strongVerifyIdNumber(userInfo.getIdcard())) { + throw new BusinessException( "导入失败,第" + realrow + "行,身份证非法.<br/>"); + } + if (userService.idCardIsOccupied(userInfo.getIdcard())) { + throw new BusinessException( "导入失败,第" + realrow + "行,身份证重复.<br/>"); + } + + } + + + + value = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + userInfo.setCompany(value.toString().trim()); + if (!companySet.contains(userInfo.getCompany())) + throw new BusinessException("导入失败,第" + realrow + "行,单位不存在.<br/>"); + } + + value = ExcelProperty.getCellValue(row.getCell(5), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + DepartmentInfo infoByName = departmentService.getInfoByName(value.toString().trim()); + if (infoByName != null) { + userInfo.setDepartment(infoByName.getId()); + } + + if (!departmentSet.contains(userInfo.getDepartment())) { + throw new BusinessException("导入失败,第" + realrow + "行,部门不存在.<br/>"); + } + } + + + + + + userInfo.setIsupload((byte) 0); + userInfo.setIsdel((byte) 0); + userInfo.setCreatedby(username); + userInfo.setCreateddate(new Date()); + userInfo.setLastmodifiedby(username); + userInfo.setLastmodifieddate(new Date()); + userInfo.setType(3); + userInfo.setStatus((byte)1); + userInfo.setIsdepartment((byte) 0); + userInfo.setIscompany((byte) 0); + userInfoList.add(userInfo); + } + //sheet 用户手机号和身份证重复判断 + List<String> phoneList = userInfoList.stream().map(UserInfo::getUsername).distinct().collect(Collectors.toList()); + if(phoneList.size() != userInfoList.size()) throw new BusinessException("本sheet中包含重复手机号"); + List<String> idCardList = userInfoList.stream().map(UserInfo::getIdcard).distinct().collect(Collectors.toList()); + if(idCardList.size() != userInfoList.size()) throw new BusinessException("本sheet中包含重复身份证号"); + //保存用户信息 同时赋予橘色 + + RoleInfo role = roleService.getOne(new LambdaQueryWrapper<RoleInfo>().eq(RoleInfo::getName, "员工")); + if (role == null) throw new BusinessException("请查询角色是否存在员工"); + for (UserInfo userInfo : userInfoList) { + //只赋予员工角色 + userService.save(userInfo); + UserRolesInfo ur = new UserRolesInfo(); + ur.setUserid(userInfo.getId()); + ur.setRoleid(role.getId()); + userRolesService.save(ur); + + } + + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + throw new BusinessException("导入错误"); + } + + } + + @Override + public BooleanReason importSupplierUserExcel(InputStream in, String username, String company, Boolean isExcel2007) { + BooleanReason blret = new BooleanReason(); + List<UserInfo> userInfoList = new ArrayList<>(); + String retmsg = ""; + blret.setValue(false); + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + blret.addReason("excel 第1页不能为空"); + return blret; + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != supplierUserTitle.length) { + blret.addReason("上传文件的列的个数错误"); + return blret; + } + + for (int i = 0; i < colNum; i++) { + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((supplierUserTitle[i]))) { + blret.addReason("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + supplierUserTitle[i]); + return blret; + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + UserInfo userInfo = new UserInfo(); + Object value = null; + row = sheet.getRow(irow); + + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,手机号不能为空.<br/>"; + continue; + } else { + userInfo.setUsername(value.toString().trim()); + List<UserInfo> userInfoExist = userService.selectUserInfo(null, userInfo.getUsername()); + if (userInfoExist.size() > 0) { + retmsg = retmsg + "导入失败,第" + realrow + "行,手机号重复.<br/>"; + continue; + } + } + + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,密码不能为空.<br/>"; + continue; + } else { + String PW_PATTERN = "(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@#$%^&*_.]).{8,}"; + if (!value.toString().trim().matches(PW_PATTERN)) { + retmsg = retmsg + "导入失败,第" + realrow + "行,密码必须8位以上,并且包含大小写字母、数字、特殊符号三种以上.<br/>"; + continue; + } else { + userInfo.setPassword(Base64Encrypt.encode(value.toString().trim().getBytes())); + } + } + + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,姓名不能为空.<br/>"; + continue; + } else { + userInfo.setRealname(value.toString().trim()); + UserInfo userInfoExist = userService.selectByRealName(null, userInfo.getRealname()); + if (null != userInfoExist) { + retmsg = retmsg + "导入失败,第" + realrow + "行,姓名重复.<br/>"; + continue; + } + } + + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + userInfo.setIdcard(value.toString().trim()); + UserInfo idCardExist = userService.selectByIdCard(null, userInfo.getIdcard()); + if (null != idCardExist) { + retmsg = retmsg + "导入失败,第" + realrow + "行,身份证重复.<br/>"; + continue; + } + } + + value = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + userInfo.setEmail(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(6), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + DepartmentInfo infoByName = departmentService.getInfoByName(value.toString().trim()); + if (infoByName != null) { + userInfo.setDepartment(infoByName.getId()); + } + + } + + value = ExcelProperty.getCellValue(row.getCell(7), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + userInfo.setJob(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(8), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString()) && value.toString().trim().equals("是")) { + userInfo.setIscompany((byte) 1); + } else { + userInfo.setIscompany((byte) 0); + } + + value = ExcelProperty.getCellValue(row.getCell(9), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString()) && value.toString().trim().equals("是")) { + userInfo.setIsdepartment((byte) 1); + } else { + userInfo.setIsdepartment((byte) 0); + } + + value = ExcelProperty.getCellValue(row.getCell(10), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString()) && value.toString().trim().equals("管理员")) { + userInfo.setType(2); + } else { + userInfo.setType(3); + } + + value = ExcelProperty.getCellValue(row.getCell(11), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString()) && value.toString().trim().equals("停用")) { + userInfo.setStatus((byte) 0); + } else { + userInfo.setStatus((byte) 1); + } + userInfo.setCompany(company); + userInfo.setIsupload((byte) 0); + userInfo.setIsdel((byte) 0); + userInfo.setCreatedby(username); + userInfo.setCreateddate(new Date()); + userInfo.setLastmodifiedby(username); + userInfo.setLastmodifieddate(new Date()); + userService.save(userInfo); + userInfoList.add(userInfo); + } + + if (StringUtils.isNotBlank(retmsg)) { + retmsg = retmsg + "导入成功" + userInfoList.size() + "个," + "导入失败" + (sheet.getLastRowNum() - userInfoList.size()) + "个。"; + blret.addReason(retmsg); + return blret; + } + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + blret.addReason("导入错误"); + return blret; + } + + blret.setValue(true); + return blret; + } + + + + @Override + public BooleanReason imporSelfCheckExcel(InputStream in, String username, Boolean isExcel2007) { + BooleanReason blret = new BooleanReason(); + List<SelfCheckInfo> selfCheckInfoList = new ArrayList<>(); + String retmsg = ""; + blret.setValue(false); + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + blret.addReason("excel 第1页不能为空"); + return blret; + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != selfCheckTitle.length) { + blret.addReason("上传文件的列的个数错误"); + return blret; + } + + for (int i = 0; i < colNum; i++) { + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((selfCheckTitle[i]))) { + blret.addReason("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + selfCheckTitle[i]); + return blret; + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + SelfCheckInfo selfCheckInfo = new SelfCheckInfo(); + Object value = null; + row = sheet.getRow(irow); + + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,作业类型不能为空.<br/>"; + continue; + } else { + selfCheckInfo.setTasktype(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,类型不能为空.<br/>"; + continue; + } else { + selfCheckInfo.setType(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,检查类型不能为空.<br/>"; + continue; + } else { + selfCheckInfo.setChecktype(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,检查内容不能为空.<br/>"; + continue; + } else { + selfCheckInfo.setContent(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + retmsg = retmsg + "导入失败,第" + realrow + "行,参考判断不能为空.<br/>"; + continue; + } else { + selfCheckInfo.setStandard(value.toString().trim()); + } + + value = ExcelProperty.getCellValue(row.getCell(5), evaluator); + if (null != value && StringUtils.isNotBlank(value.toString())) { + try { + selfCheckInfo.setSort(Integer.parseInt(value.toString().trim())); + }catch (Exception e){ + e.printStackTrace(); + } + } + selfCheckInfo.setCreatedby(username); + selfCheckInfo.setModifiedby(username); + selfCheckInfo.setCreateddate(new Date()); + selfCheckInfo.setModifieddate(new Date()); + selfCheckInfo.setIsdel((byte)0); + selfCheckInfoList.add(selfCheckInfo); + } + selfCheckService.saveBatch(selfCheckInfoList); + + if (StringUtils.isNotBlank(retmsg)) { + retmsg = retmsg + "导入成功" + selfCheckInfoList.size() + "个," + "导入失败" + (sheet.getLastRowNum() - selfCheckInfoList.size()) + "个。"; + blret.addReason(retmsg); + return blret; + } + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + blret.addReason("导入错误"); + return blret; + } + + blret.setValue(true); + return blret; + } + + @Override + public void importRiskEventExcel(InputStream in, String operator, Boolean isExcel2007) { + List<RiskEvent> riskEventList = new ArrayList<>(); + //校验文件 + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException("excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != riskEventTitle.length) { + throw new BusinessException("上传文件的列的个数错误"); + } + + for (int i = 0; i < colNum; i++) { + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((riskEventTitle[i]))) { + throw new BusinessException("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + riskEventTitle[i]); + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + RiskEvent riskEvent = new RiskEvent(); + Object value = null; + Object value1 = null; + row = sheet.getRow(irow); + //安全风险分析单元 + //TODO + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + value1 = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,安全风险分析单元名称不能为空.<br/>"); + } else { + String trim = value.toString().trim(); + RiskAnaUnit infoByRiskUnitName = riskAnaUnitService.getInfoByRiskUnitName(value.toString().trim()); + if (ObjectUtils.isEmpty(infoByRiskUnitName)){ + throw new BusinessException("请检查风险分析单元名称是否正确或者是否有事件对应的分析单元"); + } + riskEvent.setRiskUnitId(infoByRiskUnitName.getId()); + } + //安全风险事件 + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,安全风险事件名称不能为空.<br/>"); + } else { + riskEvent.setRiskEventName(value.toString().trim()); + } + + + //设置属性 + riskEvent.setValidFlag(Boolean.TRUE); + riskEvent.setUpdateBy(operator); + riskEvent.setCreateBy(operator); + riskEvent.setCreateTime(new Date()); + riskEvent.setUpdateTime(new Date()); + + riskEventList.add(riskEvent); + } + + for (RiskEvent riskEvent : riskEventList) { + riskEventService.save(riskEvent); + } + + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + throw new BusinessException("导入错误"); + } + + } + + @Override + public void importRiskAnaUnitExcel(InputStream in, String operator, Boolean isExcel2007) { + List<RiskAnaUnit> riskAnaUnitList = new ArrayList<>(); + //校验文件 + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException("excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != riskAnaUnitTitle.length) { + throw new BusinessException("上传文件的列的个数错误"); + } + + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((riskAnaUnitTitle[i]))) { + throw new BusinessException("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + riskAnaUnitTitle[i]); + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + RiskAnaUnit riskAnaUnit = new RiskAnaUnit(); + Object value = null; + Object value1 = null; + row = sheet.getRow(irow); + + //字段-安全风险分析对象编码 + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,安全风险分析对象编码不能为空.<br/>"); + } else { + String trim = value.toString().trim(); + riskAnaUnit.setHazardCode(value.toString().trim()); + } + + //字段2-安全风险分析单元名称 + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,安全风险分析单元名称不能为空.<br/>"); + } else { + riskAnaUnit.setRiskUnitName(value.toString().trim()); + } + + //参数属性3-责任部门, 责任部门id + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,责任部门不能为空.<br/>"); + } else { + DepartmentInfo depInfoByName = departmentService.getInfoByName(value.toString().trim()); + if (ObjectUtils.isEmpty(depInfoByName)){ + throw new BusinessException("请检查部门名称是否正确"); + } + riskAnaUnit.setHazardDep(value.toString().trim()); + riskAnaUnit.setHazardDepId(depInfoByName.getId()); + } + + //参数属性4-责任人 ,责任人id + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + value1 = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,责任人不能为空.<br/>"); + } else { + UserInfo userByRealName = userService.getByRealName(value.toString().trim(), value1.toString().trim()); + if (ObjectUtils.isEmpty(userByRealName)){ + throw new BusinessException("请检查责任人名称是否正确"); + } + riskAnaUnit.setHazardLiablePerson(value.toString().trim()); + + riskAnaUnit.setHazardLiablePersonId(userByRealName.getId()); + } + + //设置属性 + riskAnaUnit.setCreateTime(new Date()); + riskAnaUnit.setUpdateTime(new Date()); + riskAnaUnit.setCreateBy(operator); + riskAnaUnit.setUpdateBy(operator); + riskAnaUnit.setValidFlag(Boolean.TRUE); + riskAnaUnit.setValidFlag(Boolean.TRUE); + + riskAnaUnitList.add(riskAnaUnit); + } + + for (RiskAnaUnit riskAnaUnit : riskAnaUnitList) { + riskAnaUnitService.save(riskAnaUnit); + } + + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + throw new BusinessException("导入错误"); + } + + } + + @Override + public void importRiskControlMeasureExcel(InputStream in, String operator, Boolean isExcel2007) { + List<RiskControlMeasure> riskControlMeasureList = new ArrayList<>(); + //校验文件 + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException("excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != riskControlMeasureTitle.length) { + throw new BusinessException("上传文件的列的个数错误"); + } + + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((riskControlMeasureTitle[i]))) { + throw new BusinessException("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + riskControlMeasureTitle[i]); + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + RiskControlMeasure riskControlMeasure = new RiskControlMeasure(); + Object value = null; + row = sheet.getRow(irow); + + //字段-安全风险事件id + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,安全风险事件名称不能为空.<br/>"); + } else { + RiskEvent byRiskEventName = riskEventService.getByRiskEventName(value.toString().trim()); + if (ObjectUtils.isEmpty(byRiskEventName)){ + throw new BusinessException("请检查安全风险事件名称是否正确"); + } + riskControlMeasure.setRiskEventId(byRiskEventName.getId()); + } + + //字段2-管控方式 + String auto= "自动化监控"; + String riskCheck= "隐患排查"; + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,管控方式不能为空.<br/>"); + }else { + if (value != auto || value !=riskCheck){ + riskControlMeasure.setDataSrc(value.toString().trim()); + }else { + throw new BusinessException("请检查管控方式是否正确"); + } + } + + + + + //参数属性3-管控方式描述 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,管控方式描述不能为空.<br/>"); + } else { + riskControlMeasure.setRiskMeasureDesc(value.toString().trim()); + } + + //参数属性4,5-管控措施分类 + Object value1 = null; + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + value1 = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,管控措施分类1不能为空.<br/>"); + } + if ( value1 == null || StringUtils.isBlank(value1.toString()) ){ + throw new BusinessException("导入失败,管控措施分类2不能为空.<br/>"); + }else { + RiskControlClassify byClassify1AndClassify2 = + riskControlClassifyService.getByClassify1AndClassify12(value.toString().trim(), value1.toString().trim()); + if (ObjectUtils.isEmpty(byClassify1AndClassify2)){ + throw new BusinessException("请检查管控措施分类1,2是否正确"); + } + riskControlMeasure.setClassify1(value.toString().trim()); + riskControlMeasure.setClassify2(value1.toString().trim()); + } + + //参数属性6-管控分类措施3 + value = ExcelProperty.getCellValue(row.getCell(5), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + riskControlMeasure.setClassify3(""); + } else { + riskControlMeasure.setClassify3(value.toString().trim()); + } + + + + //参数属性7-隐患排查内容 + value = ExcelProperty.getCellValue(row.getCell(6), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,隐患排查内容不能为空.<br/>"); + } else { + riskControlMeasure.setTroubleshootContent(value.toString().trim()); + } + + //参数属性8-隐患排查措施-时间周期 + value = ExcelProperty.getCellValue(row.getCell(7), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,隐患排查周期不能为空.<br/>"); + } else { + riskControlMeasure.setTimeEffect(value.toString().trim()); + } + + //参数属性9-隐患排查措施-时间单位 + value = ExcelProperty.getCellValue(row.getCell(8), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,隐患排查单位不能为空.<br/>"); + } else { + riskControlMeasure.setTimeUnit(value.toString().trim()); + } + + //设置属性 + riskControlMeasure.setCreateBy(operator); + riskControlMeasure.setUpdateBy(operator); + riskControlMeasure.setCreateTime(new Date()); + riskControlMeasure.setUpdateTime(new Date()); + riskControlMeasure.setValidFlag(Boolean.TRUE); + + riskControlMeasureList.add(riskControlMeasure); + } + + + for (RiskControlMeasure riskControlMeasure : riskControlMeasureList) { + riskControlMeasureService.save(riskControlMeasure); + } + + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + throw new BusinessException("导入错误"); + } + } + + /** 生产装置导入*/ + @Override + public void importRiskSourceExcel(InputStream in, String realname, Boolean isExcel2007) { + + List<RiskSource> riskSourceList = new ArrayList<>(); + //校验文件 + try { + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException("excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != riskSourceTitle.length) { + throw new BusinessException("上传文件的列的个数错误"); + } + + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((riskSourceTitle[i]))) { + throw new BusinessException("上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + riskSourceTitle[i]); + } + } + + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realrow = irow + 1; + RiskSource riskSource = new RiskSource(); + Object value = null; + row = sheet.getRow(irow); + + //字段-生产装置 + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,生产装置不能为空.<br/>"); + } else { + riskSource.setName(value.toString().trim()); + } + + //字段2-风险等级 + String level1="低风险"; + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,风险等级不能为空.<br/>"); + } + /*1-低风险,2-一般风险,3-较大风险,4-重大风险*/ + if(value.toString().trim().equals(level1)){ + riskSource.setLevel((byte) 1); + } + else if(value.toString().trim().equals("一般风险")){ + riskSource.setLevel((byte) 2); + } + else if(value.toString().trim().equals("较大风险")){ + riskSource.setLevel((byte) 3); + } + else if(value.toString().trim().equals("重大风险")){ + riskSource.setLevel((byte) 4); + } else { + throw new BusinessException("导入失败,第" + realrow + "行,风险等级不符合规范.<br/>"); + } + + //参数属性3-可能导致事故的主要原因 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,可能导致事故的主要原因不能为空.<br/>"); + } else { + riskSource.setAccidentDesc(value.toString().trim()); + } + + //参数属性-区域位置 + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,区域位置不能为空.<br/>"); + } else { + riskSource.setLocation(value.toString().trim()); + } + + //参数属性-所属部门 并查询设置id + value = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException("导入失败,第" + realrow + "行,所属部门不能为空.<br/>"); + } else { + + DepartmentInfo infoByName = departmentService.getInfoByName(value.toString().trim()); + riskSource.setDepName(value.toString().trim()); + riskSource.setDepId(infoByName.getId()); + } + //设置属性 + UserInfo userInfo = userService.getByRealName(realname, value.toString().trim()); + + riskSource.setType((byte) 1); + riskSource.setStatus((byte) 1); + riskSource.setCreateTime(new Date()); + riskSource.setCreateUid(userInfo.getId()); + riskSource.setCreateUname(realname); + riskSource.setEditTime(new Date()); + riskSource.setEditUid(userInfo.getId()); + riskSource.setEditUname(realname); + riskSourceList.add(riskSource); + } + + for (RiskSource riskSource : riskSourceList) { + riskSourceService.save(riskSource); + } + + } catch (IOException e) { + logger.error(e.getLocalizedMessage()); + throw new BusinessException("导入错误"); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMap2ServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMap2ServiceImpl.java new file mode 100644 index 0000000..7806ead --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMap2ServiceImpl.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.Etype; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.FourColorMap2; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.FourColorMap2Mapper; +import com.gk.hotwork.Service.FourColorMap2Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("fourColorMap2Service") +public class FourColorMap2ServiceImpl extends ServiceImpl<FourColorMap2Mapper, FourColorMap2> implements FourColorMap2Service { + + @Autowired + FourColorMap2Mapper fourColorMap2Mapper; + + @Override + public void addOne(JSONObject mapJson, UserInfo userInfo) { + String type = mapJson.getString("type"); + String geometry = mapJson.getString("geometry"); + String properties = mapJson.getString("properties"); + Integer etype = mapJson.getInteger("etype"); + if (etype == null || StringUtils.isBlank(type) || StringUtils.isBlank(geometry) || StringUtils.isBlank(properties)) { + throw new BusinessException("参数不能为空"); + } + //检验 + Etype.parse(etype); + + FourColorMap2 fourColorMap2 = new FourColorMap2(); + fourColorMap2.setEtype(etype); + fourColorMap2.setGeometry(geometry); + fourColorMap2.setProperties(properties); + fourColorMap2.setType(type); + Date now = new Date(); + fourColorMap2.setCreateTime(now); + fourColorMap2.setCreateBy(userInfo.getRealname()); + fourColorMap2.setUpdateTime(now); + fourColorMap2.setValidFlag(true); + this.save(fourColorMap2); + } + + @Override + public List<FourColorMap2> getList2(Integer eType) { + Etype.parse(eType); + return fourColorMap2Mapper.selectList(new LambdaQueryWrapper<FourColorMap2>(). + eq(FourColorMap2::getEtype, eType) + .eq(FourColorMap2::getValidFlag, Boolean.TRUE)); + } + + @Override + public void delOne(Long id) { + if (id == null) throw new BusinessException("参数为空"); + FourColorMap2 byId = this.getById(id); + if (byId == null) throw new BusinessException("数据不存在"); + FourColorMap2 delOne = new FourColorMap2(); + delOne.setValidFlag(Boolean.FALSE); + delOne.setUpdateTime(new Date()); + delOne.setId(byId.getId()); + this.updateById(delOne); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMapServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMapServiceImpl.java new file mode 100644 index 0000000..a1c6179 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorMapServiceImpl.java @@ -0,0 +1,196 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.gk.hotwork.Domain.FourColorPoint; +import com.gk.hotwork.Domain.FourColorPointCoord; +import com.gk.hotwork.Domain.dto.FourColorMapDto; +import com.gk.hotwork.Domain.dto.FourColorPointLocateDto; +import com.gk.hotwork.Service.FourColorMapService; +import com.gk.hotwork.Service.FourColorPointCoordService; +import com.gk.hotwork.Service.FourColorPointService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class FourColorMapServiceImpl implements FourColorMapService { + + @Autowired + private FourColorPointService pointService; + + @Autowired + private FourColorPointCoordService coordService; + + @Transactional + @Override + public String insertOneMapPoint(FourColorMapDto mapDto) { + String result = null; + String dtoCheckResult = checkFourColorMapDto(mapDto); + if(dtoCheckResult == null){ + int step = 1; + FourColorPoint point = new FourColorPoint(); + point.setId(mapDto.getId()); + point.setEtype(mapDto.getEtype()); + point.setName(mapDto.getName()); + point.setType(mapDto.getType()); + point.setText(mapDto.getText()); + point.setShapeType(mapDto.getShapeType()); + point.setClampToGround(mapDto.isClampToGround()); + point.setGeoType(mapDto.getGeoType()); + point.setColor(mapDto.getColor()); + if(pointService.getById(point.getId()) != null){ + result = "ID已存在"; + return result; + } + if(pointService.save(point) == true){ + step = 2; + }else { + throw new RuntimeException("数据库保存点位失败"); + } + if(step == 2){ + List<FourColorPointCoord> coordList = new ArrayList<>(); + for(FourColorPointLocateDto locateDto : mapDto.getLocations()){ + FourColorPointCoord coord = new FourColorPointCoord(); + coord.setPointId(mapDto.getId()); + coord.setLon(locateDto.getLon()); + coord.setLat(locateDto.getLat()); + coord.setHei(locateDto.getHei()); + coordList.add(coord); + } + if(coordService.saveBatch(coordList) == true){ + step = 3; + }else { + result = "业务错误"; + throw new RuntimeException("数据库保存定位数据失败"); + } + } + }else { + result = dtoCheckResult; + } + return result; + } + + @Transactional + @Override + public boolean deleteMap(String id) { + boolean result = false; + FourColorPoint point = pointService.getById(id); + if(point == null || point.getId()==null || point.getId().isEmpty()){ + return false; + } + //1、删除位置信息 + List<FourColorPointCoord> coordList = coordService.findCoordListByPointId(id); + int step = 1; + if(coordList != null && coordList.size() > 0){ + List<Long> idList = new ArrayList<>(); + for(FourColorPointCoord coord : coordList){ + idList.add(coord.getId()); + } + if(coordService.removeByIds(idList) == true){ + step = 2; + }else { + throw new RuntimeException("数据库删除定位数据失败"); + } + } + //2、删除地图信息 + if(step == 2){ + if(pointService.removeById(point)){ + result = true; + }else { + throw new RuntimeException("数据库删除地图失败"); + } + } + return result; + } + + @Override + public JSONObject getOnePointJsonById(String id) { + JSONObject mapJson = null; + FourColorPoint point = pointService.getById(id); + List<FourColorPointCoord> coordList = coordService.findCoordListByPointId(id); + if(point != null && !point.getId().isEmpty()){ + mapJson = packageMapDto(point,coordList); + } + return mapJson; + } + + @Override + public List<JSONObject> getPointListJson(int etype) { + //非60万吨和130万吨类型 + if(etype != 1 && etype != 2){ + return null; + } + List<JSONObject> mapDtoListJson = null; + List<FourColorPoint> pointList = pointService.findPointListByEtype(etype); + if(pointList != null && pointList.size() > 0){ + mapDtoListJson = new ArrayList<>(); + for(FourColorPoint point : pointList){ + List<FourColorPointCoord> coordList = coordService.findCoordListByPointId(point.getId()); + JSONObject mapDtoJson = packageMapDto(point,coordList); + if(mapDtoJson != null && !mapDtoJson.isEmpty()){ + mapDtoListJson.add(mapDtoJson); + } + } + } + return mapDtoListJson; + } + + private String checkFourColorMapDto(FourColorMapDto dto){ + if(dto == null) + return "参数不能为空"; + if(dto.getId() == null || dto.getId().isEmpty()) + return "ID不能为空"; + if(dto.getEtype() == null || dto.getEtype() <= 0) + return "企业类型不能为空"; + if(dto.getEtype() != 1 && dto.getEtype() !=2) + return "企业类型错误"; + if(dto.getName() == null || dto.getName().isEmpty()) + return "名字不能为空"; + if(dto.getColor() == null || dto.getColor().isEmpty()) + return "颜色不能为空"; + if(dto.getText() == null || dto.getText().isEmpty()) + return "文字说明不能为空"; + if(dto.getGeoType() == null || dto.getGeoType().isEmpty()) + return "绘图形状不能为空"; + if(dto.getType() == null || dto.getType().isEmpty()) + return "四色图形状不能为空"; + if(dto.getShapeType() == null || dto.getShapeType().isEmpty()) + return "四色图形状不能为空"; + if(dto.getLocations() == null || dto.getLocations().size() <= 0) + return "坐标不能为空"; + return null; + } + + private JSONObject packageMapDto(FourColorPoint point,List<FourColorPointCoord> coordList){ + if(point == null) + return null; + JSONObject obj = JSONUtil.createObj(); + obj.put("type",point.getType()); + JSONObject prop = JSONUtil.createObj(); + prop.put("attr",JSONUtil.createObj().put("name",point.getName()).put("id",point.getId())); + prop.put("type",point.getShapeType()); + prop.put("style",JSONUtil.createObj().put("text",point.getText()).put("clampToGround",point.isClampToGround()).put("color",point.getColor())); + obj.put("properties",prop); + JSONObject geoLocate = JSONUtil.createObj(); + geoLocate.put("type",point.getGeoType()); + if(coordList != null && coordList.size() > 0){ + JSONArray coordArray = JSONUtil.createArray(); + for(FourColorPointCoord coord : coordList){ + JSONArray co = JSONUtil.createArray(); + co.add(coord.getLon()); + co.add(coord.getLat()); + co.add(coord.getHei()); + coordArray.add(co); + } + geoLocate.put("coordinates",coordArray); + } + obj.put("geometry",geoLocate); + return obj; + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointCoordServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointCoordServiceImpl.java new file mode 100644 index 0000000..1ae1f80 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointCoordServiceImpl.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.FourColorPointCoord; +import com.gk.hotwork.Mapper.FourColorPointCoordMapper; +import com.gk.hotwork.Mapper.FourColorPointMapper; +import com.gk.hotwork.Service.FourColorPointCoordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("FourColorPointCoordService") +public class FourColorPointCoordServiceImpl extends ServiceImpl<FourColorPointCoordMapper, FourColorPointCoord> implements FourColorPointCoordService { + + @Autowired + private FourColorPointCoordMapper pointCoordMapper; + + @Override + public List<FourColorPointCoord> findCoordListByPointId(String pointId) { + return pointCoordMapper.findCoordListByPointId(pointId); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointServiceImpl.java new file mode 100644 index 0000000..5063c3a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/FourColorPointServiceImpl.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.FourColorPoint; +import com.gk.hotwork.Mapper.FourColorPointMapper; +import com.gk.hotwork.Service.FourColorPointService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("FourColorPointService") +public class FourColorPointServiceImpl extends ServiceImpl<FourColorPointMapper,FourColorPoint> implements FourColorPointService { + + @Autowired + private FourColorPointMapper pointMapper; + + @Override + public List<FourColorPoint> findPointListByEtype(int etype) { + return pointMapper.findPointListByEtype(etype); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/GasWarnServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/GasWarnServiceImpl.java new file mode 100644 index 0000000..9b8d2df --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/GasWarnServiceImpl.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.GasWarnInfo; +import com.gk.hotwork.Domain.InvolveDepInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.DepartmentVo; +import com.gk.hotwork.Mapper.GasWarnInfoMapper; +import com.gk.hotwork.Service.GasWarnService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("GasWarnService") +public class GasWarnServiceImpl extends ServiceImpl<GasWarnInfoMapper, GasWarnInfo> implements GasWarnService { + @Autowired + GasWarnInfoMapper gasWarnInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<GasWarnInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("updatetime"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<GasWarnInfo> list = gasWarnInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public GasWarnInfo selectExistByType(Long id,String warntype, String gastype) { + return gasWarnInfoMapper.selectExistByType(id,warntype, gastype); + } + + @Override + public GasWarnInfo selectByType(String gastype, String warntype) { + return gasWarnInfoMapper.selectByType(gastype, warntype); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/HelpDocServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HelpDocServiceImpl.java new file mode 100644 index 0000000..cdffbc1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HelpDocServiceImpl.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.HelpDocInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.HelpDocInfoMapper; +import com.gk.hotwork.Service.HelpDocService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/6/16 10:21 + */ +@Service("HelpDocService") +public class HelpDocServiceImpl extends ServiceImpl<HelpDocInfoMapper, HelpDocInfo> implements HelpDocService { + @Autowired + private HelpDocInfoMapper helpDocInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<HelpDocInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("updated"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<HelpDocInfo> list = helpDocInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerLogServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerLogServiceImpl.java new file mode 100644 index 0000000..b569da5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerLogServiceImpl.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.HiddenDangerLog; +import com.gk.hotwork.Mapper.HiddenDangerLogMapper; +import com.gk.hotwork.Service.HiddenDangerLogService; +import org.springframework.stereotype.Service; + +@Service("hiddenDangerLogService") +public class HiddenDangerLogServiceImpl extends ServiceImpl<HiddenDangerLogMapper, HiddenDangerLog> implements HiddenDangerLogService { +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerResourceServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerResourceServiceImpl.java new file mode 100644 index 0000000..988e271 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerResourceServiceImpl.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.HiddenDangerResource; +import com.gk.hotwork.Mapper.HiddenDangerResourceMapper; +import com.gk.hotwork.Service.HiddenDangerResourceService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("hiddenDangerResourceService") +public class HiddenDangerResourceServiceImpl extends ServiceImpl<HiddenDangerResourceMapper,HiddenDangerResource> implements HiddenDangerResourceService { + @Override + public List<HiddenDangerResource> getResourcesByDangerId(Long id, String operation) { + LambdaQueryWrapper<HiddenDangerResource> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(HiddenDangerResource::getBelongid,id); + wrapper.eq(HiddenDangerResource::getOperation,operation); + return baseMapper.selectList(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerServiceImpl.java new file mode 100644 index 0000000..e7188ed --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/HiddenDangerServiceImpl.java @@ -0,0 +1,574 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.*; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.HiddenDanger; +import com.gk.hotwork.Domain.HiddenDangerResource; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Utils.Properties; +import com.gk.hotwork.Domain.Vo.HiddenDangerAppVo; +import com.gk.hotwork.Domain.Vo.HiddenDangerBySafeCheckVo; +import com.gk.hotwork.Domain.Vo.HiddenDangerVo; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.Mapper.HiddenDangerMapper; +import com.gk.hotwork.Service.HiddenDangerResourceService; +import com.gk.hotwork.Service.HiddenDangerService; +import com.gk.hotwork.Service.TaskService; +import com.gk.hotwork.Service.UserService; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; + +@Service("hiddenDangerService") +public class HiddenDangerServiceImpl extends ServiceImpl<HiddenDangerMapper, HiddenDanger> implements HiddenDangerService { + + @Autowired + private TaskService taskService; + @Autowired + private UserService userService; + @Autowired + private HiddenDangerResourceService hiddenDangerResourceService; + @Autowired + private HiddenDangerMapper hiddenDangerMapper; + + /** + * @Description: web 新增隐患报告 + * @date 2021/10/9 10:11 + */ + @Override + @Transactional + public HiddenDanger addReport(HiddenDangerVo hiddenDangerVo, UserInfo userInfo,HiddenDangerReportSource source) { + + //上传文件判断 + MultipartFile[] files = hiddenDangerVo.getFiles(); + if (files == null || files.length < 1) { + throw new BusinessException("请上传图片"); + } + Date now = new Date(); + //判空 + if (StringUtils.isBlank(hiddenDangerVo.getRectifymeasure())) throw new BusinessException("整改措施不能为空"); + if (hiddenDangerVo.getLevel() == null) throw new BusinessException("隐患级别不能为空"); + if (hiddenDangerVo.getRectifydeadline() == null) throw new BusinessException("整改截止日期不能为空"); + if (hiddenDangerVo.getRectifierid() == null) throw new BusinessException("请选择整改人"); + + HiddenDanger hiddenDanger = new HiddenDanger(); + hiddenDanger.setCreatenote(hiddenDangerVo.getNote()); + hiddenDanger.setLevel(hiddenDangerVo.getLevel()); + hiddenDanger.setCreatetime(now); + hiddenDanger.setRectifydeadline(hiddenDangerVo.getRectifydeadline()); + hiddenDanger.setRectifymeasure(hiddenDangerVo.getRectifymeasure()); + hiddenDanger.setRectifier(hiddenDangerVo.getRectifier()); + hiddenDanger.setRectifierid(hiddenDangerVo.getRectifierid()); + hiddenDanger.setStatus(HiddenDangerApplyStatus.TORECTIFY); + hiddenDanger.setSource(source.getCode()); + + //提出人 + UserInfo user = userService.getById(userInfo); + hiddenDanger.setRequestor(user.getRealname()); + hiddenDanger.setRequestorid(userInfo.getId()); + hiddenDanger.setValidflag(true); + //生成单号 规则 yyyy-MM(000n) + int num = this.countNumInMonth(userInfo.getId()); + hiddenDanger.setCode(CodeUtils.generateHiddenDangerCode("yyMM",hiddenDanger.getLevel() ,userInfo.getId(), ++ num)); + this.save(hiddenDanger); + + try { + for (int i = 0 ;i < files.length;i++) { + MultipartFile file = files[i]; + HiddenDangerResource hiddenDangerResource = new HiddenDangerResource(); + hiddenDangerResource.setBelongid(hiddenDanger.getId()); + hiddenDangerResource.setOriginalfilename(file.getOriginalFilename()); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setOperation(HiddenDangerApplyOperation.REPORT); + hiddenDangerResource.setSort(i + 1); + hiddenDangerResource.setType(file.getContentType()); + String newName = UploadUtil.uploadFile(file, Properties.hiddenDangerPath); + hiddenDangerResource.setFilename(newName); + hiddenDangerResource.setUrl(Properties.hiddenDanger + newName); + hiddenDangerResource.setValidflag(true); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setSource(SourceType.WEB); + hiddenDangerResourceService.save(hiddenDangerResource); + } + } catch (Exception e) { + e.printStackTrace(); + throw new BusinessException("文件上传出现问题"); + } + + + return hiddenDanger; + } + + + /** + * @Description: 巡检上报 接收文件的相对路径 + * @date 2022/5/19 10:04 + */ + @Transactional + public boolean addReportBySafeCheck(HiddenDangerBySafeCheckVo vo,UserInfo operator){ + boolean result = true; + Date now = new Date(); + //判断 + { + if (StringUtils.isBlank(vo.getRectifymeasure())) throw new BusinessException("整改措施不能为空"); + if (vo.getLevel() == null) throw new BusinessException("隐患级别不能为空"); + if (vo.getRectifydeadline() == null) throw new BusinessException("整改截止日期不能为空"); + if (vo.getRectifierid() == null) throw new BusinessException("请选择整改人"); + } + //保存 + HiddenDanger hiddenDanger = new HiddenDanger(); + hiddenDanger.setCreatenote(vo.getNote()); + hiddenDanger.setLevel(vo.getLevel()); + hiddenDanger.setCreatetime(now); + hiddenDanger.setRectifydeadline(vo.getRectifydeadline()); + hiddenDanger.setRectifymeasure(vo.getRectifymeasure()); + hiddenDanger.setRectifier(vo.getRectifier()); + hiddenDanger.setRectifierid(vo.getRectifierid()); + hiddenDanger.setStatus(HiddenDangerApplyStatus.TORECTIFY); + hiddenDanger.setSource(HiddenDangerReportSource.SAFE_CHECK.getCode()); + hiddenDanger.setRequestor(operator.getRealname()); + hiddenDanger.setRequestorid(operator.getId()); + hiddenDanger.setValidflag(true); + //生成单号 规则 yyyy-MM(000n) + int num = this.countNumInMonth(operator.getId()); + hiddenDanger.setCode(CodeUtils.generateHiddenDangerCode("yyMM",hiddenDanger.getLevel() ,operator.getId(), ++ num)); + if(this.save(hiddenDanger) == false){ + result = false; + throw new RuntimeException("数据库插入隐患信息失败"); + } + if (vo.getUrls() != null && vo.getUrls().size() > 0) { + List<HiddenDangerResource> hiddenDangerResourceList = new ArrayList<>(); + for (int i=0;i<vo.getUrls().size();i++) { + if(vo.getUrls().get(i) != null){ + HiddenDangerResource hiddenDangerResource = new HiddenDangerResource(); + hiddenDangerResource.setBelongid(hiddenDanger.getId()); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setOperation(HiddenDangerApplyOperation.REPORT); + hiddenDangerResource.setSort(i + 1); + hiddenDangerResource.setUrl(vo.getUrls().get(i)); + hiddenDangerResource.setValidflag(true); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setSource(SourceType.WEB); + hiddenDangerResourceList.add(hiddenDangerResource); + } + } + if(hiddenDangerResourceList.size() > 0){ + if(hiddenDangerResourceService.saveBatch(hiddenDangerResourceList) == false){ + result = false; + throw new RuntimeException("数据库保存资源失败"); + } + } + } + return result; + } + + + /** + * @Description: web 隐患整改 + * @date 2021/10/9 13:48 + */ + @Override + @Transactional + public HiddenDanger hiddenDangerRectify(HiddenDangerVo hiddenDangerVo) { + + Long id = hiddenDangerVo.getId(); + if (id == null) + throw new BusinessException("参数传递错误"); + + HiddenDanger hiddenDanger = this.getById(id); + if (hiddenDanger == null) + throw new BusinessException("找不到该相应隐患"); + + Date now = new Date(); + HiddenDanger updateOne = new HiddenDanger(); + updateOne.setId(id); + updateOne.setRectifynote(hiddenDangerVo.getNote()); + updateOne.setRectifytime(now); + updateOne.setStatus(HiddenDangerApplyStatus.TOACCEPT); + this.updateById(updateOne); + + //覆盖原有上传图片 + List<HiddenDangerResource> list = hiddenDangerResourceService.list( + new LambdaQueryWrapper<HiddenDangerResource>() + .eq(HiddenDangerResource::getBelongid, id) + .eq(HiddenDangerResource::getOperation, HiddenDangerApplyOperation.RECTIFICATION) + .eq(HiddenDangerResource::getValidflag, Boolean.TRUE)); + if (list != null && list.size() > 0) { + for (HiddenDangerResource delOne : list) { + delOne.setValidflag(Boolean.FALSE); + hiddenDangerResourceService.updateById(delOne); + } + } + //插入新图片 + MultipartFile[] files = hiddenDangerVo.getFiles(); + try { + if (files != null && files.length > 0) { + for (int i = 0 ;i < files.length;i++) { + MultipartFile file = files[i]; + HiddenDangerResource hiddenDangerResource = new HiddenDangerResource(); + hiddenDangerResource.setBelongid(hiddenDanger.getId()); + hiddenDangerResource.setOriginalfilename(file.getOriginalFilename()); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setOperation(HiddenDangerApplyOperation.RECTIFICATION); + hiddenDangerResource.setSort(i + 1); + hiddenDangerResource.setType(file.getContentType()); + String newName = UploadUtil.uploadFile(file, Properties.hiddenDangerPath); + hiddenDangerResource.setFilename(newName); + hiddenDangerResource.setUrl(Properties.hiddenDanger + newName); + hiddenDangerResource.setValidflag(true); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setSource(SourceType.WEB); + hiddenDangerResourceService.save(hiddenDangerResource); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new BusinessException("文件上传出现问题"); + } + return hiddenDanger; + + } + + + /** + * @Description: app上报 + * @date 2021/10/9 14:44 + */ + @Override + @Transactional + public HiddenDanger addReportByApp(HiddenDangerAppVo hiddenDangerAppVo, UserInfo userInfo) { + +; if (StringUtils.isBlank(hiddenDangerAppVo.getRectifymeasure())) throw new BusinessException("整改措施不能为空"); + if (hiddenDangerAppVo.getLevel() == null) throw new BusinessException("隐患级别不能为空"); + if (hiddenDangerAppVo.getRectifydeadline() == null) throw new BusinessException("整改截止日期不能为空"); + if (hiddenDangerAppVo.getRectifierid() == null) throw new BusinessException("请选择整改人"); + + List<String> urls = hiddenDangerAppVo.getUrls(); + if(urls == null || urls.size() < 1 ) throw new BusinessException("请上传图片"); + + Date now = new Date(); + + HiddenDanger hiddenDanger = new HiddenDanger(); + hiddenDanger.setCreatenote(hiddenDangerAppVo.getNote()); + hiddenDanger.setLevel(hiddenDangerAppVo.getLevel()); + hiddenDanger.setCreatetime(now); + hiddenDanger.setRectifydeadline(hiddenDangerAppVo.getRectifydeadline()); + hiddenDanger.setRectifymeasure(hiddenDangerAppVo.getRectifymeasure()); + hiddenDanger.setRectifier(hiddenDangerAppVo.getRectifier()); + hiddenDanger.setRectifierid(hiddenDangerAppVo.getRectifierid()); + hiddenDanger.setStatus(HiddenDangerApplyStatus.TORECTIFY); + hiddenDanger.setSource(HiddenDangerReportSource.NORMAL.getCode()); + + //提出人 + UserInfo user = userService.getById(userInfo); + hiddenDanger.setRequestor(user.getRealname()); + hiddenDanger.setRequestorid(userInfo.getId()); + hiddenDanger.setValidflag(true); + //生成单号 规则 yyyy-MM(000n) + int num = this.countNumInMonth(userInfo.getId()); + hiddenDanger.setCode(CodeUtils.generateHiddenDangerCode("yyMM",hiddenDanger.getLevel() ,userInfo.getId(), ++ num)); + this.save(hiddenDanger); + + for (int i = 0; i < urls.size(); i++) { + String url = urls.get(i); + HiddenDangerResource hiddenDangerResource = new HiddenDangerResource(); + hiddenDangerResource.setValidflag(true); + hiddenDangerResource.setSource(SourceType.APP); + hiddenDangerResource.setUrl(url); + hiddenDangerResource.setOperation(HiddenDangerApplyOperation.REPORT); + hiddenDangerResource.setSort(i + 1); + hiddenDangerResource.setBelongid(hiddenDanger.getId()); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResourceService.save(hiddenDangerResource); + } + return hiddenDanger; + + } + + + /** + * @Description: app整改 + */ + @Override + @Transactional + public HiddenDanger rectifyHiddenDangerByApp(HiddenDangerAppVo hiddenDangerAppVo, UserInfo user) { + + Long id = hiddenDangerAppVo.getId(); + if (id == null) + throw new BusinessException("参数传递错误"); + + HiddenDanger hiddenDanger = this.getById(id); + if (hiddenDanger == null) + throw new BusinessException("找不到该相应隐患"); + + Date now = new Date(); + HiddenDanger updateOne = new HiddenDanger(); + updateOne.setId(id); + updateOne.setRectifynote(hiddenDangerAppVo.getNote()); + updateOne.setRectifytime(now); + updateOne.setStatus(HiddenDangerApplyStatus.TOACCEPT); + this.updateById(updateOne); + + //覆盖原有上传图片 + List<HiddenDangerResource> list = hiddenDangerResourceService.list( + new LambdaQueryWrapper<HiddenDangerResource>() + .eq(HiddenDangerResource::getBelongid, id) + .eq(HiddenDangerResource::getOperation, HiddenDangerApplyOperation.RECTIFICATION) + .eq(HiddenDangerResource::getValidflag, Boolean.TRUE)); + if (list != null && list.size() > 0) { + for (HiddenDangerResource delOne : list) { + delOne.setValidflag(Boolean.FALSE); + hiddenDangerResourceService.updateById(delOne); + } + } + //新增图片 + List<String> urls = hiddenDangerAppVo.getUrls(); + if (urls != null && urls.size() > 0) { + for (int i = 0 ;i < urls.size();i++) { + String url = urls.get(i); + HiddenDangerResource hiddenDangerResource = new HiddenDangerResource(); + hiddenDangerResource.setBelongid(hiddenDanger.getId()); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setOperation(HiddenDangerApplyOperation.RECTIFICATION); + hiddenDangerResource.setSort(i + 1); + hiddenDangerResource.setUrl(url); + hiddenDangerResource.setValidflag(true); + hiddenDangerResource.setCreatetime(now); + hiddenDangerResource.setSource(SourceType.APP); + hiddenDangerResourceService.save(hiddenDangerResource); + } + } + return hiddenDanger; + + } + + + /** + * @Description: 上报页面 + * @date 2022/3/24 10:12 + */ + @Override + public IPage selectReportPages(Page<HiddenDanger> page, Map filter, UserInfo user) { + Map<String, Object> params = new HashMap<>(); + params.put("requestorid", user.getId()); + params.put("status",filter.get("status")); + params.put("code",filter.get("code")); + params.put("level", filter.get("level")); + params.put("rectifierName", filter.get("rectifierName")); + params.put("source",filter.get("source")); + return hiddenDangerMapper.selectPages(page,params); + } + + /** + * @Description: 整改页面 + */ + @Override + public IPage selectRectifyPages(Page<HiddenDanger> page, Map filter, UserInfo user) { + Map<String, Object> params = new HashMap<>(); + params.put("rectifierid", user.getId()); + params.put("requestorName", filter.get("requestorName")); + params.put("status",filter.get("status")); + params.put("level", filter.get("level")); + params.put("code",filter.get("code")); + params.put("source",filter.get("source")); + params.put("overTime", filter.get("overTime")); + return hiddenDangerMapper.selectPages(page,params); + } + + + /** + * @Description: 验收页面 + */ + @Override + public IPage<HiddenDanger> selectAcceptPages(Page<HiddenDanger> page, Map<String, Object> filter, UserInfo user) { + + Map<String, Object> params = new HashMap<>(); + params.put("requestorid", user.getId()); + params.put("status", HiddenDangerApplyStatus.TOACCEPT); + params.put("level", filter.get("level")); + params.put("code",filter.get("code")); + params.put("rectifierName", filter.get("rectifierName")); + params.put("source",filter.get("source")); + + return hiddenDangerMapper.selectPages(page,params); + } + + @Override + public int countNumInMonth(Long id) { + return hiddenDangerMapper.countNumInMonth(id); + } + + @Override + public Integer selectOverTimeNum(HiddenDangerApplyStatus status,Long userId) { + LambdaQueryWrapper<HiddenDanger> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(HiddenDanger::getValidflag, true); + queryWrapper.lt(HiddenDanger::getRectifydeadline, new Date()); + if (userId != null) + queryWrapper.eq(HiddenDanger::getRectifierid, userId); + if (status != null) + queryWrapper.eq(HiddenDanger::getStatus, status); + return hiddenDangerMapper.selectCount(queryWrapper); + } + + @Override + public Map getAppAnalysis(UserInfo userInfo) { + //1.待整改 + Integer num1 = this.selectCurrentNum(HiddenDangerApplyStatus.TORECTIFY,userInfo.getId()); + Integer num2 = this.selectCurrentNum(HiddenDangerApplyStatus.REJECTED,userInfo.getId()); + Integer toRectify = num1 + num2; + //2.待验收 + Integer toAccept = this.selectCurrentNum(HiddenDangerApplyStatus.TOACCEPT,userInfo.getId()); + //3.逾期未整改 + Integer num3 = this.selectOverTimeNum(HiddenDangerApplyStatus.TORECTIFY,userInfo.getId()); + Integer num4 = this.selectOverTimeNum(HiddenDangerApplyStatus.REJECTED,userInfo.getId()); + Integer overTimeToRectify = num3 + num4; + //4.待巡检任务数量 + Integer toCheck = 0; + //5.超期未巡检任务 + Integer overTimeCheck = 0; + Map<String, Object> result = new HashMap<>(); + result.put("toRectify", toRectify); + result.put("toAccept", toAccept); + result.put("toCheck", toCheck); + result.put("overTimeToRectify", overTimeToRectify); + result.put("overTimeCheck", overTimeCheck); + return result; + } + + @Override + public Integer selectCurrentNum(HiddenDangerApplyStatus status, Long userId) { + LambdaQueryWrapper<HiddenDanger> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(HiddenDanger::getValidflag, true); + if (userId != null) + queryWrapper.eq(HiddenDanger::getRectifierid, userId); + if (status != null) + queryWrapper.eq(HiddenDanger::getStatus, status); + return hiddenDangerMapper.selectCount(queryWrapper); + } + + + /** + * @Description: 管理员看 + * @date 2021/10/14 15:41 + */ + @Override + public PageInfoExtension<Map> selectRectifyStatisticsPages(Page<HiddenDanger> page, Map filter, UserInfo user) { + Map<String, Object> params = new HashMap<>(); + params.put("status", filter.get("status")); + params.put("level", filter.get("level")); + params.put("requestorName", filter.get("requestorName")); + params.put("rectifierName", filter.get("rectifierName")); + params.put("source", filter.get("source")); + Page pageInfo = hiddenDangerMapper.selectPages(page, params); + PageInfoExtension<Map> extension = new PageInfoExtension<>(pageInfo); + Map<String, Integer> rectifyStatistics = new HashMap<>(); + //设置统计数 + { + //完成数量 + rectifyStatistics.put("completednum", this.selectNum(HiddenDangerApplyStatus.COMPLETED)); + //上报数量 + rectifyStatistics.put("reportnum", this.selectNum(null)); + //驳回数量 + rectifyStatistics.put("rejectnum", this.selectNum(HiddenDangerApplyStatus.REJECTED)); + //待整改数量(包括驳回待整改) + rectifyStatistics.put("2rectifynum", this.selectNum(HiddenDangerApplyStatus.TORECTIFY) + rectifyStatistics.get("rejectnum")); + //待验收数量 + rectifyStatistics.put("2acceptnum", this.selectNum(HiddenDangerApplyStatus.TOACCEPT)); + } + extension.setExtension(rectifyStatistics); + return extension; + } + + @Override + public Integer selectNum(HiddenDangerApplyStatus status) { + LambdaQueryWrapper<HiddenDanger> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(HiddenDanger::getValidflag, true); + if (status != null) + queryWrapper.eq(HiddenDanger::getStatus, status); + return hiddenDangerMapper.selectCount(queryWrapper); + } + + + + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<HiddenDanger> page = PageUtil.getPage(pageInfo,"hiddendanger.createtime"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("hiddendanger.createtime"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<HiddenDanger> dangers = hiddenDangerMapper.selectDataGrid(pageInfo.getCondition(),page); + for (HiddenDanger danger : dangers){ + List<HiddenDangerResource>reportResources = hiddenDangerResourceService.getResourcesByDangerId(danger.getId(),"REPORT"); + List<HiddenDangerResource>resources = hiddenDangerResourceService.getResourcesByDangerId(danger.getId(),"RECTIFICATION"); + danger.setReportResources(reportResources); + danger.setRectifyResources(resources); + } + pageInfo.setResult(dangers); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public void selectStatisticsData(PageInfo pageInfo) { + Page<HiddenDanger> page = PageUtil.getPage(pageInfo,"hiddendanger.createtime"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("hiddendanger.createtime"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<HiddenDanger> dangers = hiddenDangerMapper.selectStatisticsData(pageInfo.getCondition(),page); + pageInfo.setResult(dangers); + pageInfo.setTotalCount(page.getTotal()); + } + + + @Override + public HiddenDanger acceptHiddenDanger(Long id, UserInfo user) { + if (id == null) throw new BusinessException("id参数不能为空"); + int count = this.count(new LambdaQueryWrapper<HiddenDanger>() + .eq(HiddenDanger::getId, id) + .eq(HiddenDanger::getValidflag,Boolean.TRUE)); + if (count < 1) throw new BusinessException("找不到相应实体"); + HiddenDanger acceptOne = new HiddenDanger(); + acceptOne.setId(id); + acceptOne.setStatus(HiddenDangerApplyStatus.COMPLETED); + acceptOne.setAccepttime(new Date()); + this.updateById(acceptOne); + return acceptOne; + } + + @Override + public HiddenDanger rejectHiddenDanger(Long id, String rejectNote, UserInfo user) { + if (id == null) throw new BusinessException("id参数不能为空"); + if (StringUtils.isBlank(rejectNote)) throw new BusinessException("请填写驳回理由"); + int count = this.count(new LambdaQueryWrapper<HiddenDanger>() + .eq(HiddenDanger::getId, id) + .eq(HiddenDanger::getValidflag,Boolean.TRUE)); + if (count < 1) throw new BusinessException("找不到相应实体"); + HiddenDanger rejectOne = new HiddenDanger(); + rejectOne.setId(id); + rejectOne.setRejectnote(rejectNote); + rejectOne.setRejecttime(new Date()); + rejectOne.setStatus(HiddenDangerApplyStatus.REJECTED); + this.updateById(rejectOne); + return rejectOne; + } + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/InvolveDepServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/InvolveDepServiceImpl.java new file mode 100644 index 0000000..48ab63b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/InvolveDepServiceImpl.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.InvolveDepInfo; +import com.gk.hotwork.Mapper.InvolveDepInfoMapper; +import com.gk.hotwork.Service.InvolveDepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("InvolveDepService") +public class InvolveDepServiceImpl extends ServiceImpl<InvolveDepInfoMapper, InvolveDepInfo> implements InvolveDepService { + @Autowired + InvolveDepInfoMapper involveDepInfoMapper; + + @Override + public void deleteByName(String department) { + involveDepInfoMapper.deleteByName(department); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentAlarmImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentAlarmImpl.java new file mode 100644 index 0000000..7f3092c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentAlarmImpl.java @@ -0,0 +1,130 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.MajorEquipment; +import com.gk.hotwork.Domain.MajorEquipmentAlarm; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.MajorEquipmentAlarmMapper; +import com.gk.hotwork.Service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Service("MajorEquipmentAlarmService") +@Transactional +public class MajorEquipmentAlarmImpl extends ServiceImpl<MajorEquipmentAlarmMapper,MajorEquipmentAlarm> implements MajorEquipmentAlarmService { + + @Autowired + private MajorEquipmentAlarmMapper majorEquipmentAlarmMapper; + @Autowired + MajorEquipmentService majorEquipmentService; + @Autowired + private UserService userService; + @Autowired + private SmsService smsService; + + + + /** + * @Description: 分页 + */ + @Override + public IPage<MajorEquipmentAlarm> selectPage(Page<MajorEquipmentAlarm> page, Map<String, Object> filter, UserInfo user) { + return majorEquipmentAlarmMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(MajorEquipmentAlarm param, UserInfo user) { + requiredVerification(param); + + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(user.getRealname()); + param.setCreateBy(user.getRealname()); + param.setUpdateTime(new Date()); + param.setCreateTime(new Date()); + this.save(param); + //短信任务单独跑个线程 + MajorEquipment equipment = majorEquipmentService.getById(param.getEquipmentId()); + Long userId = equipment.getUserId(); + + Runnable smsTask = () -> { + if (userId == null) return; + UserInfo userInfo = userService.getById(userId); + if (userInfo == null) return; + if (StringUtils.isBlank(userInfo.getUsername()) || StringUtils.isBlank(userInfo.getRealname())) return; + Map<String, Object> params = new HashMap<>(); + params.put("name", equipment.getName()); + params.put("info", param.getAlarmInfo()); + params.put("date", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(param.getAlarmTime())); + smsService.send(userInfo.getUsername(), "245614", userInfo.getRealname(), params); + }; + + new Thread(smsTask).start(); + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(MajorEquipmentAlarm param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + + param.setUpdateTime(new Date()); + param.setUpdateBy(user.getRealname()); + this.updateById(param); + } + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); + + MajorEquipmentAlarm delOne = new MajorEquipmentAlarm(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + + } + + /** + * 查询验证 + * 验证对象存在 + */ + public void selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + MajorEquipmentAlarm MajorEquipmentAlarm = this.getById(id); + if (MajorEquipmentAlarm == null) throw new BusinessException("找不到对应实体"); + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(MajorEquipmentAlarm param){ + if (param.getEquipmentId() == null) throw new BusinessException("请选择设备"); + if (param.getStatus() == null) throw new BusinessException("请选择状态"); + if (param.getAlarmTime() == null) throw new BusinessException("请选择报警时间"); + if(StringUtils.isBlank(param.getAlarmInfo())) throw new BusinessException("请填写报警信息"); + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentDataImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentDataImpl.java new file mode 100644 index 0000000..cd59bff --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentDataImpl.java @@ -0,0 +1,119 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.MajorEquipment; +import com.gk.hotwork.Domain.MajorEquipmentData; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Mapper.MajorEquipmentDataMapper; +import com.gk.hotwork.Mapper.MajorEquipmentMapper; +import com.gk.hotwork.Service.MajorEquipmentDataService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("MajorEquipmentDataService") +@Transactional +public class MajorEquipmentDataImpl extends ServiceImpl<MajorEquipmentDataMapper,MajorEquipmentData> implements MajorEquipmentDataService { + + @Autowired + private MajorEquipmentMapper majorEquipmentMapper; + @Autowired + private MajorEquipmentDataMapper majorEquipmentDataMapper; + + + /** + * @Description: 分页 + */ + @Override + public IPage<MajorEquipmentData> selectPage(Page<MajorEquipmentData> page, Map<String, Object> filter, UserInfo user) { + return majorEquipmentDataMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(MajorEquipmentData param, UserInfo user) { + requiredVerification(param); + + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(user.getRealname()); + param.setCreateBy(user.getRealname()); + param.setUpdateTime(new Date()); + param.setCreateTime(new Date()); + this.save(param); + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(MajorEquipmentData param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + + param.setUpdateTime(new Date()); + param.setUpdateBy(user.getRealname()); + this.updateById(param); + } + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); + + MajorEquipmentData delOne = new MajorEquipmentData(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + + } + + @Override + public void importData(List<MajorEquipmentData> param, UserInfo user) { + if (CollectionUtils.isNotEmpty(param)){ + for (MajorEquipmentData majorEquipmentData :param){ + majorEquipmentData.setValidFlag(Boolean.TRUE); + majorEquipmentData.setUpdateBy(user.getRealname()); + majorEquipmentData.setCreateBy(user.getRealname()); + majorEquipmentData.setUpdateTime(new Date()); + majorEquipmentData.setCreateTime(new Date()); + this.save(majorEquipmentData); + } + } + } + + /** + * 查询验证 + * 验证对象存在 + */ + public void selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + MajorEquipmentData MajorEquipmentData = this.getById(id); + if (MajorEquipmentData == null) throw new BusinessException("找不到对应实体"); + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(MajorEquipmentData param){ + if (param.getEquipmentId() == null) throw new BusinessException("请选择设备"); + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentImpl.java new file mode 100644 index 0000000..475fe80 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/MajorEquipmentImpl.java @@ -0,0 +1,136 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.MajorEquipment; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.MajorEquipmentAlarm; +import com.gk.hotwork.Domain.MajorEquipmentData; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.MajorEquipmentAlarmMapper; +import com.gk.hotwork.Mapper.MajorEquipmentDataMapper; +import com.gk.hotwork.Mapper.MajorEquipmentMapper; +import com.gk.hotwork.Service.MajorEquipmentService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("MajorEquipmentService") +@Transactional +public class MajorEquipmentImpl extends ServiceImpl<MajorEquipmentMapper,MajorEquipment> implements MajorEquipmentService { + + @Autowired + private MajorEquipmentMapper majorEquipmentMapper; + + @Autowired + private MajorEquipmentAlarmMapper majorEquipmentAlarmMapper; + + @Autowired + private MajorEquipmentDataMapper majorEquipmentDataMapper; + + /** + * @Description: 分页 + */ + @Override + public IPage<MajorEquipment> selectPage(Page<MajorEquipment> page, Map<String, Object> filter, UserInfo user) { + return majorEquipmentMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(MajorEquipment param, UserInfo user) { + requiredVerification(param); + + List<MajorEquipment> list = majorEquipmentMapper.getBySerialNumber(param); + if (CollectionUtils.isEmpty(list)){ + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(user.getRealname()); + param.setCreateBy(user.getRealname()); + param.setUpdateTime(new Date()); + param.setCreateTime(new Date()); + this.save(param); + } else{ + throw new BusinessException("该设备编号已存在对应的设备!"); + } + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(MajorEquipment param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + + List<MajorEquipment> list = majorEquipmentMapper.getBySerialNumber(param); + if (CollectionUtils.isEmpty(list)){ + param.setUpdateTime(new Date()); + param.setUpdateBy(user.getRealname()); + this.updateById(param); + } else{ + throw new BusinessException("该设备编号已存在对应的设备!"); + } + + } + + /** + * @Description: 删除 + * 删除数据表 + * 删除报警信息表 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); + + MajorEquipment delOne = new MajorEquipment(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + +// majorEquipmentAlarmMapper.deleteByEquipmentId(id,user.getRealname(),new Date()); +// majorEquipmentDataMapper.deleteByEquipmentId(id,user.getRealname(),new Date()); + } + + @Override + public List<MajorEquipment> getMajorEquipment() { + return majorEquipmentMapper.getMajorEquipment(); + } + + /** + * 查询验证 + * 验证对象存在 + */ + public void selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + MajorEquipment MajorEquipment = this.getById(id); + if (MajorEquipment == null) throw new BusinessException("找不到对应实体"); + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(MajorEquipment param){ + if(StringUtils.isBlank(param.getName())) throw new BusinessException("请填写要素名称"); + if(StringUtils.isBlank(param.getSerialNumber())) throw new BusinessException("请填写设备编号"); + if (param.getStatus() == null) throw new BusinessException("请选择设备状态"); + if (param.getVolume() == null) throw new BusinessException("请填写设备容积"); + if (param.getUserId() == null) throw new BusinessException("请选择设备负责人"); + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/PermissionServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/PermissionServiceImpl.java new file mode 100644 index 0000000..6995af8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/PermissionServiceImpl.java @@ -0,0 +1,146 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.PermissionInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.Menu; +import com.gk.hotwork.Mapper.PermissionInfoMapper; +import com.gk.hotwork.Service.PermissionService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +@Service("PermissionService") +public class PermissionServiceImpl extends ServiceImpl<PermissionInfoMapper, PermissionInfo> implements PermissionService { + @Autowired + private PermissionInfoMapper permissionInfoMapper; + @Autowired + private UserService userService; + + @Override + public List<Menu> selectByUserId(String userId) { + List<Menu> menus = new ArrayList<>(); + + UserInfo userInfo = userService.getById(Integer.parseInt(userId)); + if (null != userInfo && null != userInfo.getType()){ + List<PermissionInfo> permissionInfoList = permissionInfoMapper.selectAll(); + if (userInfo.getType() == 1){ + //返回所有菜单 + for (PermissionInfo permissionInfo : permissionInfoList){ + //一级菜单 + if (null == permissionInfo.getParentid()){ + Menu pmenu = new Menu(); + BeanUtils.copyProperties(permissionInfo,pmenu,Menu.class); + List<Menu> iterateMenuList = iterateMenus(permissionInfoList,permissionInfo.getId()); + pmenu.setChildren(iterateMenuList); + menus.add(pmenu); + } + } + } + else if (userInfo.getType() == 2){ + //排除系统管理 + for (PermissionInfo permissionInfo : permissionInfoList){ + //一级菜单 + if (null == permissionInfo.getParentid() && !permissionInfo.getTitle().equals("权限管理")){ + Menu pmenu = new Menu(); + BeanUtils.copyProperties(permissionInfo,pmenu,Menu.class); + List<Menu> iterateMenuList = iterateMenus(permissionInfoList,permissionInfo.getId()); + pmenu.setChildren(iterateMenuList); + menus.add(pmenu); + } + } + } + else { + permissionInfoList = permissionInfoMapper.selectByUserId(userId); + for (PermissionInfo permissionInfo : permissionInfoList){ + if (permissionInfo.getParentid() == null) { + Menu pmenu = new Menu(); + BeanUtils.copyProperties(permissionInfo,pmenu,Menu.class); + List<Menu> iterateMenuList = iterateMenus(permissionInfoList,permissionInfo.getId()); + if (iterateMenuList.size() > 0) { + pmenu.setChildren(iterateMenuList); + menus.add(pmenu); + } + } + + + } + } + } + return menus; + } + + private List<Menu> iterateMenus(List<PermissionInfo> permissionInfoList, Integer pid) { + List<Menu> result = new ArrayList<Menu>(); + for (PermissionInfo resource : permissionInfoList) { + Integer menuid = resource.getId();//获取菜单的id + Integer parentid = resource.getParentid();//获取菜单的父id + if(null != parentid && (parentid.equals(pid))){ + Menu pmenu = new Menu(); + BeanUtils.copyProperties(resource,pmenu,Menu.class); + List<Menu> iterateMenu = iterateMenus(permissionInfoList,menuid); + pmenu.setChildren(iterateMenu); + result.add(pmenu); + } + } + return result; + } + + private List<Menu> addMenuList(List<PermissionInfo> permissionInfoList) { + List<Menu> menuList = new ArrayList<Menu>(); + //一级菜单 + for (PermissionInfo permissionInfo : permissionInfoList) { + if (permissionInfo.getType() == 1 && permissionInfo.getLevel() == 1 && permissionInfo.getStatus() == 1){ + Menu menu = new Menu(); + BeanUtils.copyProperties(permissionInfo,menu,Menu.class); + List<Menu> childList = new ArrayList<Menu>(); + menu.setChildren(childList); + menuList.add(menu); + } + } + //二级菜单 + for (PermissionInfo permissionInfo : permissionInfoList) { + if (permissionInfo.getType() == 1 && permissionInfo.getLevel() == 2 && permissionInfo.getStatus() == 1){ + boolean isfound = false; + for (Menu menu : menuList){ + if (menu.getId().equals(permissionInfo.getParentid())){ + Menu pmenu = new Menu(); + BeanUtils.copyProperties(permissionInfo,pmenu,Menu.class); + List<Menu> secList = iterateMenus(permissionInfoList,permissionInfo.getId()); + pmenu.setChildren(secList); + menu.getChildren().add(pmenu); + isfound = true; + break; + } + } + if (!isfound){ + PermissionInfo onePermission = this.getById(permissionInfo.getParentid()); + if (onePermission != null) { + Menu childmenu = new Menu(); + BeanUtils.copyProperties(permissionInfo,childmenu,Menu.class); + List<Menu> secList = new ArrayList<Menu>(); + childmenu.setChildren(secList); + + Menu onemenu = new Menu(); + BeanUtils.copyProperties(onePermission,onemenu,Menu.class); + List<Menu> childList = new ArrayList<Menu>(); + childList.add(childmenu); + onemenu.setChildren(childList); + menuList.add(onemenu); + } + } + } + } + + + return menuList.stream().sorted(Comparator.comparing(Menu::getSortorder)).collect(Collectors.toList()); + } + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/ReserveServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ReserveServiceImpl.java new file mode 100644 index 0000000..f95afe0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/ReserveServiceImpl.java @@ -0,0 +1,207 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Enum.ErrorCode; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Reserve; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.Mapper.ReserveMapper; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.ReserveService; +import com.gk.hotwork.Service.UserService; +import org.omg.PortableInterceptor.INACTIVE; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Service("reserveService") +public class ReserveServiceImpl extends ServiceImpl<ReserveMapper, Reserve> implements ReserveService { + + @Autowired + private ReserveMapper reserveMapper; + @Autowired + private UserService userService; + @Autowired + private DepartmentService departmentService; + + + /** + * @Description: 新增预约 + * @date 2021/11/16 9:58 + */ + @Override + public void addOne(Reserve reserve, UserInfo userInfo) { + + //0.角色为部门负责人 + UserInfo user = userService.getById(userInfo); + Byte isDepartment = user.getIsdepartment(); + if ((byte) 1 != isDepartment) + throw new BusinessException("当前用户不是部门负责人,没有权限创建"); + + Date now = new Date(); + Calendar instance = Calendar.getInstance(); + instance.setTime(now); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + Date judgement = instance.getTime(); + //1.预约时间 + Date appointment = reserve.getAppointment(); + if (appointment == null) + throw new BusinessException("预约时间为空"); + if (appointment.before(judgement)) + throw new BusinessException("预约时间为明日起"); + + //2.统计预约时间当日 该部门是否有单子 + if (userInfo.getDepartment() == null) { + throw new BusinessException("用户未有部门"); + } + DepartmentInfo dep = departmentService.getById(userInfo.getDepartment()); + if (dep == null) { + throw new BusinessException("用户部门不存在"); + } + if (this.isExistAtAppointment(appointment, dep.getDepartment())) + throw new BusinessException("预约当日已有预约单"); + + reserve.setCreateby(user.getId()); + reserve.setCreatebyname(user.getRealname()); + reserve.setUpdatebyname(user.getRealname()); + reserve.setCreatetime(now); + reserve.setUpdatetime(now); + reserve.setCreatebydepartment(dep.getDepartment()); + this.save(reserve); + } + + /** + * @Description: 判断预约当日是否存在单子 + * @date 2021/11/16 10:53 + */ + @Override + public boolean isExistAtAppointment(Date appointment,String department) { + + if (appointment == null) + throw new BusinessException("预约时间不能为空"); + if (StringUtils.isBlank(department)) + throw new BusinessException("部门不能为空"); + + Calendar instance = Calendar.getInstance(); + instance.setTime(appointment); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + Date startTime = instance.getTime(); + instance.set(Calendar.HOUR_OF_DAY, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + Date endTime = instance.getTime(); + + LambdaQueryWrapper<Reserve> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ge(Reserve::getAppointment, startTime) + .le(Reserve::getAppointment, endTime) + .eq(Reserve::getCreatebydepartment, department) + .eq(Reserve::getValidflag, true); + return reserveMapper.selectCount(queryWrapper) > 0; + + + } + + /** + * @Description: 修改单子 + * @date 2021/11/16 11:02 + */ + @Override + public void modOne(Reserve reserve, UserInfo userInfo) { + + if (reserve.getId() == null) + throw new BusinessException("参数传递有误"); + Reserve old = this.getById(reserve); + + //0.角色为部门负责人 + UserInfo user = userService.getById(userInfo); + Byte isDepartment = user.getIsdepartment(); + if ((byte) 1 != isDepartment) + throw new BusinessException("当前用户不是部门负责人,没有权限修改"); + + if (!old.getCreatebydepartment().equals(user.getDepartment())) + throw new BusinessException("当前用户不是当前单子的部门负责人"); + + Date now = new Date(); + + //更新 不修改预约时间 + old.setSpace(reserve.getSpace()); + old.setHoisting(reserve.getHoisting()); + old.setSoild(reserve.getSoild()); + old.setBreaks(reserve.getBreaks()); + old.setHigh(reserve.getHigh()); + old.setElectricity(reserve.getElectricity()); + old.setBlindboard(reserve.getBlindboard()); + old.setFire(reserve.getFire()); + old.setUpdatebyname(user.getRealname()); + old.setUpdatetime(now); + this.updateById(reserve); + } + + /** + * @Description: 分页查询 + * @date 2021/11/16 11:02 + */ + @Override + public IPage selectPage(Page<Reserve> page, Map<String, Object> filter, UserInfo userInfo) { + + LambdaQueryWrapper<Reserve> queryWrapper = new LambdaQueryWrapper<>(); + UserInfo user = userService.getById(userInfo); + if (userInfo.getDepartment() == null) { + throw new BusinessException("用户未有部门"); + } + DepartmentInfo dep = departmentService.getById(userInfo.getDepartment()); + if (dep == null) { + throw new BusinessException("用户部门不存在"); + } + queryWrapper.eq(Reserve::getCreatebydepartment, dep.getDepartment()) + .eq(Reserve::getValidflag, true).orderByDesc(Reserve::getCreatetime); + if (StringUtils.isNotBlank((String) filter.get("starttime"))) + queryWrapper.ge(Reserve::getAppointment, filter.get("starttime")); + if (StringUtils.isNotBlank((String) filter.get("endtime"))) + queryWrapper.le(Reserve::getAppointment, filter.get("endtime")); + return reserveMapper.selectPage(page,queryWrapper); + } + + + /** + * @Description: 统计分页 + * @date 2021/11/16 13:49 + */ + @Override + public PageInfoExtension<Map> statistics(Page<Map> page, Map<String, Object> filter, UserInfo user) { + Map<String, Object> params = new HashMap<>(); + params.put("appointment", filter.get("appointment")); + params.put("department", filter.get("department")); + Page pageInfo = reserveMapper.statistics(page,params); + PageInfoExtension<Map> extension = new PageInfoExtension<>(pageInfo); + Map totalNum = this.statisticsTotal(params); + extension.setExtension(totalNum); + return extension; + } + + + /** + * @Description: 统计分页 尾部 总计行 + * @date 2021/11/16 14:14 + */ + @Override + public Map statisticsTotal(Map<String, Object> params) { + return reserveMapper.selectStatisticsTotal(params); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskAnaUnitServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskAnaUnitServiceImpl.java new file mode 100644 index 0000000..12b0bd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskAnaUnitServiceImpl.java @@ -0,0 +1,241 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.api.R; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.RiskAnaUintExoprtVo; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; +import com.gk.hotwork.Mapper.RiskAnaUintMapper; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.RiskAnaUnitService; +import com.gk.hotwork.Service.RiskEventService; +import com.gk.hotwork.Service.UserService; +import io.netty.util.internal.ObjectUtil; +import lombok.SneakyThrows; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** +* @author celin +* @date 2022/3/16 14:40 +*/ +@Service("riskAnaUnitService") +public class RiskAnaUnitServiceImpl extends ServiceImpl<RiskAnaUintMapper,RiskAnaUnit> implements RiskAnaUnitService { + + @Autowired + private RiskAnaUintMapper riskAnaUintMapper; + @Autowired + private DepartmentService departmentService; + @Autowired + private RiskEventService riskEventService; + @Autowired + private UserService userService; + + /** + * @Description: 分页查询 + * @date 2022/3/16 10:01 + */ + @Override + public IPage<RiskAnaUnit> selectPage(Page<RiskAnaUnit> page, Map<String, Object> filter, UserInfo user) { + return riskAnaUintMapper.selectPages(page,filter,user); + } + + /** + * @Description: 新增记录 + */ + @Override + public void addOne(RiskAnaUnit riskAnaUnitVo,UserInfo userInfo) { + Date date = new Date(); + //判空 + if (riskAnaUnitVo.getHazardDepId() == null) throw new BusinessException("部门id参数为空"); + if (riskAnaUnitVo.getHazardLiablePersonId() == null) throw new BusinessException("负责人id参数为空"); + DepartmentInfo department = departmentService.getById(riskAnaUnitVo.getHazardDepId()); + if (department == null) throw new BusinessException("部门不存在"); + UserInfo hazardLiablePerson = userService.getById(riskAnaUnitVo.getHazardLiablePersonId()); + if(hazardLiablePerson == null) throw new BusinessException("择负责人不存在"); + if(StringUtils.isBlank(riskAnaUnitVo.getRiskUnitName())) throw new BusinessException("请填写安全风险分析单元名称"); + if(StringUtils.isBlank(riskAnaUnitVo.getHazardCode())) throw new BusinessException("请填写危险源编码"); + //编号待定 + riskAnaUnitVo.setCreateTime(date); + riskAnaUnitVo.setUpdateTime(date); + riskAnaUnitVo.setCreateBy(userInfo.getRealname()); + riskAnaUnitVo.setUpdateBy(userInfo.getRealname()); + riskAnaUnitVo.setValidFlag(Boolean.TRUE); + this.save(riskAnaUnitVo); + } + + /** + * @Description: 修改信息 + */ + + @Override + public void modOne(RiskAnaUnit riskAnaUnitVo, UserInfo user) { + if (riskAnaUnitVo.getId() == null) throw new BusinessException("id参数为空"); + int count = this.count(new LambdaQueryWrapper<RiskAnaUnit>().eq(RiskAnaUnit::getId, riskAnaUnitVo.getId())); + if (count < 1) throw new BusinessException("未找到相应实体"); + //判空 + if (riskAnaUnitVo.getHazardDepId() == null) throw new BusinessException("部门id参数为空"); + DepartmentInfo department = departmentService.getById(riskAnaUnitVo.getHazardDepId()); + if (department == null) throw new BusinessException("部门不存在"); + if (riskAnaUnitVo.getHazardLiablePersonId() == null) throw new BusinessException("负责人id参数为空"); + UserInfo hazardLiablePerson = userService.getById(riskAnaUnitVo.getHazardLiablePersonId()); + if(hazardLiablePerson == null) throw new BusinessException("择负责人不存在"); + if(StringUtils.isBlank(riskAnaUnitVo.getRiskUnitName())) throw new BusinessException("请填写安全风险分析单元名称"); + riskAnaUnitVo.setUpdateBy(user.getRealname()); + riskAnaUnitVo.setUpdateTime(new Date()); + this.updateById(riskAnaUnitVo); + } + + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo userInfo) { + if (id == null) throw new BusinessException("id参数为空"); + RiskAnaUnit riskAnaUnit = this.getById(id); + if (riskAnaUnit == null) throw new BusinessException("未找到相应实体"); + int count = riskEventService.count(new LambdaQueryWrapper<RiskEvent>() + .eq(RiskEvent::getRiskUnitId, riskAnaUnit.getId()) + .eq(RiskEvent::getValidFlag, Boolean.TRUE)); + if (count > 0) throw new BusinessException("安全风险分析单元仍然绑定安全风险事件,无法删除"); + RiskAnaUnit delOne = new RiskAnaUnit(); + delOne.setId(id); + delOne.setValidFlag(Boolean.FALSE); + delOne.setUpdateBy(userInfo.getRealname()); + delOne.setUpdateTime(new Date()); + this.updateById(delOne); + } + + @Override + public List<Map> selectDepartmentAnalysis() { + return riskAnaUintMapper.selectDepartmentAnalysis(); + } + + @SneakyThrows + @Override + public List<RiskAnaUintExoprtVo> getInfo(HttpServletRequest request, HttpServletResponse response) { + + List<RiskAnaUnit> riskAnaUnitlist = riskAnaUintMapper.getInfo(); + List<RiskAnaUintExoprtVo> list = new ArrayList<>(); + + for (RiskAnaUnit riskAnaUnit : riskAnaUnitlist) { + RiskAnaUintExoprtVo copy = BeanUtils.copy(riskAnaUnit, RiskAnaUintExoprtVo.class); + list.add(copy); + } + + return list; + + /* //第一步创建一个webbook,对应一个Excel文件 + HSSFWorkbook wb=new HSSFWorkbook(); + //第二步,在webbook中添加一个sheet,对应Excel文件中的sheet + HSSFSheet sheet=wb.createSheet("管控措施"); + //第三步,在sheet中添加表头第0行 + HSSFRow row = sheet.createRow(0); + //第四步,创建单元格,并设置表头居中 + HSSFCellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER);//居中格式 + + HSSFCell cell = row.createCell(0); + cell.setCellValue("安全风险对象编码"); + cell.setCellStyle(style); + + cell=row.createCell((short)1); + cell.setCellValue("安全风险单元名称"); + cell.setCellStyle(style); + + cell=row.createCell((short)2); + cell.setCellValue("责任人"); + cell.setCellStyle(style); + + cell=row.createCell((short)3); + cell.setCellValue("责任部门"); + cell.setCellStyle(style); + + for (int i = 0; i < list.size(); i++) { + //创建单元格,并赋值 + row=sheet.createRow(i+1); + RiskAnaUnit riskAnaUnit = list.get(i); + + row.createCell((short) 0).setCellValue(riskAnaUnit.getHazardCode()); + row.createCell((short)1).setCellValue(riskAnaUnit.getRiskUnitName()); + row.createCell((short)2).setCellValue(riskAnaUnit.getHazardLiablePerson()); + row.createCell((short)3).setCellValue(riskAnaUnit.getHazardDep()); + + } + //第六步,下载Excel + FileOutputStream fileOutputStream = new FileOutputStream(new File("D:\\安全风险分析单元.xls")); + wb.write(fileOutputStream);*/ + + } + + @Override + public RiskAnaUnit getInfoByRiskUnitName(String riskUnitName) { + //riskAnaUintMapper.getInfoByRiskUnitName(riskUnitName); + return riskAnaUintMapper.getInfoByRiskUnitName(riskUnitName); + } + @Transactional + @Override + public void importRiskAnaUnit(List<RiskAnaUintExoprtVo> param, UserInfo user) { + + if (CollectionUtils.isEmpty(param)){ + throw new BusinessException("文件不能为空"); + } + + for (RiskAnaUintExoprtVo riskAnaUintVo : param) { + /**传入字段 + * 风险源编码hazardCode 风险单元名称riskUnitName 责任人hazardLiablePerson 责任部门hazardDep + * 补充字段 + * 创建时间,修改时间,创建人,修改人,有效状态,责任人id,责任部门id + * */ + DepartmentInfo departmentInfo = departmentService.getInfoByName(riskAnaUintVo.getHazardDep()); + if (departmentInfo.getDepartment() == null) throw new BusinessException("部门不存在"); + + UserInfo userInfo = userService.getByRealName(riskAnaUintVo.getHazardLiablePerson(), departmentInfo.getDepartment()); + if (ObjectUtils.isEmpty(userInfo)) throw new BusinessException("负责人不存在"); + + if (riskAnaUintVo.getHazardCode() == null && riskAnaUintVo.getRiskUnitName() == null){ + throw new BusinessException("生产装置编码与风险单元名称不能为空"); + } + RiskAnaUnit riskAnaUnit = new RiskAnaUnit(); + + riskAnaUnit.setHazardCode(riskAnaUintVo.getHazardCode()); + riskAnaUnit.setRiskUnitName(riskAnaUintVo.getRiskUnitName()); + riskAnaUnit.setHazardLiablePerson(riskAnaUintVo.getHazardLiablePerson()); + riskAnaUnit.setHazardDep(riskAnaUintVo.getHazardDep()); + + riskAnaUnit.setHazardDepId(departmentInfo.getId()); + riskAnaUnit.setHazardLiablePersonId(userInfo.getId()); + riskAnaUnit.setCreateTime(new Date()); + riskAnaUnit.setUpdateTime(new Date()); + riskAnaUnit.setCreateBy(user.getRealname()); + riskAnaUnit.setUpdateBy(user.getRealname()); + riskAnaUnit.setValidFlag(Boolean.TRUE); + this.save(riskAnaUnit); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlClassifyServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlClassifyServiceImpl.java new file mode 100644 index 0000000..f0ff93b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlClassifyServiceImpl.java @@ -0,0 +1,176 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.RiskControlClassifyMapper; +import com.gk.hotwork.Service.RiskControlClassifyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** +* @author celin +* @date 2022/3/16 16:42 +*/ + +@Service("riskControlClassify") +public class RiskControlClassifyServiceImpl extends ServiceImpl<RiskControlClassifyMapper,RiskControlClassify> implements RiskControlClassifyService { + + @Autowired + private RiskControlClassifyMapper riskControlClassifyMapper; + + @Override + public IPage<RiskControlClassify> selectPage(Page<RiskControlClassify> page, Map<String, Object> filter, UserInfo user) { + return riskControlClassifyMapper.selectPages(page,filter,user); + } + + @Override + public List<RiskControlClassify> selectAll(UserInfo user) { + + List<RiskControlClassify> allClassify = riskControlClassifyMapper.selectList( + new LambdaQueryWrapper<RiskControlClassify>() + .eq(RiskControlClassify::getValidFlag,Boolean.TRUE)); + List<RiskControlClassify> root = new ArrayList<>(); + List<RiskControlClassify> allChildren = new ArrayList<>(); + + if (allClassify.size() > 0) { + for (RiskControlClassify nav : allClassify) { + if (nav.getParentId() == null) { + root.add(nav); + }else{ + allChildren.add(nav); + } + } + } + + //根部排序 + root.sort(Comparator.comparingInt(RiskControlClassify::getOrderIndex)); + //选用子类 + if (root.size() > 0) { + for (RiskControlClassify nav : root) { + List<RiskControlClassify> subClassify = this.getChildren(nav.getId(), allChildren); + nav.setSubClassify(subClassify); + } + } + + return root; + } + + /** + * @Description: 新增 + */ + @Override + public void addOne(RiskControlClassify riskControlClassifyVo, UserInfo user) { + if (StringUtils.isBlank(riskControlClassifyVo.getName())) throw new BusinessException("分类名称不能为空"); + Date date = new Date(); + String operator = user.getRealname(); + riskControlClassifyVo.setCreateTime(date); + riskControlClassifyVo.setUpdateTime(date); + riskControlClassifyVo.setUpdateBy(operator); + riskControlClassifyVo.setCreateBy(operator); + riskControlClassifyVo.setValidFlag(Boolean.TRUE); + this.save(riskControlClassifyVo); + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(RiskControlClassify riskControlClassifyVo, UserInfo user) { + if (riskControlClassifyVo.getId() == null) throw new BusinessException("id参数不能为空"); + int count = this.count(new LambdaQueryWrapper<RiskControlClassify>().eq(RiskControlClassify::getId, riskControlClassifyVo.getId())); + if (count < 1) throw new BusinessException("找不到相应实体"); + riskControlClassifyVo.setUpdateBy(user.getRealname()); + riskControlClassifyVo.setUpdateTime(new Date()); + this.updateById(riskControlClassifyVo); + + } + + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + if(id == null) throw new BusinessException("id参数不能为空"); + int count = this.count(new LambdaQueryWrapper<RiskControlClassify>().eq(RiskControlClassify::getId, id)); + if (count < 1) throw new BusinessException("找不到相应实体"); + RiskControlClassify delOne = new RiskControlClassify(); + delOne.setId(id); + delOne.setUpdateBy(user.getRealname()); + delOne.setUpdateTime(new Date()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + + private List<RiskControlClassify> getChildren(Long id, List<RiskControlClassify> allChildren) { + List<RiskControlClassify> children = new ArrayList<>(); + if (allChildren.size() > 0) { + for (RiskControlClassify nav : allChildren) { + assert nav.getParentId() != null; + if (id.equals(nav.getParentId())) { + children.add(nav); + } + } + } + //排序 + children.sort(Comparator.comparingInt(RiskControlClassify::getOrderIndex)); + + if (children.size() > 0) { + for (RiskControlClassify nav : children) { + List<RiskControlClassify> subClassify = this.getChildren(nav.getId(), allChildren); + nav.setSubClassify(subClassify); + } + } + + + return children; + + } + + @Override + public RiskControlClassify getByClassify1AndClassify12(String classify1, String classify2) { + return riskControlClassifyMapper.getByClassify1AndClassify12(classify1, classify2); + } + /** + * @Description: 查询 by 1、2分级 + */ + @Override + public RiskControlClassify getByClassify1AndClassify2(String classify1, String classify2) { + return riskControlClassifyMapper.getByClassify1AndClassify2(classify1, classify2); + } + /** + * @Description: 查询 by 名字 + */ + @Override + public RiskControlClassify getByClassify(String classify) { + return riskControlClassifyMapper.getByClassify(classify); + } + + /** + * @Description: 查询 by 名字与parentid + */ + @Override + public RiskControlClassify getByClassify2(Long id, String trim) { + return riskControlClassifyMapper.getByClassify2(id, trim); + } + /** + * @Description: 查询 by id + */ + @Override + public RiskControlClassify getByControlId(Byte classify2) { + return riskControlClassifyMapper.getByControlId(classify2); + } +} + + diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlMeasureServiceImpl.java new file mode 100644 index 0000000..4a4b245 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskControlMeasureServiceImpl.java @@ -0,0 +1,266 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskControlMeasure; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.RiskControlMeasureExportVo; +import com.gk.hotwork.Mapper.RiskControlMeasureMapper; +import com.gk.hotwork.Service.RiskControlMeasureService; +import com.gk.hotwork.Service.RiskEventService; +import org.apache.commons.beanutils.DynaBean; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +/** +* @author celin +*/ +@Service("riskControlMeasure") +public class RiskControlMeasureServiceImpl extends ServiceImpl<RiskControlMeasureMapper, RiskControlMeasure> implements RiskControlMeasureService { + + @Autowired + private RiskControlMeasureMapper riskControlMeasureMapper; + @Autowired + private RiskEventService riskEventService; + + /** + * @Description: 分页 + */ + @Override + public IPage<RiskControlMeasure> selectPage(Page<RiskControlMeasure> page, Map<String, Object> filter, UserInfo user) { + return riskControlMeasureMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(RiskControlMeasure riskControlMeasureVo,UserInfo userInfo) { + if (StringUtils.isBlank(riskControlMeasureVo.getClassify1()) || + StringUtils.isBlank(riskControlMeasureVo.getClassify2()) || + StringUtils.isBlank(riskControlMeasureVo.getDataSrc())) + throw new BusinessException("请填写分类"); + if (riskControlMeasureVo.getRiskEventId() == null) throw new BusinessException("请选择风险事件"); + + int count = riskEventService.count(new LambdaQueryWrapper<RiskEvent>() + .eq(RiskEvent::getId, riskControlMeasureVo.getRiskEventId()) + .eq(RiskEvent::getValidFlag, Boolean.TRUE)); + if (count < 1) throw new BusinessException("风险事件不存在"); + + String username = userInfo.getRealname(); + Date date = new Date(); + riskControlMeasureVo.setCreateBy(username); + riskControlMeasureVo.setUpdateBy(username); + riskControlMeasureVo.setCreateTime(date); + riskControlMeasureVo.setUpdateTime(date); + riskControlMeasureVo.setValidFlag(Boolean.TRUE); + this.save(riskControlMeasureVo); + + } + + /** + * @Description: 修改 + * @date 2022/3/17 14:32 + */ + @Override + public void modOne(RiskControlMeasure riskControlMeasureVo, UserInfo user) { + if (riskControlMeasureVo.getId() == null) throw new BusinessException("id参数传递为空"); + int measureCount = this.count(new LambdaQueryWrapper<RiskControlMeasure>().eq(RiskControlMeasure::getId, riskControlMeasureVo.getId())); + if (measureCount < 1) throw new BusinessException("找不到相应实体"); + if (StringUtils.isBlank(riskControlMeasureVo.getClassify1()) || + StringUtils.isBlank(riskControlMeasureVo.getClassify2()) || + StringUtils.isBlank(riskControlMeasureVo.getDataSrc())) + throw new BusinessException("请填写分类"); + + if (riskControlMeasureVo.getRiskEventId() == null) throw new BusinessException("请选择风险事件"); + int eventCount = riskEventService.count(new LambdaQueryWrapper<RiskEvent>() + .eq(RiskEvent::getId, riskControlMeasureVo.getRiskEventId()) + .eq(RiskEvent::getValidFlag, Boolean.TRUE)); + if (eventCount < 1) throw new BusinessException("风险事件不存在"); + + riskControlMeasureVo.setUpdateTime(new Date()); + riskControlMeasureVo.setUpdateBy(user.getRealname()); + this.updateById(riskControlMeasureVo); + } + + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + if (id == null) throw new BusinessException("id参数传递为空"); + int count = this.count(new LambdaQueryWrapper<RiskControlMeasure>().eq(RiskControlMeasure::getId, id)); + if (count < 1) throw new BusinessException("找不到相应实体"); + RiskControlMeasure delOne = new RiskControlMeasure(); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + delOne.setId(id); + this.updateById(delOne); + } + /** + * @Description: + */ + @Override + public List<RiskControlMeasureExportVo> getRiskControlMeasureList(HttpServletRequest request, HttpServletResponse response) throws IOException { + + List<RiskControlMeasure> riskMeasureList = riskControlMeasureMapper.getRiskControlMeasureList(); + List<RiskControlMeasureExportVo> list = new ArrayList<>(); + for (RiskControlMeasure riskControlMeasure : riskMeasureList) { + RiskControlMeasureExportVo copy = BeanUtils.copy(riskControlMeasure, RiskControlMeasureExportVo.class); + RiskEvent byId = riskEventService.getById(riskControlMeasure.getRiskEventId()); + copy.setRiskEventName(byId.getRiskEventName()); + list.add(copy); + } + return list; +// // RiskControlMeasureExportVo copy = BeanUtils.copy(riskMeasureList, RiskControlMeasureExportVo.class); +// //第一步创建一个webbook,对应一个Excel文件 +// HSSFWorkbook wb=new HSSFWorkbook(); +// //第二步,在webbook中添加一个sheet,对应Excel文件中的sheet +// HSSFSheet sheet=wb.createSheet("管控措施"); +// //第三步,在sheet中添加表头第0行 +// HSSFRow row = sheet.createRow(0); +// //第四步,创建单元格,并设置表头居中 +// HSSFCellStyle style = wb.createCellStyle(); +// style.setAlignment(HorizontalAlignment.CENTER);//居中格式 +// +// HSSFCell cell = row.createCell(0); +// cell.setCellValue("安全风险事件名称"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)1); +// cell.setCellValue("管控方式"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)2); +// cell.setCellValue("管控方式描述"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)3); +// cell.setCellValue("管控措施分类1"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)4); +// cell.setCellValue("管控措施分类2"); +// +// cell.setCellStyle(style); +// cell=row.createCell((short)5); +// cell.setCellValue("管控措施分类3"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)6); +// cell.setCellValue("隐患排查内容"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)7); +// cell.setCellValue("周期"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)8); +// cell.setCellValue("单位"); +// cell.setCellStyle(style); +// +// for (int i = 0; i < list.size(); i++) { +// //创建单元格,并赋值 +// row=sheet.createRow(i+1); +// RiskControlMeasureExportVo riskVo = list.get(i); +// +// row.createCell((short) 0).setCellValue(riskVo.getRiskEventName()); +// row.createCell((short)1).setCellValue(riskVo.getDataSrc()); +// row.createCell((short)2).setCellValue(riskVo.getRiskMeasureDesc()); +// row.createCell((short)3).setCellValue(riskVo.getClassify1()); +// row.createCell((short)4).setCellValue(riskVo.getClassify2()); +// row.createCell((short)5).setCellValue(riskVo.getClassify3()); +// row.createCell((short)6).setCellValue(riskVo.getTroubleshootContent()); +// row.createCell((short)7).setCellValue(riskVo.getTimeEffect()); +// row.createCell((short)8).setCellValue(riskVo.getTimeUnit()); +// } +// //第六步,下载Excel +// FileOutputStream fileOutputStream = new FileOutputStream(new File("D:\\管控措施.xls")); +// wb.write(fileOutputStream); + + + } + @Transactional + @Override + public void importRiskControlMeasure(List<RiskControlMeasureExportVo> param, UserInfo user) { + + if (CollectionUtils.isEmpty(param)){ + throw new BusinessException("文件不能为空"); + } + + for (RiskControlMeasureExportVo riskControlMeasureVo : param) { + /**传入字段 + * 安全风险事件名称(使用id) 管控方式dataSrc 管控方式描述riskMeasureDesc + * 管控措施分类1classify1 管控措施分类2classify2 管控措施分类3classify3 隐患排查内容troubleshootContent + * 补充字段 + * 创建时间,修改时间,创建人,修改人,有效状态 + * */ + RiskEvent riskEventByName = riskEventService.getByRiskEventName(riskControlMeasureVo.getRiskEventName()); + if (ObjectUtils.isEmpty(riskEventByName)){ + throw new BusinessException("风险事件不存在"); + } + + if (riskControlMeasureVo.getDataSrc() == null ){ + throw new BusinessException("请检查是否正确填写管控方式"); + } + + if (riskControlMeasureVo.getRiskMeasureDesc() == null ){ + throw new BusinessException("请检查是否正确填写管控方式描述"); + } + + if (riskControlMeasureVo.getTroubleshootContent() == null ){ + throw new BusinessException("请检查是否正确填写隐患排查内容"); + } + + if (riskControlMeasureVo.getClassify1() == null && riskControlMeasureVo.getClassify2() == null && riskControlMeasureVo.getClassify3() == null){ + throw new BusinessException("请检查是否正确填写管控措施分类"); + } + + RiskControlMeasure riskControlMeasure = new RiskControlMeasure(); + + riskControlMeasure.setRiskEventId(riskEventByName.getId()); + riskControlMeasure.setDataSrc(riskControlMeasure.getDataSrc()); + riskControlMeasure.setRiskMeasureDesc(riskControlMeasureVo.getRiskMeasureDesc()); + riskControlMeasure.setClassify1(riskControlMeasureVo.getClassify1()); + riskControlMeasure.setClassify2(riskControlMeasureVo.getClassify2()); + riskControlMeasure.setClassify3(riskControlMeasureVo.getClassify3()); + riskControlMeasure.setTroubleshootContent(riskControlMeasureVo.getTroubleshootContent()); + riskControlMeasure.setCreateBy(user.getRealname()); + riskControlMeasure.setUpdateBy(user.getRealname()); + riskControlMeasure.setCreateTime(new Date()); + riskControlMeasure.setUpdateTime(new Date()); + + this.save(riskControlMeasure); + } + + } + + @Override + public String getByDataSrc(String trim) { + RiskControlMeasure byDataSrc = riskControlMeasureMapper.getByDataSrc(trim); + + return byDataSrc.getDataSrc(); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskEventServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskEventServiceImpl.java new file mode 100644 index 0000000..55ab798 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskEventServiceImpl.java @@ -0,0 +1,208 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskAnaUnit; +import com.gk.hotwork.Domain.RiskControlMeasure; +import com.gk.hotwork.Domain.RiskEvent; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; +import com.gk.hotwork.Mapper.RiskEventMapper; +import com.gk.hotwork.Service.RiskAnaUnitService; +import com.gk.hotwork.Service.RiskControlMeasureService; +import com.gk.hotwork.Service.RiskEventService; +import lombok.SneakyThrows; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("riskEventService") +public class RiskEventServiceImpl extends ServiceImpl<RiskEventMapper,RiskEvent> implements RiskEventService { + + @Autowired + private RiskEventMapper riskEventMapper; + @Autowired + private RiskControlMeasureService riskControlMeasureService; + @Autowired + private RiskAnaUnitService riskAnaUnitService; + + + /** + * @Description: 分页 + */ + @Override + public IPage<RiskEvent> selectPage(Page<RiskEvent> page, Map<String, Object> filter, UserInfo user) { + return riskEventMapper.selectPages(page,filter); + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(RiskEvent riskEventVo, UserInfo user) { + if(StringUtils.isBlank(riskEventVo.getRiskEventName())) throw new BusinessException("请填写安全风险事件名称"); + if (riskEventVo.getRiskUnitId() == null) throw new BusinessException("请选择安全风险单位"); + int count = riskAnaUnitService.count(new LambdaQueryWrapper<RiskAnaUnit>() + .eq(RiskAnaUnit::getId, riskEventVo.getRiskUnitId()) + .eq(RiskAnaUnit::getValidFlag, Boolean.TRUE)); + if (count < 1 ) throw new BusinessException("安全风险单位不存在"); + + Date date = new Date(); + String username = user.getRealname(); + riskEventVo.setValidFlag(Boolean.TRUE); + riskEventVo.setUpdateBy(username); + riskEventVo.setCreateBy(username); + riskEventVo.setUpdateTime(date); + riskEventVo.setCreateTime(date); + this.save(riskEventVo); + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(RiskEvent riskEventVo, UserInfo user) { + if (riskEventVo.getId() == null) throw new BusinessException("id传参不能为空"); + int eventCount = this.count(new LambdaQueryWrapper<RiskEvent>().eq(RiskEvent::getId, riskEventVo.getId())); + if (eventCount < 1) throw new BusinessException("找不到对应实体"); + if(StringUtils.isBlank(riskEventVo.getRiskEventName())) throw new BusinessException("请填写安全风险事件名称"); + if (riskEventVo.getRiskUnitId() == null) throw new BusinessException("请选择安全风险单位"); + int unitCount = riskAnaUnitService.count(new LambdaQueryWrapper<RiskAnaUnit>() + .eq(RiskAnaUnit::getId, riskEventVo.getRiskUnitId()) + .eq(RiskAnaUnit::getValidFlag, Boolean.TRUE)); + if (unitCount < 1 ) throw new BusinessException("安全风险单位不存在"); + + riskEventVo.setUpdateTime(new Date()); + riskEventVo.setUpdateBy(user.getRealname()); + this.updateById(riskEventVo); + } + + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + if (id == null) throw new BusinessException("id传参不能为空"); + RiskEvent riskEvent = this.getById(id); + if (riskEvent == null) throw new BusinessException("找不到对应实体"); + int count = riskControlMeasureService.count(new LambdaQueryWrapper<RiskControlMeasure>() + .eq(RiskControlMeasure::getRiskEventId, riskEvent.getId()) + .eq(RiskControlMeasure::getValidFlag, Boolean.TRUE)); + if (count > 0) throw new BusinessException("当前风险事件仍然绑定风险管控措施,无法删除"); + RiskEvent delOne = new RiskEvent(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + + /** + * @Description: 导出 + */ + @SneakyThrows + @Override + public List<RiskEventExportVo> getRiskEventList(HttpServletRequest request, HttpServletResponse response) { + + List<RiskEvent> risklist = riskEventMapper.getRiskEventList(); + List<RiskEventExportVo> list = new ArrayList<>(); + + for (RiskEvent riskEvent : risklist) { + RiskAnaUnit byId = riskAnaUnitService.getById(riskEvent.getRiskUnitId()); + RiskEventExportVo copy = BeanUtils.copy(riskEvent, RiskEventExportVo.class); + copy.setRiskUnitName(byId.getRiskUnitName()); + list.add(copy); + } + + return list; + +// //第一步创建一个webbook,对应一个Excel文件 +// HSSFWorkbook wb=new HSSFWorkbook(); +// //第二步,在webbook中添加一个sheet,对应Excel文件中的sheet +// HSSFSheet sheet=wb.createSheet("管控措施"); +// //第三步,在sheet中添加表头第0行 +// HSSFRow row = sheet.createRow(0); +// //第四步,创建单元格,并设置表头居中 +// HSSFCellStyle style = wb.createCellStyle(); +// style.setAlignment(HorizontalAlignment.CENTER);//居中格式 +// +// HSSFCell cell = row.createCell(0); +// cell.setCellValue("安全风险事件名称"); +// cell.setCellStyle(style); +// +// cell=row.createCell((short)1); +// cell.setCellValue("安全风险单元名称"); +// cell.setCellStyle(style); +// +// for (int i = 0; i < list.size(); i++) { +// //创建单元格,并赋值 +// row=sheet.createRow(i+1); +// RiskEvent riskEvent = list.get(i); +// RiskAnaUnit riskAnaUnit = riskAnaUnitService.getById(riskEvent.getRiskUnitId()); +// +// row.createCell((short) 0).setCellValue(riskEvent.getRiskEventName()); +// row.createCell((short)1).setCellValue(riskAnaUnit.getRiskUnitName()); +// +// } +// //第六步,下载Excel +// FileOutputStream fileOutputStream = new FileOutputStream(new File("D:\\风险事件.xls")); +// wb.write(fileOutputStream); + + } + + @Transactional + @Override + public void importRiskEventData(List<RiskEventExportVo> param, UserInfo user) { + if (CollectionUtils.isEmpty(param)){ + throw new BusinessException("文件不能为空"); + } + + for (RiskEventExportVo riskEventExportVo : param) { + //取出风险单元名称,查出对应风险单元信息 + RiskAnaUnit riskUnitInfo = riskAnaUnitService.getInfoByRiskUnitName(riskEventExportVo.getRiskUnitName()); + if (riskEventExportVo.getRiskUnitName() == null || ObjectUtils.isEmpty(riskUnitInfo)) { + throw new BusinessException("请确认文件格式是否正确或风险单元是否存在"); + } + if (riskEventExportVo.getRiskEventName() == null){ + throw new BusinessException("请填写风险事件名称"); + } + + //取出风险事件名称,将数据写入RiskEvent对象 + RiskEvent riskEvent = new RiskEvent(); + + riskEvent.setRiskUnitId(riskUnitInfo.getId()); + riskEvent.setRiskEventName(riskEventExportVo.getRiskEventName()); + riskEvent.setValidFlag(Boolean.TRUE); + riskEvent.setUpdateBy(user.getRealname()); + riskEvent.setCreateBy(user.getRealname()); + riskEvent.setCreateTime(new Date()); + riskEvent.setUpdateTime(new Date()); + + this.save(riskEvent); + } + } + + @Override + public RiskEvent getByRiskEventName(String riskEventName) { + + return riskEventMapper.getByRiskEventName(riskEventName); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskMapServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskMapServiceImpl.java new file mode 100644 index 0000000..939c102 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskMapServiceImpl.java @@ -0,0 +1,86 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.RiskMap; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.RiskMapVO; +import com.gk.hotwork.Mapper.RiskMapRepository; +import com.gk.hotwork.Service.RiskMapService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service("RiskMapService") +public class RiskMapServiceImpl extends ServiceImpl<RiskMapRepository, RiskMap> implements RiskMapService { + + @Autowired + private UserService userService; + + @Override + public List<RiskMapVO> listByStatus(Byte status) { + List<RiskMap> riskMapList = baseMapper.listByStatus(status); + if(riskMapList == null || riskMapList.size() == 0) + return null; + List<RiskMapVO> voList = new ArrayList<>(); + for(RiskMap map : riskMapList){ + RiskMapVO vo = new RiskMapVO(); + BeanUtils.copyProperties(map,vo); + voList.add(vo); + } + return voList; + } + + @Override + public String saveOne(RiskMapVO riskMapVO) { + if(checkRiskMapVO(riskMapVO)){ + //判断已有的图片数量 + List<RiskMap> riskMapList = baseMapper.listByStatus((byte)0); + if(riskMapList != null && riskMapList.size() >= 20){ + return "图片数量超过上限"; + } + RiskMap riskMap = new RiskMap(); + BeanUtils.copyProperties(riskMapVO,riskMap); + if(save(riskMap)){ + return null; + } + } + return "参数错误"; + } + + @Override + public boolean deleteOne(Long id,Long uid) { + RiskMap riskMap = getById(id); + if(riskMap != null && riskMap.getId() > 0){ + if(riskMap.getStatus() == 0){ + riskMap.setStatus((byte)1); + return updateById(riskMap); + } + } + return false; + } + + private boolean checkRiskMapVO(RiskMapVO vo){ + if(vo.getCreateUid() == null || vo.getCreateUid() <= 0) + return false; + if(vo.getImg() == null || vo.getImg().isEmpty()) + return false; + UserInfo userInfo = userService.getById(vo.getCreateUid()); + if(userInfo.getType() != 2) + return false; + vo.setCreateUname(userInfo.getRealname()); + vo.setEditUid(userInfo.getId()); + vo.setEditUname(userInfo.getRealname()); + vo.setCreateTime(new Date()); + vo.setEditTime(vo.getCreateTime()); + vo.setStatus((byte)0); + if(userInfo == null || userInfo.getId() <= 0 || userInfo.getCompanyid() == null || userInfo.getCompanyid() <= 0) + return false; + return true; + + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskSourceServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskSourceServiceImpl.java new file mode 100644 index 0000000..3ed7d19 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RiskSourceServiceImpl.java @@ -0,0 +1,237 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.RiskSource; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.RiskEventExportVo; +import com.gk.hotwork.Domain.Vo.RiskSourceSearchVo; +import com.gk.hotwork.Domain.Vo.RiskSourceVo; +import com.gk.hotwork.Domain.dto.RiskSourceDto; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.dto.RiskSourceUpdateDto; +import com.gk.hotwork.Mapper.RiskSourceMapper; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.RiskSourceService; +import com.gk.hotwork.Service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service("RiskSourceService") +public class RiskSourceServiceImpl extends ServiceImpl<RiskSourceMapper, RiskSource> implements RiskSourceService { + + @Autowired + private RiskSourceMapper riskSourceMapper; + + @Autowired + private UserService userService; + + @Autowired + private DepartmentService departmentService; + + @Override + public IPage<RiskSource> findRiskSourceListByConditions(Page<RiskSource> page, RiskSourceSearchVo searchVo) { + return riskSourceMapper.findRiskSourceListByConditionsAndPage(page,searchVo); + } + + @Override + public RiskSource findById(Long id) { + return riskSourceMapper.selectById(id); + } + + @Override + public boolean updateById(RiskSourceUpdateDto riskSourceUpdateDto) { + if(riskSourceUpdateDto.getId() == null || riskSourceUpdateDto.getId() <= 0){ + return false; + } + boolean updateResult = false; + RiskSource riskSource = riskSourceMapper.selectById(riskSourceUpdateDto.getId()); + if(riskSource!=null && riskSource.getId() >0){ + //校验数据 + String checkResult = checkRiskSourceForUpdate(riskSource,riskSourceUpdateDto); + if(checkResult.equals("Y")){ + riskSource.setEditTime(new Date()); + if(riskSourceMapper.updateById(riskSource) > 0){ + updateResult = true; + } + } + } + return updateResult; + } + + @Override + public boolean insertOne(RiskSourceDto riskSourceDto) { + RiskSource riskSource = new RiskSource(); + BeanUtils.copyProperties(riskSourceDto,riskSource); + riskSource.setStatus((byte)1); + riskSource.setCreateTime(new Date()); + riskSource.setEditTime(riskSource.getCreateTime()); + if(!checkRiskSourceForCreate(riskSource)){ + return false; + } + if(riskSourceMapper.insert(riskSource) > 0){ + return true; + }else { + return false; + } + } + + @Override + public void delOne(Long id, UserInfo user) { + if (id == null) throw new BusinessException("id参数为空"); + if (this.getById(id) == null) throw new BusinessException("找不到风险源"); + RiskSource riskSource = new RiskSource(); + riskSource.setId(id); + riskSource.setStatus((byte)3); + boolean success = this.updateById(riskSource); + if (!success) throw new BusinessException("删除失败,请联系管理员"); + + } + + + + private boolean checkRiskSourceForCreate(RiskSource riskSource){ + //检查用户是否存在 + boolean flag = true; + if(riskSource == null){ + flag = false; + return flag; + } + if(riskSource.getCreateUid() !=null && riskSource.getEditUid() !=null){ + UserInfo u1 = userService.getById(riskSource.getCreateUid()); + UserInfo u2 = userService.getById(riskSource.getEditUid()); + if(u1==null || u1.getId() <=0 || u2 == null || u2.getId() <= 0){ + flag = false; + }else { + riskSource.setEditUname(u2.getRealname()); + } + }else { + flag = false; + } + //检查部门是否存在 + if(riskSource.getDepId() != null){ + DepartmentInfo departmentInfo = departmentService.getById(riskSource.getDepId()); + if(departmentInfo == null || departmentInfo.getId() <= 0){ + flag = false; + }else { + riskSource.setDepName(departmentInfo.getDepartment()); + } + }else { + flag = false; + } + + //检查状态值、类型值是否支持 + if(riskSource.getType() != null && riskSource.getType() != 1 && riskSource.getType() != 2){ + flag = false; + } + if(riskSource.getStatus() != 1 && riskSource.getStatus() != 2 && riskSource.getStatus() != 3){ + flag = false; + } + //检查风险等级是否支持 + if(riskSource.getLevel() != 1 && riskSource.getLevel() != 2 && riskSource.getLevel() != 3 && riskSource.getLevel() != 4){ + flag = false; + } + return flag; + } + + private String checkRiskSourceForUpdate(RiskSource riskSource,RiskSourceUpdateDto updateDto){ + boolean checkResult = true; + boolean editFlag = false; + if(riskSource == null || riskSource.getId() <= 0 || updateDto == null || updateDto.getId() <= 0){ + return "风险源不存在"; + } + //检查部门 + if(updateDto.getDepId() != null && updateDto.getDepId() != riskSource.getDepId()){ + DepartmentInfo departmentInfo = departmentService.getById(riskSource.getDepId()); + if(departmentInfo == null){ + return "部门不存在"; + }else { + riskSource.setDepId(departmentInfo.getId()); + riskSource.setDepName(departmentInfo.getDepartment()); + editFlag = true; + } + } + //检查类型变更 + if(updateDto.getType() != null && updateDto.getType() != riskSource.getType()){ + if(updateDto.getType().byteValue() == 1 || updateDto.getType().byteValue() == 2){ + riskSource.setType(updateDto.getType()); + editFlag = true; + }else { + return "类型不支持"; + } + } + //风险等级 + if(updateDto.getLevel() != null && updateDto.getLevel() != riskSource.getLevel()){ + if(updateDto.getLevel().byteValue() == 1 || updateDto.getLevel().byteValue() == 2 + || updateDto.getLevel().byteValue() == 3 || updateDto.getLevel().byteValue() == 4){ + riskSource.setLevel(updateDto.getLevel()); + editFlag = true; + }else { + return "风险等级不支持"; + } + } + //名称变动 + if(updateDto.getName() != null && !updateDto.getName().equals(riskSource.getName())){ + if(updateDto.getName().length() > 15){ + return "风险名称超过15个字符"; + }else { + riskSource.setName(updateDto.getName()); + editFlag = true; + } + } + //位置变动 + if(updateDto.getLocation() != null && !updateDto.getLocation().equals(riskSource.getLocation())){ + if(updateDto.getLocation().length() > 30){ + return "位置描述超过30个字符"; + }else { + riskSource.setLocation(updateDto.getLocation()); + editFlag = true; + } + } + //风险描述变动 + if(updateDto.getAccidentDesc() != null && !updateDto.getAccidentDesc().equals(riskSource.getAccidentDesc())){ + if(updateDto.getAccidentDesc().length() > 50){ + return "事故秒数超过50个字符"; + }else { + riskSource.setAccidentDesc(updateDto.getAccidentDesc()); + editFlag = true; + } + } + if(editFlag == true){ + UserInfo userInfo = userService.getById(updateDto.getEditUid()); + if(userInfo!=null && userInfo.getId()>0){ + riskSource.setEditUid(userInfo.getId()); + riskSource.setEditUname(userInfo.getRealname()); + return "Y"; + }else { + return "N"; + } + }else { + return "N"; + } + } + + /** 生产装置导出 */ + @Override + public List<RiskSourceVo> getRiskSourceExport(HttpServletRequest request, HttpServletResponse response) { + + List<RiskSource> risklist = riskSourceMapper.getRiskSourceList(); + List<RiskSourceVo> list = new ArrayList<>(); + + for (RiskSource riskSource : risklist) { + RiskSourceVo copy = BeanUtils.copy(riskSource, RiskSourceVo.class); + list.add(copy); + } + return list; + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RolePermissionsServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RolePermissionsServiceImpl.java new file mode 100644 index 0000000..569172d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RolePermissionsServiceImpl.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.RolePermissionsInfo; +import com.gk.hotwork.Domain.Vo.Menu; +import com.gk.hotwork.Mapper.RolePermissionsInfoMapper; +import com.gk.hotwork.Service.RolePermissionsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("RolePermissionsService") +public class RolePermissionsServiceImpl extends ServiceImpl<RolePermissionsInfoMapper, RolePermissionsInfo> implements RolePermissionsService { + @Autowired + RolePermissionsInfoMapper rolePermissionsInfoMapper; + + + @Override + public List<Menu> selectMenuList(String roleId) { + return rolePermissionsInfoMapper.selectMenuList(roleId); + } + + @Override + public void delRolePermissionByRoleId(Long roleid) { + rolePermissionsInfoMapper.delRolePermissionByRoleId(roleid); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/RoleServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RoleServiceImpl.java new file mode 100644 index 0000000..4bb1271 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/RoleServiceImpl.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.Service.ServiceImpl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Config.Oauth2.OauthRole; +import com.gk.hotwork.Domain.RoleInfo; +import com.gk.hotwork.Mapper.RoleInfoMapper; +import com.gk.hotwork.Service.RoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("RoleService") +public class RoleServiceImpl extends ServiceImpl<RoleInfoMapper, RoleInfo> implements RoleService { + + @Autowired + private RoleInfoMapper roleInfoMapper; + + + @Override + public List<RoleInfo> selectRoleByUser(Long id) { + return roleInfoMapper.selectRoleByUser(id); + } + + @Override + public List<RoleInfo> selectList(String name) { + return roleInfoMapper.selectList(name); + } + + @Override + public RoleInfo selectRoleByName(RoleInfo roleInfo){ + roleInfo.setIsdel((byte)0); + QueryWrapper<RoleInfo> queryWrapper = new QueryWrapper<>(roleInfo); + return roleInfoMapper.selectOne(queryWrapper); + } + + @Override + public List<RoleInfo> selectExistRole(Long id, String name) { + return roleInfoMapper.selectExistRole(id,name); + } + + @Override + public List<OauthRole> selectOauthRoleByUser(int i) { + return roleInfoMapper.selectOauthRoleByUser(i); + } + + @Override + public Integer selectCountForRole(String name) { + + return roleInfoMapper.selectRoleCount(name); + } + + /** + * @Description: 考试系统角色分页 + */ + @Override + public List<RoleInfo> selectPageForRole(String name, Integer first, Integer pageSize) { + ; + Map<String, Object> params = new HashMap<>(); + params.put("name", name); + params.put("first", first); + params.put("pageSize", pageSize); + return roleInfoMapper.selectPageForRole(params); + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafeCheckWorkServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafeCheckWorkServiceImpl.java new file mode 100644 index 0000000..57abe92 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafeCheckWorkServiceImpl.java @@ -0,0 +1,23 @@ +//package com.gk.hotwork.Service.ServiceImpl; +// +//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +//import com.gk.hotwork.Domain.SafeCheckWork; +//import com.gk.hotwork.Mapper.safeCheck.SafeCheckWorkMapper; +//import com.gk.hotwork.Service.SafeCheckWorkService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import java.util.List; +// +//@Service("SafeCheckWorkService") +//public class SafeCheckWorkServiceImpl extends ServiceImpl<SafeCheckWorkMapper,SafeCheckWork> implements SafeCheckWorkService { +// +// @Autowired +// private SafeCheckWorkMapper safeCheckWorkMapper; +// +// @Override +// public List<SafeCheckWork> getSafeCheckWorkListByStatus(Byte status) { +// +// return null; +// } +//} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java new file mode 100644 index 0000000..1102a12 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java @@ -0,0 +1,233 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.EmergencyPlanFile; +import com.gk.hotwork.Domain.SafetyInspectionItem; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.SafetyInspectionItemDeduction; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.SafetyInspectionItemDeductionMapper; +import com.gk.hotwork.Mapper.SafetyInspectionItemMapper; +import com.gk.hotwork.Service.SafetyInspectionItemService; +import org.apache.commons.collections4.CollectionUtils; +import org.checkerframework.checker.units.qual.C; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("SafetyInspectionItemService") +@Transactional +public class SafetyInspectionItemImpl extends ServiceImpl<SafetyInspectionItemMapper,SafetyInspectionItem> implements SafetyInspectionItemService { + + @Autowired + private SafetyInspectionItemMapper safetyInspectionItemMapper; + @Autowired + private SafetyInspectionItemDeductionMapper safetyInspectionItemDeductionMapper; + + /** + * @Description: 分页 + */ + @Override + public IPage<SafetyInspectionItem> selectPage(Page<SafetyInspectionItem> page, Map<String, Object> filter, UserInfo user) { + IPage<SafetyInspectionItem> res = safetyInspectionItemMapper.selectPages(page,filter); + if (CollectionUtils.isNotEmpty(res.getRecords())){ + for (int i = 0 ; i < res.getRecords().size(); i++){ + List<SafetyInspectionItemDeduction> fileList = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(res.getRecords().get(i).getId()); + res.getRecords().get(i).setDeductionList(fileList); + } + } + return res; + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(SafetyInspectionItem param, UserInfo user) { + requiredVerification(param); + + Date date = new Date(); + String username = user.getRealname(); + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(username); + param.setCreateBy(username); + param.setUpdateTime(date); + param.setCreateTime(date); + this.save(param); + + if (CollectionUtils.isNotEmpty(param.getDeductionList())){ + for (SafetyInspectionItemDeduction safetyInspectionItemDeduction : param.getDeductionList()){ + safetyInspectionItemDeduction.setValidFlag(Boolean.TRUE); + safetyInspectionItemDeduction.setUpdateBy(username); + safetyInspectionItemDeduction.setCreateBy(username); + safetyInspectionItemDeduction.setUpdateTime(date); + safetyInspectionItemDeduction.setCreateTime(date); + safetyInspectionItemDeduction.setSafetyInspectionItemId(param.getId()); + safetyInspectionItemDeductionMapper.insert(safetyInspectionItemDeduction); + } + } + } + + + /** + * @Description: 修改 + */ + @Override + public void modOne(SafetyInspectionItem param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + //更新主表 + Date date = new Date(); + String username = user.getRealname(); + param.setUpdateTime(date); + param.setUpdateBy(username); + this.updateById(param); + //更新扣分项表 + + List<SafetyInspectionItemDeduction> oldList = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(param.getId()); + List<SafetyInspectionItemDeduction> newList = param.getDeductionList(); + + List<Long> oldIdList = new ArrayList<>(); + List<Long> newIdList = new ArrayList<>(); + + + for (SafetyInspectionItemDeduction oldSafetyInspectionItemDeduction :oldList ){ + oldIdList.add(oldSafetyInspectionItemDeduction.getId()); + } + for (SafetyInspectionItemDeduction newSafetyInspectionItemDeduction :newList ){ + if (newSafetyInspectionItemDeduction.getId()==null){ + //1.添加新增的元素 + newSafetyInspectionItemDeduction.setValidFlag(Boolean.TRUE); + newSafetyInspectionItemDeduction.setUpdateBy(username); + newSafetyInspectionItemDeduction.setCreateBy(username); + newSafetyInspectionItemDeduction.setUpdateTime(date); + newSafetyInspectionItemDeduction.setCreateTime(date); + newSafetyInspectionItemDeduction.setSafetyInspectionItemId(param.getId()); + safetyInspectionItemDeductionMapper.insert(newSafetyInspectionItemDeduction); + }else{ + newIdList.add(newSafetyInspectionItemDeduction.getId()); + //2.修改id一致 的元素 + for (int i =0;i<oldList.size();i++){ + if (oldList.get(i).getId().equals(newSafetyInspectionItemDeduction.getId())){ + newSafetyInspectionItemDeduction.setUpdateBy(username); + newSafetyInspectionItemDeduction.setUpdateTime(date); + safetyInspectionItemDeductionMapper.updateById(newSafetyInspectionItemDeduction); + } + } + } + } + //2.删除不存在的元素 + List<Long> diffList = getDif(oldIdList,newIdList); + if (CollectionUtils.isNotEmpty(diffList)){ + for (Long id : diffList){ + safetyInspectionItemDeductionMapper.deleteById(id,username,date); + } + } + } + + public List<Long> getDif(List<Long> oldIdList , List<Long> newIdList ){ + ArrayList<Long> dif = new ArrayList<>(); + //查找出oldIdList表中不包含newIdList的元素 + for (Long id : oldIdList) { + if (!(newIdList.contains(id))) { + dif.add(id); + } + } + return dif; + } + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); +// deleteVerification(SafetyInspectionItem); + + SafetyInspectionItem delOne = new SafetyInspectionItem(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + @Override + public List<SafetyInspectionItem> infoElementA(Long id, UserInfo user) { + List<SafetyInspectionItem> list = safetyInspectionItemMapper.infoElementA(id); + if (CollectionUtils.isNotEmpty(list)){ + for (SafetyInspectionItem safetyInspectionItem : list){ + List<SafetyInspectionItemDeduction> deductionList = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(safetyInspectionItem.getId()); + if (CollectionUtils.isNotEmpty(deductionList)){ + safetyInspectionItem.setDeductionList(deductionList); + }else{ + safetyInspectionItem.setDeductionList(new ArrayList<>()); + } + } + } + return list; + } + + @Override + public SafetyInspectionItem info(Long id, UserInfo user) { + SafetyInspectionItem safetyInspectionItem = safetyInspectionItemMapper.getById(id); + List<SafetyInspectionItemDeduction> list = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(id); + if (CollectionUtils.isNotEmpty(list)){ + safetyInspectionItem.setDeductionList(list); + }else{ + safetyInspectionItem.setDeductionList(new ArrayList<>()); + } + return safetyInspectionItem; + } + + + /** + * 查询验证 + * 验证对象存在 + */ + public void selectVerification(Long id){ + if (id == null) throw new BusinessException("id传参不能为空"); + SafetyInspectionItem SafetyInspectionItem = this.getById(id); + if (SafetyInspectionItem == null) throw new BusinessException("找不到对应实体"); + } + + /** + * 操作验证 + * 验证必填项 + * + */ + public void requiredVerification(SafetyInspectionItem param){ + if (param.getElementA() == null) throw new BusinessException("请选择A级要素"); + if (param.getElementB() == null) throw new BusinessException("请选择B级要素"); + if(StringUtils.isBlank(param.getStandardizationRequirements())) throw new BusinessException("请填写标准化要求"); + if(StringUtils.isBlank(param.getEnterpriseStandard())) throw new BusinessException("请填写企业达标标准"); + if(StringUtils.isBlank(param.getReviewMethod())) throw new BusinessException("请填写评审方法"); + if (CollectionUtils.isEmpty(param.getDeductionList())){ + throw new BusinessException("请填写扣分项列表"); + } + } + + /** + * 操作验证 + * 删除已被B级要素绑定的A级要素 + * + */ +// public void deleteVerification(SafetyInspectionItem param){ +// if (param.getType()==0){ +// int count = this.count(new LambdaQueryWrapper<SafetyInspectionItem>() +// .eq(SafetyInspectionItem::getParentId, param.getId()) +// .eq(SafetyInspectionItem::getType , 1) +// .eq(SafetyInspectionItem::getValidFlag, Boolean.TRUE)); +// if (count > 0) throw new BusinessException("当前A级要素仍然有已绑定的B级要素,无法删除"); +// } +// } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java new file mode 100644 index 0000000..3a2e9b4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java @@ -0,0 +1,317 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Do.SafetySelfInspectionItemQualifiedCountDO; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.*; +import com.gk.hotwork.Service.SafetySelfInspectionService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service("SafetySelfInspectionService") +@Transactional +public class SafetySelfInspectionImpl extends ServiceImpl<SafetySelfInspectionMapper,SafetySelfInspection> implements SafetySelfInspectionService { + + @Autowired + private SafetySelfInspectionMapper safetySelfInspectionMapper; + @Autowired + private SafetySelfInspectionItemMapper safetySelfInspectionItemMapper; + @Autowired + private SafetySelfInspectionItemDeductionMapper safetySelfInspectionItemDeductionMapper; + @Autowired + private SafetyInspectionItemDeductionMapper safetyInspectionItemDeductionMapper; + /** + * @Description: 分页 + */ + @Override + public IPage<SafetySelfInspection> selectPage(Page<SafetySelfInspection> page, Map<String, Object> filter, UserInfo user) { + Integer type = user.getType(); + if (!type.equals(1) || !type.equals(2)) { + Long companyid = user.getCompanyid(); + filter.put("companyid",companyid); + } + IPage<SafetySelfInspection> res = safetySelfInspectionMapper.selectPages(page, filter); + List<SafetySelfInspection> records = res.getRecords(); + if (CollectionUtils.isNotEmpty(records)){ + DecimalFormat df = new DecimalFormat("0.00%"); + records = records.stream().map((safetySelfInspection) -> { + if (safetySelfInspection.getStatus() == 2) { + Long id = safetySelfInspection.getId(); + SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id); + safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem()); + if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) { + BigDecimal rate = new BigDecimal(countDO.getQualifiedItem()) + .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP); + String qualifiedRate = df.format(rate); + safetySelfInspection.setQualifiedRate(qualifiedRate); + safetySelfInspection.setItemSum(countDO.getItemSum()); + } + } + return safetySelfInspection; + }).collect(Collectors.toList()); + res.setRecords(records); + } + return res; + } + + + /** + * @Description: 新增 + */ + @Override + public void addOne(SafetySelfInspection param, UserInfo user) { + requiredVerification(param); + + Date date = new Date(); + String username = user.getRealname(); + param.setValidFlag(Boolean.TRUE); + param.setUpdateBy(username); + param.setCreateBy(username); + param.setUpdateTime(date); + param.setCreateTime(date); + this.save(param); + + if (CollectionUtils.isNotEmpty(param.getItemList())) { + for (SafetySelfInspectionItem safetySelfInspectionItem : param.getItemList()) { + safetySelfInspectionItem.setValidFlag(Boolean.TRUE); + safetySelfInspectionItem.setUpdateBy(username); + safetySelfInspectionItem.setCreateBy(username); + safetySelfInspectionItem.setUpdateTime(date); + safetySelfInspectionItem.setCreateTime(date); + safetySelfInspectionItem.setSafetySelfInspectionId(param.getId()); + safetySelfInspectionItemMapper.insert(safetySelfInspectionItem); + } + } + } + + /** + * @Description: 修改 + */ + @Override + public void modOne(SafetySelfInspection param, UserInfo user) { + selectVerification(param.getId()); + requiredVerification(param); + //更新主表 + Date date = new Date(); + String username = user.getRealname(); + param.setUpdateTime(date); + param.setUpdateBy(username); + this.updateById(param); + //更新检查项表 + //1.新增新的元素 + //2.删除旧的不存在的元素 + List<SafetySelfInspectionItem> oldFileList = safetySelfInspectionItemMapper.getBySafetySelfInspectionId(param.getId()); + List<SafetySelfInspectionItem> newFileList = param.getItemList(); + + List<Long> oldIdList = new ArrayList<>(); + List<Long> newIdList = new ArrayList<>(); + + for (SafetySelfInspectionItem oldSafetySelfInspectionItem :oldFileList ){ + oldIdList.add(oldSafetySelfInspectionItem.getId()); + } + for (SafetySelfInspectionItem newSafetySelfInspectionItem :newFileList ){ + if (newSafetySelfInspectionItem.getId()==null){ + //1.添加新增的元素 + newSafetySelfInspectionItem.setValidFlag(Boolean.TRUE); + newSafetySelfInspectionItem.setUpdateBy(username); + newSafetySelfInspectionItem.setCreateBy(username); + newSafetySelfInspectionItem.setUpdateTime(date); + newSafetySelfInspectionItem.setCreateTime(date); + newSafetySelfInspectionItem.setSafetySelfInspectionId(param.getId()); + safetySelfInspectionItemMapper.insert(newSafetySelfInspectionItem); + }else{ + newIdList.add(newSafetySelfInspectionItem.getId()); + } + } + //2.删除不存在的元素 + List<Long> diffList = getDif(oldIdList,newIdList); + if (CollectionUtils.isNotEmpty(diffList)){ + for (Long id : diffList){ + safetySelfInspectionItemMapper.deleteById(id,username,date); + } + } + } + + public List<Long> getDif(List<Long> oldIdList , List<Long> newIdList ){ + ArrayList<Long> dif = new ArrayList<>(); + //查找出oldIdList表中不包含newIdList的元素 + for (Long id : oldIdList) { + if (!(newIdList.contains(id))) { + dif.add(id); + } + } + return dif; + } + + /** + * @Description: 删除 + */ + @Override + public void delOne(Long id, UserInfo user) { + selectVerification(id); + + SafetySelfInspection delOne = new SafetySelfInspection(); + delOne.setId(id); + delOne.setUpdateTime(new Date()); + delOne.setUpdateBy(user.getRealname()); + delOne.setValidFlag(Boolean.FALSE); + this.updateById(delOne); + } + + @Override + public SafetySelfInspection infoOne(Long id,String unqualified, UserInfo user) { + SafetySelfInspection safetySelfInspection=selectVerification(id); + //组装检查项 + List<SafetySelfInspectionItem> itemList= safetySelfInspectionItemMapper.getDetailBySafetySelfInspectionId(id,unqualified); + if(CollectionUtils.isNotEmpty(itemList)){ + //组装扣分项 + for (SafetySelfInspectionItem safetySelfInspectionItem : itemList){ + if (safetySelfInspectionItem.getSafetyInspectionItemResult()==null){ + //根据检查项id获取原始扣分项 + List<SafetyInspectionItemDeduction> safetyInspectionItemDeductionList = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(safetySelfInspectionItem.getSafetyInspectionItemId()); + if (CollectionUtils.isNotEmpty(safetyInspectionItemDeductionList)){ + List<SafetySelfInspectionItemDeduction> oldSafetySelfInspectionItemDeductionList=new ArrayList<>(); + for (SafetyInspectionItemDeduction safetyInspectionItemDeduction : safetyInspectionItemDeductionList){ + SafetySelfInspectionItemDeduction safetySelfInspectionItemDeduction = new SafetySelfInspectionItemDeduction(); + safetySelfInspectionItemDeduction.setSafetyInspectionItemDeductionId(safetyInspectionItemDeduction.getId()); + safetySelfInspectionItemDeduction.setName(safetyInspectionItemDeduction.getName()); + safetySelfInspectionItemDeduction.setPoint(0); + oldSafetySelfInspectionItemDeductionList.add(safetySelfInspectionItemDeduction); + } + safetySelfInspectionItem.setSelfDeductionList(oldSafetySelfInspectionItemDeductionList); + }else{ + safetySelfInspectionItem.setSelfDeductionList(new ArrayList<>()); + } + }else if (safetySelfInspectionItem.getSafetyInspectionItemResult().equals(1)){ + //根据自查清单记录的检查项id获取其扣分项 + List<SafetySelfInspectionItemDeduction> selfDeductionList = safetySelfInspectionItemDeductionMapper.getBySafetySelfInspectionItemId(safetySelfInspectionItem.getId()); + if (CollectionUtils.isNotEmpty(selfDeductionList)){ + safetySelfInspectionItem.setSelfDeductionList(selfDeductionList); + } + } + } + safetySelfInspection.setItemList(itemList); + }else{ + safetySelfInspection.setItemList(new ArrayList<>()); + } + return safetySelfInspection; + } + + @Override + public SafetySelfInspectionItem itemInfoOne(Long id, UserInfo user){ + SafetySelfInspectionItem safetySelfInspectionItem = safetySelfInspectionItemMapper.getDetailById(id); + List<SafetySelfInspectionItemDeduction> selfDeductionList = safetySelfInspectionItemDeductionMapper.getBySafetySelfInspectionItemId(safetySelfInspectionItem.getId()); + if (CollectionUtils.isNotEmpty(selfDeductionList)){ + safetySelfInspectionItem.setSelfDeductionList(selfDeductionList); + }else{ + //根据自查清单检查项里的检查项表去找原有的扣分项 + List<SafetyInspectionItemDeduction> safetyInspectionItemDeductionList = safetyInspectionItemDeductionMapper.getBySafetyInspectionItemId(safetySelfInspectionItem.getSafetyInspectionItemId()); + if (CollectionUtils.isNotEmpty(safetyInspectionItemDeductionList)){ + List<SafetySelfInspectionItemDeduction> oldSafetySelfInspectionItemDeductionList=new ArrayList<>(); + for (SafetyInspectionItemDeduction safetyInspectionItemDeduction : safetyInspectionItemDeductionList){ + SafetySelfInspectionItemDeduction safetySelfInspectionItemDeduction = new SafetySelfInspectionItemDeduction(); + safetySelfInspectionItemDeduction.setSafetyInspectionItemDeductionId(safetyInspectionItemDeduction.getId()); + safetySelfInspectionItemDeduction.setName(safetyInspectionItemDeduction.getName()); + safetySelfInspectionItemDeduction.setPoint(0); + oldSafetySelfInspectionItemDeductionList.add(safetySelfInspectionItemDeduction); + } + safetySelfInspectionItem.setSelfDeductionList(oldSafetySelfInspectionItemDeductionList); + }else{ + safetySelfInspectionItem.setSelfDeductionList(new ArrayList<>()); + } + } + return safetySelfInspectionItem; + } + + @Override + public void modItemInfo(SafetySelfInspectionItem param, UserInfo user) { + if (param.getSafetyInspectionItemResult()==0 && StringUtils.isBlank(param.getSafetyInspectionItemResultDesc())){ + throw new BusinessException("否决说明必填!"); + } + Date date = new Date(); + String username = user.getRealname(); + param.setUpdateTime(date); + param.setUpdateBy(username); + safetySelfInspectionItemMapper.updateById(param); + if (param.getSafetyInspectionItemResult()==0 || param.getSafetyInspectionItemResult() == 2){ + //否决 合格--删除扣分记录 + safetySelfInspectionItemDeductionMapper.delBySafetySelfInspectionItemId(param.getId(),username,date); + }else{ + //扣分 + List<SafetySelfInspectionItemDeduction> list = safetySelfInspectionItemDeductionMapper.getBySafetySelfInspectionItemId(param.getId()); + if (CollectionUtils.isEmpty(list)){ + //新增扣分记录 + for (SafetySelfInspectionItemDeduction safetySelfInspectionItemDeduction : param.getSelfDeductionList()){ + safetySelfInspectionItemDeduction.setValidFlag(Boolean.TRUE); + safetySelfInspectionItemDeduction.setUpdateBy(username); + safetySelfInspectionItemDeduction.setCreateBy(username); + safetySelfInspectionItemDeduction.setUpdateTime(date); + safetySelfInspectionItemDeduction.setCreateTime(date); + safetySelfInspectionItemDeduction.setSafetySelfInspectionItemId(param.getId()); + safetySelfInspectionItemDeduction.setSafetyInspectionItemDeductionId(safetySelfInspectionItemDeduction.getSafetyInspectionItemDeductionId()); + safetySelfInspectionItemDeductionMapper.insert(safetySelfInspectionItemDeduction); + } + }else{ + //更新扣分记录 + for (SafetySelfInspectionItemDeduction safetySelfInspectionItemDeduction : param.getSelfDeductionList()){ + safetySelfInspectionItemDeduction.setUpdateBy(username); + safetySelfInspectionItemDeduction.setUpdateTime(date); + safetySelfInspectionItemDeductionMapper.updateById(safetySelfInspectionItemDeduction); + } + } + } + } + + @Override + public void finish(Long id, UserInfo user) { + SafetySelfInspection safetySelfInspection=selectVerification(id); + Date date = new Date(); + String username = user.getRealname(); + safetySelfInspection.setStatus(2); + safetySelfInspection.setUpdateTime(date); + safetySelfInspection.setUpdateBy(username); + safetySelfInspectionMapper.updateById(safetySelfInspection); + } + + + /** + * 查询验证 + * 验证对象存在 + */ + public SafetySelfInspection selectVerification(Long id) { + if (id == null) throw new BusinessException("id传参不能为空"); + SafetySelfInspection SafetySelfInspection = this.getById(id); + if (SafetySelfInspection == null) throw new BusinessException("找不到对应实体"); + return SafetySelfInspection; + } + + /** + * 操作验证 + * 验证必填项 + */ + public void requiredVerification(SafetySelfInspection param) { + if (StringUtils.isBlank(param.getInspectionName())) throw new BusinessException("请填写自查清单名称"); + if (param.getInspectionTime() == null) throw new BusinessException("请选择自查时间"); + if (param.getInspector() == null) throw new BusinessException("请选择自查人员"); + if (CollectionUtils.isEmpty(param.getItemList())) { + throw new BusinessException("请选择检查项"); + } + if (param.getCheckedCompanyId() == null){ + throw new BusinessException("请选择被检查公司"); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SelfCheckServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SelfCheckServiceImpl.java new file mode 100644 index 0000000..ee6d4e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SelfCheckServiceImpl.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.SelfCheckInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.SelfCheckVo; +import com.gk.hotwork.Mapper.SelfCheckInfoMapper; +import com.gk.hotwork.Service.SelfCheckService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("SelfCheckService") +public class SelfCheckServiceImpl extends ServiceImpl<SelfCheckInfoMapper, SelfCheckInfo> implements SelfCheckService { + @Autowired + SelfCheckInfoMapper selfCheckInfoMapper; + + + @Override + public List<SelfCheckVo> selectByType(String type) { + return selfCheckInfoMapper.selectByType(type); + } + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<SelfCheckInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("createddate"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<SelfCheckInfo> list = selfCheckInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public List<SelfCheckInfo> selectByIds(List<Long> idList){ + return selfCheckInfoMapper.selectByIds(idList); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsLogServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsLogServiceImpl.java new file mode 100644 index 0000000..59adefd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsLogServiceImpl.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.SmsLog; +import com.gk.hotwork.Mapper.SmsLogMapper; +import com.gk.hotwork.Service.SmsLogService; +import org.springframework.stereotype.Service; + +@Service("smsLogService") +public class SmsLogServiceImpl extends ServiceImpl<SmsLogMapper, SmsLog> implements SmsLogService { +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsServiceImpl.java new file mode 100644 index 0000000..0c686da --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SmsServiceImpl.java @@ -0,0 +1,139 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.IRedisService; +import com.gk.hotwork.Domain.Enum.RedisServiceEnum; +import com.gk.hotwork.Domain.Enum.SendStatus; +import com.gk.hotwork.Domain.Enum.SmsSource; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.SmsLog; +import com.gk.hotwork.Domain.Utils.HttpUtils; +import com.gk.hotwork.Service.SmsLogService; +import com.gk.hotwork.Service.SmsService; +import com.gk.hotwork.Sms.SmsServiceConfig; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.*; + +@Service("smsService") +public class SmsServiceImpl implements SmsService { + + private static final Logger logger = Logger.getLogger(SmsService.class); + + private final static String limit_60 = "60:"; + private final static String limit_600 = "600:"; + private final static String limit_3600 = "3600:"; + + @Autowired + private IRedisService redisService; + @Autowired + private SmsLogService smsLogService; + @Autowired + private SmsServiceConfig smsServiceConfig; + + /** + * @Description: 发送短信(记录保存,条数限制,发送操作) + * @date 2022/5/18 8:39 + */ + @Override + /** 运营商限制同1个号码同1个签名的内容1分钟内只能接收1条,10分钟3条,1小时内4条,一天20条,否则可能会被运营商屏蔽 **/ + public void send(String phone,String phoneUser,String tplId, Map<String,Object> params) { + //配置开关 + if (!smsServiceConfig.isEnable()) return; + + Date now = new Date(); + SmsLog smsLog = new SmsLog(); + //短信发送保存到数据库 + { + smsLog.setContent(params.toString()); + smsLog.setCreateTime(now); + smsLog.setPhone(phone); + smsLog.setPhoneUser(phoneUser); + smsLog.setSource(SmsSource.WARN.getCode()); + smsLog.setSendStatus(SendStatus.UN_SEND.getStatus()); + smsLogService.save(smsLog); + + } + + Calendar instance = Calendar.getInstance(); + instance.setTime(now); + instance.set(Calendar.HOUR, 23); + instance.set(Calendar.MINUTE, 59); + instance.set(Calendar.SECOND, 59); + + try { + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(now); + String totalKey = RedisServiceEnum.SMS_SERVICE.getService() + format; + Object totalValueObj = redisService.get(totalKey); + if (totalValueObj == null) { + //初始化 0 + redisService.set(totalKey, 0); + //当日23:59:59 过期 + redisService.expireAt(totalKey, instance.getTime()); + } else { + //否则判断总数 + int totalValue = Integer.parseInt(totalValueObj.toString()); + if (totalValue >= smsServiceConfig.getLimit()) + throw new BusinessException("已经超过当日限制" + smsServiceConfig.getLimit() + "条"); + } + + String prefix = RedisServiceEnum.SMS_SERVICE.getService() + phone + ":"; + this.isMaxLimited(prefix + limit_60 + "*", 1, "1分钟限制1条"); + this.isMaxLimited(prefix + limit_600 + "*", 3, "10分钟限制3条"); + this.isMaxLimited(prefix + limit_3600 + "*", 4, "1小时限制4条"); + //发送短信 tplId为模板id + smsServiceConfig.getActiveSupplier().sendSms( phone, tplId, params); + + //并且设置过期时间 + //更新数据状态 + //发送成功更新状态 + smsLog.setSendStatus(SendStatus.SUCCESS.getStatus()); + smsLogService.updateById(smsLog); + Object o = redisService.get(totalKey); + int total = Integer.parseInt(o.toString()); + //邮件个数 ↑1 + redisService.set(totalKey, ++total); + //过期时间点23:59:59 + redisService.expireAt(totalKey, instance.getTime()); + //1分钟的过期时间 + redisService.set(prefix +":60:" + now.getTime(), "#",(long)60); + //10分钟的过期时间 + redisService.set(prefix + ":600:" + now.getTime(), "#",(long)600); + //1小时的过期时间 + redisService.set(prefix + ":3600:" + now.getTime(), "#",(long)3600); + } catch (BusinessException e) { + //日志打印 + smsLog.setSendStatus(SendStatus.FAILURE.getStatus()); + smsLog.setFailureReason(e.getMessage()); + smsLogService.updateById(smsLog); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * @Description: 判断是否超过限制 + * @date 2022/5/18 8:38 + */ + @Override + public boolean isMaxLimited(String match, Integer limit, String errorMsg) { + Set<String> setKey = redisService.scan(match); + List<String> listKey = redisService.getListKey(setKey); + if (listKey.size() >= limit) { + throw new BusinessException(errorMsg); + } + + return true; + } + + + + + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SubTaskServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SubTaskServiceImpl.java new file mode 100644 index 0000000..a99ae6d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SubTaskServiceImpl.java @@ -0,0 +1,119 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.SubTaskInfo; +import com.gk.hotwork.Domain.TaskEnclosure; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Mapper.SubTaskInfoMapper; +import com.gk.hotwork.Service.SubTaskService; +import com.gk.hotwork.Service.TaskEnclosureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/10/11 16:43 + */ +@Service("SubTaskService") +public class SubTaskServiceImpl extends ServiceImpl<SubTaskInfoMapper, SubTaskInfo> implements SubTaskService { + @Autowired + private TaskEnclosureService taskEnclosureService; + @Override + public List<SubTaskInfo> getSubTasksByCode(String code) { + LambdaQueryWrapper<SubTaskInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SubTaskInfo::getTaskcode,code); + List<SubTaskInfo> subTaskInfos = baseMapper.selectList(wrapper); + for (SubTaskInfo subTaskInfo : subTaskInfos){ + if (subTaskInfo.getType().equals("动土作业")){ + List<TaskEnclosure> enclosures = taskEnclosureService.getFileByCodeAndType(code,"动土方案文件"); + enclosures.forEach(item->{ + item.setUrl(item.getFileurl()); + }); + subTaskInfo.setSoilfile(enclosures); + } + if (subTaskInfo.getType().equals("断路作业")){ + List<TaskEnclosure> enclosures = taskEnclosureService.getFileByCodeAndType(code,"断路地段示意图"); + enclosures.forEach(item->{ + item.setUrl(item.getFileurl()); + }); + subTaskInfo.setBreakfile(enclosures); + } + if (subTaskInfo.getType().equals("盲板抽堵作业")){ + List<TaskEnclosure> enclosures = taskEnclosureService.getFileByCodeAndType(code,"盲板位置图"); + enclosures.forEach(item->{ + item.setUrl(item.getFileurl()); + }); + subTaskInfo.setBlindboardlocation(enclosures); + } + } + return subTaskInfos; + } + + @Override + public void removeByCode(String taskCode) { + LambdaQueryWrapper<SubTaskInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SubTaskInfo::getTaskcode,taskCode); + baseMapper.delete(wrapper); + } + + @Override + public void saveSubTasks(List<SubTaskInfo> subTaskInfos, String taskCode, UserInfo userInfo, String option) { + { + if (subTaskInfos == null || subTaskInfos.size() == 0) {throw new BusinessException("请选择涉及的作业信息");} + List<TaskEnclosure> enclosures = new ArrayList<>(); + subTaskInfos.forEach(item-> { + item.setTaskcode(taskCode); + List<TaskEnclosure> breakFiles = item.getBreakfile(); + if (breakFiles != null){ + breakFiles.forEach(item1->{ + item1.setTaskcode(taskCode); + item1.setOriginalname(item1.getName()); + item1.setCreatedat(new Date()); + item1.setCreatedby(userInfo.getRealname()); + item1.setType("断路地段示意图"); + }); + enclosures.addAll(breakFiles); + } + + List<TaskEnclosure> soilFiles = item.getSoilfile(); + if (soilFiles != null){ + soilFiles.forEach(item2->{ + item2.setTaskcode(taskCode); + item2.setOriginalname(item2.getName()); + item2.setCreatedat(new Date()); + item2.setCreatedby(userInfo.getRealname()); + item2.setType("动土方案文件"); + }); + enclosures.addAll(soilFiles); + } + + + List<TaskEnclosure> blindBoardLocations = item.getBlindboardlocation(); + if (blindBoardLocations != null){ + blindBoardLocations.forEach(item3->{ + item3.setTaskcode(taskCode); + item3.setOriginalname(item3.getName()); + item3.setCreatedat(new Date()); + item3.setCreatedby(userInfo.getRealname()); + item3.setType("盲板位置图"); + }); + enclosures.addAll(blindBoardLocations); + } + + }); + if (option.equals("UPDATE")){ + taskEnclosureService.removeSubFile(taskCode); + removeByCode(taskCode); + } + + taskEnclosureService.saveBatch(enclosures); + saveBatch(subTaskInfos); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskAnalysisServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskAnalysisServiceImpl.java new file mode 100644 index 0000000..2b706e5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskAnalysisServiceImpl.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskAnalysis; +import com.gk.hotwork.Mapper.TaskAnalysisMapper; +import com.gk.hotwork.Service.TaskAnalysisService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 11:10 + */ +@Service("TaskAnalysisService") +public class TaskAnalysisServiceImpl extends ServiceImpl<TaskAnalysisMapper, TaskAnalysis> implements TaskAnalysisService { + @Autowired + private TaskAnalysisMapper taskAnalysisMapper; + @Override + public List<TaskAnalysis> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskAnalysis>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskAnalysis::getTaskcode,code); + return baseMapper.selectList(wrapper); + } + + @Override + public void deleteByTaskCode(String code) { + Byte isDeleted = 1; + List<TaskAnalysis> analyses = getListByTaskCode(code); + for (TaskAnalysis analysis : analyses){ + analysis.setFlag(isDeleted); + taskAnalysisMapper.updateById(analysis); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEnclosureServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEnclosureServiceImpl.java new file mode 100644 index 0000000..61f8673 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEnclosureServiceImpl.java @@ -0,0 +1,73 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskEnclosure; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.TaskCheck; +import com.gk.hotwork.Mapper.TaskEnclosureMapper; +import com.gk.hotwork.Service.TaskEnclosureService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service("taskEnclosureService") +public class TaskEnclosureServiceImpl extends ServiceImpl<TaskEnclosureMapper,TaskEnclosure> implements TaskEnclosureService { + @Override + public List<TaskEnclosure> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskEnclosure> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEnclosure::getTaskcode,code); + return baseMapper.selectList(wrapper); + } + + @Override + public void removeByTaskCode(String code) { + LambdaQueryWrapper<TaskEnclosure> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEnclosure::getTaskcode,code); + baseMapper.delete(wrapper); + } + + @Override + public void removeByTaskCodeAndType(String code, String type) { + LambdaQueryWrapper<TaskEnclosure> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEnclosure::getTaskcode,code); + wrapper.eq(TaskEnclosure::getType,type); + baseMapper.delete(wrapper); + } + + @Override + public List<TaskEnclosure> getFileByCodeAndType(String code,String type) { + LambdaQueryWrapper<TaskEnclosure> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEnclosure::getTaskcode,code); + wrapper.eq(TaskEnclosure::getType,type); + return baseMapper.selectList(wrapper); + } + + @Override + public void removeSubFile(String taskCode) { + LambdaQueryWrapper<TaskEnclosure> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEnclosure::getTaskcode,taskCode); + List<String>list = new ArrayList<>(); + list.add("动土方案文件"); + list.add("断路地段示意图"); + list.add("盲板位置图"); + wrapper.in(TaskEnclosure::getType,list); + baseMapper.delete(wrapper); + } + + @Override + public void removeAndSave(TaskCheck taskCheck, UserInfo userInfo) { + if (taskCheck.getResources() != null && taskCheck.getResources().size() != 0){ + removeByTaskCodeAndType(taskCheck.getCode(),"检查整改问题"); + List<TaskEnclosure> resources = taskCheck.getResources(); + resources.forEach(item->{ + item.setTaskcode(taskCheck.getCode()); + item.setCreatedat(new Date()); + item.setCreatedby(userInfo.getRealname()); + }); + this.saveBatch(taskCheck.getResources()); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentBindServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentBindServiceImpl.java new file mode 100644 index 0000000..49eeb2c --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentBindServiceImpl.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskEquipmentBindInfo; +import com.gk.hotwork.Mapper.TaskEquipmentBindInfoMapper; +import com.gk.hotwork.Service.TaskEquipmentBindService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("TaskEquipmentBindService") +public class TaskEquipmentBindServiceImpl extends ServiceImpl<TaskEquipmentBindInfoMapper,TaskEquipmentBindInfo> implements TaskEquipmentBindService { + @Autowired + TaskEquipmentBindInfoMapper taskEquipmentBindInfoMapper; + + + @Override + public void removeByTaskCode(String code, String worker) { + LambdaQueryWrapper<TaskEquipmentBindInfo> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEquipmentBindInfo::getTaskcode,code); + wrapper.eq(TaskEquipmentBindInfo::getUpdateby,worker); + baseMapper.delete(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentServiceImpl.java new file mode 100644 index 0000000..b43748a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskEquipmentServiceImpl.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskEquipment; +import com.gk.hotwork.Mapper.TaskEquipmentMapper; +import com.gk.hotwork.Service.TaskEquipmentService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("taskEquipmentService") +public class TaskEquipmentServiceImpl extends ServiceImpl<TaskEquipmentMapper, TaskEquipment> implements TaskEquipmentService { + + @Override + public List<TaskEquipment> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskEquipment>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEquipment::getTaskcode,code); + return baseMapper.selectList(wrapper); + } + + @Override + public void removeByTaskCode(String code) { + LambdaQueryWrapper<TaskEquipment>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEquipment::getTaskcode,code); + baseMapper.delete(wrapper); + } + + @Override + public void removeByTaskCodeByConstruction(String code) { + LambdaQueryWrapper<TaskEquipment>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskEquipment::getTaskcode,code); + List<String>list = new ArrayList<>(); + list.add("有毒有害防护设备"); + list.add("个人防护设备"); + list.add("安全措施设备及工器具"); + wrapper.in(TaskEquipment::getType,list); + baseMapper.delete(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskGasServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskGasServiceImpl.java new file mode 100644 index 0000000..08fd8b7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskGasServiceImpl.java @@ -0,0 +1,81 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskGasInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.TaskGasInfoMapper; +import com.gk.hotwork.Service.TaskGasService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service("TaskGasService") +public class TaskGasServiceImpl extends ServiceImpl<TaskGasInfoMapper,TaskGasInfo> implements TaskGasService { + @Autowired + TaskGasInfoMapper taskGasInfoMapper; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<TaskGasInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("updatetime"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<TaskGasInfo> list = taskGasInfoMapper.selectDataGrid(page,pageInfo.getCondition()); + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public List<TaskGasInfo> selectLastGas(String taskCode, String worker) { + return taskGasInfoMapper.selectLastGas(taskCode,worker); + } + + @Override + public List<TaskGasInfo> getWarnList(String code, String worker, Date startTime, Date now) { + LambdaQueryWrapper<TaskGasInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskGasInfo::getTaskcode,code); + wrapper.eq(TaskGasInfo::getIswarn,(byte)1); + wrapper.eq(TaskGasInfo::getTaskworker,worker); + wrapper.le(TaskGasInfo::getUpdatetime,now); + wrapper.ge(TaskGasInfo::getUpdatetime,startTime); + return baseMapper.selectList(wrapper); + } + + @Override + public List<TaskGasInfo> getEarlyWarnList(String code, String worker, Date startTime, Date now) { + LambdaQueryWrapper<TaskGasInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskGasInfo::getTaskcode,code); + wrapper.eq(TaskGasInfo::getIsyujing,(byte)1); + wrapper.eq(TaskGasInfo::getTaskworker,worker); + wrapper.le(TaskGasInfo::getUpdatetime,now); + wrapper.ge(TaskGasInfo::getUpdatetime,startTime); + return baseMapper.selectList(wrapper); + } + + @Override + public boolean isEquipmentError(String code, String worker, Date startTime, Date now) { + LambdaQueryWrapper<TaskGasInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskGasInfo::getTaskcode,code); + wrapper.eq(TaskGasInfo::getTaskworker,worker); + wrapper.le(TaskGasInfo::getUpdatetime,now); + wrapper.ge(TaskGasInfo::getUpdatetime,startTime); + List<TaskGasInfo> taskGasInfos = baseMapper.selectList(wrapper); + return taskGasInfos == null || taskGasInfos.size() <= 0; + + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskInvolveDepServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskInvolveDepServiceImpl.java new file mode 100644 index 0000000..68f3d64 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskInvolveDepServiceImpl.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskInvolveDepartment; +import com.gk.hotwork.Mapper.TaskInvolveDepartmentMapper; +import com.gk.hotwork.Service.TaskInvolveDepService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/26 10:27 + */ +@Service("TaskInvolveDepService") +public class TaskInvolveDepServiceImpl extends ServiceImpl<TaskInvolveDepartmentMapper, TaskInvolveDepartment> + implements TaskInvolveDepService { + @Override + public List<TaskInvolveDepartment> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskInvolveDepartment> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskInvolveDepartment::getTaskcode,code) + .orderByDesc(TaskInvolveDepartment::getCreatedat); + return baseMapper.selectList(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLocationServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLocationServiceImpl.java new file mode 100644 index 0000000..168a6c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLocationServiceImpl.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskLocationInfo; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.TaskLocationInfoMapper; +import com.gk.hotwork.Service.TaskLocationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("TaskLocationService") +public class TaskLocationServiceImpl extends ServiceImpl<TaskLocationInfoMapper, TaskLocationInfo> implements TaskLocationService { + @Autowired + TaskLocationInfoMapper taskLocationInfoMapper; + + @Override + public TaskLocationInfo getLocationByTaskAndWorker(String code, String worker) { + LambdaQueryWrapper<TaskLocationInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskLocationInfo::getTaskcode,code); + if (StringUtils.isNotBlank(worker)) + wrapper.eq(TaskLocationInfo::getTaskworker,worker); + wrapper.orderByDesc(TaskLocationInfo::getUpdatetime); + return baseMapper.selectOne(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLogServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLogServiceImpl.java new file mode 100644 index 0000000..62deecc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskLogServiceImpl.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskLog; +import com.gk.hotwork.Mapper.TaskLogMapper; +import com.gk.hotwork.Service.TaskLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author : jingjy + * @date : 2021/8/20 15:06 + */ +@Service("TaskLogService") +public class TaskLogServiceImpl extends ServiceImpl<TaskLogMapper, TaskLog> implements TaskLogService { + @Autowired + TaskLogMapper taskLogMapper; + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskReviewServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskReviewServiceImpl.java new file mode 100644 index 0000000..032c375 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskReviewServiceImpl.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskReview; +import com.gk.hotwork.Mapper.TaskReviewMapper; +import com.gk.hotwork.Service.TaskReviewService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/11/16 9:45 + */ +@Service("TaskReviewService") +public class TaskReviewServiceImpl extends ServiceImpl<TaskReviewMapper, TaskReview> implements TaskReviewService { + @Override + public void saveReview(TaskReview taskReview) { + List<String> list = taskReview.getPictures(); + if (list != null && list.size() >0){ + StringBuilder s = new StringBuilder(); + for (String pic : list){ + s.append(pic).append(","); + } + taskReview.setScenepic(s.toString()); + } + + this.baseMapper.insert(taskReview); + } + + @Override + public List<TaskReview> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskReview> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskReview::getTaskcode,code) + .orderByDesc(TaskReview::getCreatedat); + return baseMapper.selectList(wrapper); + } + + @Override + public void deleteByTaskCode(String taskCode) { + Byte isDeleted = 1; + List<TaskReview> analyses = getListByTaskCode(taskCode); + for (TaskReview analysis : analyses){ + analysis.setFlag(isDeleted); + this.baseMapper.updateById(analysis); + } + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskRiskServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskRiskServiceImpl.java new file mode 100644 index 0000000..e6c1c38 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskRiskServiceImpl.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskRisk; +import com.gk.hotwork.Mapper.TaskRiskMapper; +import com.gk.hotwork.Service.TaskRiskService; +import org.springframework.stereotype.Service; + +@Service("TaskRiskService") +public class TaskRiskServiceImpl extends ServiceImpl<TaskRiskMapper, TaskRisk> implements TaskRiskService { + + + @Override + public TaskRisk getTaskRiskByCode(String code) { + LambdaQueryWrapper<TaskRisk>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskRisk::getTaskcode,code); + return baseMapper.selectOne(wrapper); + } + + @Override + public void removeByCode(String code) { + LambdaQueryWrapper<TaskRisk>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskRisk::getTaskcode,code); + baseMapper.delete(wrapper); + } + + @Override + public void deleteByTaskCode(String code) { + TaskRisk taskRisk = getTaskRiskByCode(code); + if (taskRisk != null){ + taskRisk.setFlag((byte)1); + baseMapper.updateById(taskRisk); + } + + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskSecurityServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskSecurityServiceImpl.java new file mode 100644 index 0000000..c00a54b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskSecurityServiceImpl.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.TaskSecurity; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Mapper.TaskSecurityMapper; +import com.gk.hotwork.Service.TaskSecurityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 14:10 + */ +@Service("TaskSecurityService") +public class TaskSecurityServiceImpl extends ServiceImpl<TaskSecurityMapper, TaskSecurity> implements TaskSecurityService { + @Override + public List<TaskSecurity> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskSecurity> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskSecurity::getTaskcode,code); + return baseMapper.selectList(wrapper); + } + + @Override + public void deleteByTaskCode(String code) { + Byte isDeleted = 1; + List<TaskSecurity> securities = getListByTaskCode(code); + for (TaskSecurity security : securities){ + security.setFlag(isDeleted); + baseMapper.updateById(security); + } + } + + @Override + public void removeByTaskCode(String code) { + LambdaQueryWrapper<TaskSecurity> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskSecurity::getTaskcode,code); + baseMapper.delete(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskServiceImpl.java new file mode 100644 index 0000000..eb2f92b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskServiceImpl.java @@ -0,0 +1,1270 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Enum.TaskType; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.TaskVo; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; +import com.gk.hotwork.Domain.Vo.WorkShowTaskVo; +import com.gk.hotwork.Domain.Vo.specTask.ActiveTaskInfo; +import com.gk.hotwork.Domain.Vo.specTask.ActiveTaskLocationDto; +import com.gk.hotwork.Domain.Vo.specTask.TaskLocation; +import com.gk.hotwork.Mapper.TaskInfoMapper; +import com.gk.hotwork.Mapper.TaskReviewMapper; +import com.gk.hotwork.Service.*; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.xmlbeans.XmlException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author : jingjy + * @date : 2021/8/19 17:08 + */ +@Service("TaskService") +public class TaskServiceImpl extends ServiceImpl<TaskInfoMapper, TaskInfo> implements TaskService { + @Autowired + private TaskInfoMapper taskInfoMapper; + @Autowired + private TaskReviewMapper taskReviewMapper; + @Autowired + private CompanyService companyService; + @Autowired + private TaskLogService taskLogService; + @Autowired + private TaskAnalysisService taskAnalysisService; + @Autowired + private TaskSecurityService taskSecurityService; + @Autowired + private TaskWorkerService taskWorkerService; + @Autowired + private TaskEnclosureService taskEnclosureService; + @Autowired + private TaskEquipmentService taskEquipmentService; + @Autowired + private TaskRiskService taskRiskService; + @Autowired + private UserService userService; + @Autowired + private WordService wordService; + @Autowired + private TaskInvolveDepService taskInvolveDepService; + @Autowired + private InvolveDepService involveDepService; + @Autowired + private DepartmentService departmentService; + @Autowired + private EquipmentService equipmentService; + @Autowired + private WarningService warningService; + @Autowired + private SubTaskService subTaskService; + @Autowired + private TaskLocationService taskLocationService; + @Autowired + private TaskReviewService taskReviewService; + @Value("${workCode}") + private String workCode; + @Value("${taskPath}") + private String taskPath; + @Value("${task}") + private String task; + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.selectTaskDataGrid(pageInfo.getCondition(),page); + pageInfo.setResult(taskInfos); + pageInfo.setTotalCount(page.getTotal()); + } + + + @Override + public void selectStatisticsData(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.selectStatisticsData(pageInfo.getCondition(),page); + pageInfo.setResult(taskInfos); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public List<TaskVo> getWorkShowTaskList(UserInfo user) { + //主表 + List<TaskVo> doingTask = taskInfoMapper.getDoingTask(); + //加上作业类型 + if (doingTask.size() > 0) { + for (TaskVo taskVo : doingTask) { + String taskCode = taskVo.getCode(); + List<SubTaskInfo> subTasks = subTaskService.getSubTasksByCode(taskCode); + taskVo.setSubTaskInfos(subTasks); + } + } + return doingTask; + } + + @Override + public List<TaskVo> getWorkShowPersonList(UserInfo user) { + //主表 + List<TaskVo> doingTask = taskInfoMapper.getDoingTask(); + //加上人员列表 + if (doingTask.size() > 0) { + for (TaskVo taskVo : doingTask) { + String taskCode = taskVo.getCode(); + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskCode); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskVo.getCode(),taskVo.getApproversupervisor()); + taskVo.setTaskWorkers(workers); + taskVo.setSupervisorEquipments(equipmentInfos); + } + } + return doingTask; + } + + @Override + public void selectDataGridTesting(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.selectDataGridTesting(pageInfo.getCondition(),page); + List<TaskVo>taskVos = new ArrayList<>(); + for (TaskInfo taskInfo : taskInfos){ + TaskVo taskVo = BeanUtils.copy(taskInfo,TaskVo.class); + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskInfo.getCode(),taskInfo.getApproversupervisor()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + taskVo.setSupervisorEquipments(equipmentInfos); + List<SubTaskInfo> subTaskInfos = subTaskService.getSubTasksByCode(taskVo.getCode()); + taskVo.setSubTaskInfos(subTaskInfos); + taskVos.add(taskVo); + } + pageInfo.setResult(taskVos); + pageInfo.setTotalCount(page.getTotal()); + } + + /** + * 获取进行中的作业 + * @return + */ + @Override + public List<ActiveTaskLocationDto> selectActiveTaskLocation(Date time,Byte type) { + List<ActiveTaskLocationDto> activeTaskDtoList = null; + if(time == null) + time = new Date(); + List<ActiveTaskInfo> activeTaskList = taskInfoMapper.selectActiveTaskList(time,type); + if(activeTaskList != null && activeTaskList.size() > 0){ + activeTaskDtoList = new ArrayList<>(); + //1、包装作业代码作为查询条件 + List<Long> codeIdList = new ArrayList<>(); + for(ActiveTaskInfo info : activeTaskList){ + //包装位置查询参数 + codeIdList.add(info.getId()); + } + //2、查询全部坐标信息 + List<TaskLocation> taskLocationList = taskReviewMapper.getTaskLocationListByTaskCodes(codeIdList); + //3、数据匹配 + if(taskLocationList!=null && taskLocationList.size()>0){ + for (TaskLocation l:taskLocationList){ + for(ActiveTaskInfo info : activeTaskList){ + if(l.getTaskId() != null && info.getId() != null && info.getId().longValue() == l.getTaskId().longValue()){ + ActiveTaskLocationDto activeTaskLocationDto = new ActiveTaskLocationDto(); + activeTaskLocationDto.setId(info.getId()); + activeTaskLocationDto.setCode(info.getCode()); + activeTaskLocationDto.setLon(l.getLon()); + activeTaskLocationDto.setLat(l.getLat()); + activeTaskDtoList.add(activeTaskLocationDto); + } + } + } + } + //4、获取子作业 + for(ActiveTaskLocationDto activeTaskLocationDto:activeTaskDtoList){ + List<SubTaskInfo> subTaskInfoList = subTaskService.getSubTasksByCode(activeTaskLocationDto.getCode()); + if(subTaskInfoList != null && subTaskInfoList.size() > 0){ + List<String> taskTypeList = new ArrayList<>(); + for(SubTaskInfo subTaskInfo:subTaskInfoList){ + if(subTaskInfo.getType() != null && !subTaskInfo.getType().isEmpty()){ + taskTypeList.add(subTaskInfo.getType()); + } + } + activeTaskLocationDto.setTaskTypeList(taskTypeList); + } + //打包子作业类型数据 + } + } + return activeTaskDtoList; + } + + @Override + @Transactional + public void saveTaskForAnalysis(TaskVo taskVo, UserInfo userInfo) { + Date now = new Date(); + String realName = userInfo.getRealname(); + String taskCode = this.generateCode(userInfo,workCode); + taskVo.setStatus(TaskInfo.TEST_COMMITTED); + taskVo.setCode(taskCode); + taskVo.setCreatedat(now); + taskVo.setCreatedby(realName); + if (StringUtils.isBlank(taskVo.getAnalysisarea()) || StringUtils.isBlank(taskVo.getAnalysismedium())){ + throw new BusinessException("需要气体检测分析时必须填写分析点名称和分析介质"); + } + + { + List<SubTaskInfo> subTaskInfos = taskVo.getSubTaskInfos(); + if (subTaskInfos == null || subTaskInfos.size() == 0) {throw new BusinessException("请选择涉及的作业信息");} + subTaskInfos.forEach(item-> item.setTaskcode(taskVo.getCode())); + subTaskService.saveBatch(subTaskInfos); + } + this.save(taskVo); + TaskLog taskLog = new TaskLog(taskVo.getCode(), "创建任务信息,提交检测中心", realName, new Date(), userInfo.getCompany()); + taskLogService.save(taskLog); + } + + @Override + public void updateTaskByApp(TaskVo taskVo, UserInfo userInfo) { + Date now = new Date(); + TaskInfo taskInfo = BeanUtils.copy(taskVo,TaskInfo.class); + taskSecurityService.removeByTaskCode(taskVo.getCode()); + taskEquipmentService.removeByTaskCode(taskVo.getCode()); + taskRiskService.removeByCode(taskVo.getCode()); + taskEnclosureService.removeByTaskCode(taskVo.getCode()); + List<TaskSecurity> taskSecurities = taskVo.getTaskSecurities(); + + Byte level = taskVo.getLevel(); + List<InvolveDepInfo> depInfos = involveDepService.list(); + List<TaskInvolveDepartment>departments = new ArrayList<>(); + List<TaskInvolveDepartment>departmentsExist = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + if (departmentsExist == null || departmentsExist.size() == 0){ + if (taskVo.getIsholiday().equals((byte)1)){ + level++; + } + if (!level.equals(TaskInfo.LEVEL_SECOND)){ + for (InvolveDepInfo depInfo : depInfos){ + TaskInvolveDepartment department = new TaskInvolveDepartment(); + department.setDepartment(depInfo.getDepartment()); + department.setTaskcode(taskVo.getCode()); + department.setCreatedat(new Date()); + department.setCreatedby(userInfo.getRealname()); + departments.add(department); + } + taskInvolveDepService.saveBatch(departments); + } + } + + DepartmentInfo departmentInfo = departmentService.selectSafetyDepartment(); + if (departmentInfo == null && !level.equals(TaskInfo.LEVEL_SECOND)){ + throw new BusinessException("安全部门信息不能为空"); + } + if (departmentInfo != null && !level.equals(TaskInfo.LEVEL_SECOND) && StringUtils.isBlank(taskInfo.getSecuritydep())){ + taskInfo.setSecuritydep(departmentInfo.getDepartment()); + } + + TaskReview taskReview = taskVo.getTaskReviews().get(0); + taskReview.setCreatedat(new Date()); + taskReview.setCreatedby(userInfo.getRealname()); + taskReviewService.saveReview(taskReview); + + taskSecurities.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + }); + taskSecurityService.saveBatch(taskSecurities); + + List<TaskEnclosure> resources = taskVo.getResources(); + if (resources != null && resources.size() > 0){ + resources.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + }); + taskEnclosureService.saveBatch(resources); + } + + List<TaskEquipment> taskEquipments = taskVo.getTaskEquipments(); + + taskEquipments.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(userInfo.getRealname()); + }); + taskEquipmentService.saveBatch(taskEquipments); + + TaskRisk risk = taskVo.getTaskRisk(); + + risk.setTaskcode(taskVo.getCode()); + risk.setCreatedat(now); + risk.setCreatedby(userInfo.getRealname()); + taskRiskService.save(risk); + + taskInfo.setStatus(TaskInfo.COMMITTED); + taskInfo.setModifiedat(new Date()); + taskInfo.setModifiedby(userInfo.getRealname()); + updateById(taskInfo); + String content = "任务提交"; + TaskLog taskLog = new TaskLog(taskInfo.getCode(),content,userInfo.getRealname(),new Date(),userInfo.getCompany()); + taskLogService.save(taskLog); + } + + @Override + public void updateTaskByAppForAnalysis(TaskVo taskVo, UserInfo userInfo) { + if (StringUtils.isBlank(taskVo.getAnalysisarea()) || StringUtils.isBlank(taskVo.getAnalysismedium())){ + throw new BusinessException("需要气体检测分析时必须填写分析点名称和分析介质"); + } + taskVo.setStatus(TaskInfo.TEST_COMMITTED); + taskVo.setModifiedby(userInfo.getRealname()); + taskVo.setModifiedat(new Date()); + TaskInfo taskInfo = BeanUtils.copy(taskVo,TaskInfo.class); + updateById(taskInfo); + } + + @Override + public String generateCode(UserInfo userInfo, String workCode) { + UserInfo user = userService.getById(userInfo); + CompanyInfo companyInfo = companyService.selectByName(user.getCompany()); + Calendar calendar = Calendar.getInstance(); + Integer year = calendar.get(Calendar.YEAR); + Integer total = taskInfoMapper.getTotalByYear(year); + total++; + String sn; + int maxSn = 999; + if (total > maxSn){ + sn = total.toString(); + }else { + sn = String.format("%03d",total); + } + String code = companyInfo.getCode()+"-"+workCode+"-"+year+"-"+sn; + TaskInfo taskInfo = getTaskByCode(code); + while (taskInfo != null){ + total ++; + if (total > maxSn){ + sn = total.toString(); + }else { + sn = String.format("%03d",total); + } + code = companyInfo.getCode()+"-"+workCode+"-"+year+"-"+sn; + taskInfo = getTaskByCode(code); + } + return code; + } + + + /** + * @Description: 创建任务-app端 注意:app端 新建就等于提交 + * @date 2021/8/23 14:13 + */ + @Override + @Transactional + public void saveTaskByApp(TaskVo taskVo, UserInfo user) { + //时间 + Date now = new Date(); + String realName = user.getRealname(); + //任务 task + { + //任务编号 + String taskCode = this.generateCode(user,workCode); + taskVo.setStatus(TaskInfo.COMMITTED); + taskVo.setCode(taskCode); + taskVo.setCreatedat(now); + taskVo.setCreatedby(realName); + + if (taskVo.getIsanalysis() .equals((byte)1)){ + if (StringUtils.isBlank(taskVo.getAnalysisarea()) || StringUtils.isBlank(taskVo.getAnalysismedium())){ + throw new BusinessException("需要气体检测分析时必须填写分析点名称和分析介质"); + } + } + + //任务为一级特级时,要添加相关部门审核流程 + List<InvolveDepInfo> depInfos = involveDepService.list(); + List<TaskInvolveDepartment>departments = new ArrayList<>(); + Byte level = taskVo.getLevel(); + if (taskVo.getIsholiday().equals((byte)1)){ + level++; + } + if (!level.equals(TaskInfo.LEVEL_SECOND)){ + for (InvolveDepInfo depInfo : depInfos){ + TaskInvolveDepartment department = new TaskInvolveDepartment(); + department.setDepartment(depInfo.getDepartment()); + department.setTaskcode(taskCode); + department.setCreatedat(new Date()); + department.setCreatedby(user.getRealname()); + departments.add(department); + } + taskInvolveDepService.saveBatch(departments); + } + DepartmentInfo departmentInfo = departmentService.selectSafetyDepartment(); + if (departmentInfo == null && !level.equals(TaskInfo.LEVEL_SECOND)){ + throw new BusinessException("安全部门信息不能为空"); + } + if (departmentInfo != null && !level.equals(TaskInfo.LEVEL_SECOND)){ + taskVo.setSecuritydep(departmentInfo.getDepartment()); + } + + this.save(taskVo); + } + //审核信息 + { + if (taskVo.getIsanalysis() .equals((byte)0)){ + if (taskVo.getTaskReviews() == null || taskVo.getTaskReviews().size() < 1 || taskVo.getTaskReviews().get(0) ==null){ + throw new BusinessException("审核信息不能为空"); + } + TaskReview taskReview = taskVo.getTaskReviews().get(0); + taskReview.setTaskId(taskVo.getId()); + taskReview.setTaskcode(taskVo.getCode()); + taskReview.setCreatedat(new Date()); + taskReview.setCreatedby(user.getRealname()); + taskReviewService.saveReview(taskReview); + } + } + //安全措施 + { + List<TaskSecurity> taskSecurities = taskVo.getTaskSecurities(); + if (taskSecurities == null || taskSecurities.size() == 0) + throw new BusinessException("请填写安全措施"); + + taskSecurities.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(realName); + item.setConfirmedby(realName); + }); + taskSecurityService.saveBatch(taskSecurities); + } + + //pdf或图片 + { + List<TaskEnclosure> resources = taskVo.getResources(); + if (resources != null && resources.size() > 0){ + resources.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(realName); + }); + taskEnclosureService.saveBatch(resources); + } + + } + //安全设备 + { + List<TaskEquipment> taskEquipments = taskVo.getTaskEquipments(); + if (taskEquipments == null || taskEquipments.size() == 0) + throw new BusinessException("请选择安全设备"); + taskEquipments.forEach(item->{ + item.setTaskcode(taskVo.getCode()); + item.setCreatedat(now); + item.setCreatedby(realName); + }); + + taskEquipmentService.saveBatch(taskEquipments); + + } + + //安全风险 + { + TaskRisk risk = taskVo.getTaskRisk(); + if (risk == null) throw new BusinessException("请填写安全风险"); + risk.setTaskcode(taskVo.getCode()); + risk.setCreatedat(now); + risk.setCreatedby(realName); + taskRiskService.save(risk); + } + + { + List<SubTaskInfo> subTaskInfos = taskVo.getSubTaskInfos(); + if (subTaskInfos == null || subTaskInfos.size() == 0) {throw new BusinessException("请选择涉及的作业信息");} + subTaskInfos.forEach(item-> item.setTaskcode(taskVo.getCode())); + subTaskService.saveBatch(subTaskInfos); + } + + + TaskLog taskLog = new TaskLog(taskVo.getCode(), "", realName, new Date(), user.getCompany()); + taskLogService.save(taskLog); + } + + @Override + public void selectDataGridByDep(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.selectTaskDataGridByDep(pageInfo.getCondition(),page); + pageInfo.setResult(taskInfos); + pageInfo.setTotalCount(page.getTotal()); + + } + + @Override + public void selectDataGridViewable(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.selectDataGridViewable(pageInfo.getCondition(),page); + List<TaskVo>taskVos = new ArrayList<>(); + for (TaskInfo taskInfo : taskInfos){ + TaskVo taskVo = BeanUtils.copy(taskInfo,TaskVo.class); + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskInfo.getCode(),taskInfo.getApproversupervisor()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + taskVo.setSupervisorEquipments(equipmentInfos); + List<SubTaskInfo> subTaskInfos = subTaskService.getSubTasksByCode(taskVo.getCode()); + taskVo.setSubTaskInfos(subTaskInfos); + taskVos.add(taskVo); + } + pageInfo.setResult(taskVos); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public void getWaitReviewDataGrid(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<TaskInfo> taskInfos = taskInfoMapper.getWaitReviewDataGrid(pageInfo.getCondition(),page); + List<TaskVo>taskVos = new ArrayList<>(); + for (TaskInfo taskInfo : taskInfos){ + TaskVo taskVo = BeanUtils.copy(taskInfo,TaskVo.class); + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + List<SubTaskInfo> subTaskInfos = subTaskService.getSubTasksByCode(taskVo.getCode()); + taskVo.setSubTaskInfos(subTaskInfos); + taskVos.add(taskVo); + } + pageInfo.setResult(taskVos); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public TaskInfo getTaskByCode(String code) { + LambdaQueryWrapper<TaskInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskInfo::getCode,code); + return baseMapper.selectOne(wrapper); + } + + @Override + public List<TaskVo> getPendingTask(String type, String name) { + List<TaskVo> taskVos = taskInfoMapper.getPendingTask(type,name); + for (TaskVo taskVo : taskVos){ + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskVo.getCode(),taskVo.getApproversupervisor()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + taskVo.setSupervisorEquipments(equipmentInfos); + List<SubTaskInfo> subTaskInfos = subTaskService.getSubTasksByCode(taskVo.getCode()); + taskVo.setSubTaskInfos(subTaskInfos); + } + return taskVos; + } + + + /** + * @Description: 生成pdf文件 + * @date 2021/8/26 12:23 + */ + @Override + public List<TaskInfo> selectAllWorkCertUndone() { + LambdaQueryWrapper<TaskInfo> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(TaskInfo::getId, TaskInfo::getCode) + .eq(TaskInfo::getStatus, TaskInfo.APPROVED) + .isNull(TaskInfo::getPath); + return taskInfoMapper.selectList(queryWrapper); + } + + @Override + public List<TaskVo> getDoingTask() { + List<TaskVo> taskVos = taskInfoMapper.getDoingTask(); + for (TaskVo taskVo : taskVos){ + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskVo.getCode(),taskVo.getApproversupervisor()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + taskVo.setSupervisorEquipments(equipmentInfos); + } + return taskVos; + } + + @Override + public List<Map> getWorkToday() { + + + List<Map> data = new ArrayList<>(8); + + //动火 + Map<String, Object> map1 = new HashMap<>(); + map1.put("num", taskInfoMapper.selectCountWorkToday(TaskInfo.DOING)); + map1.put("name", "动火作业"); + data.add(map1); + + //吊装作业 + Map<String, Object> map2 = new HashMap<>(); + map2.put("num", 0); + map2.put("name", "吊装作业"); + data.add(map2); + + //动土作业 + Map<String, Object> map3 = new HashMap<>(); + map3.put("num", 0); + map3.put("name", "动土作业"); + data.add(map3); + + //断路作业 + Map<String, Object> map4 = new HashMap<>(); + map4.put("num", 0); + map4.put("name", "断路作业"); + data.add(map4); + + //高处作业 + Map<String, Object> map5 = new HashMap<>(); + map5.put("num", 0); + map5.put("name", "高处作业"); + data.add(map5); + + //临时用电作业 + Map<String, Object> map6 = new HashMap<>(); + map6.put("num", 0); + map6.put("name", "临时用电作业"); + data.add(map6); + + //盲板抽堵作业 + Map<String, Object> map7 = new HashMap<>(); + map7.put("num", 0); + map7.put("name", "盲板抽堵作业"); + data.add(map7); + Map<String, Object> map = new HashMap<>(); + + + //受限空间作业 + Map<String, Object> map8 = new HashMap<>(); + map8.put("num", 0); + map8.put("name", "受限空间作业"); + data.add(map8); + + return data; + } + + + + @Override + public IPage getWorkTodayDetail(Page<WorkShowTaskVo> page, Map filter) { + Map<String, Object> params = new HashMap<>(); + params.put("flag", TaskInfo.DOING); + List<WorkShowTaskVo> data = taskInfoMapper.selectPageWorkTodayDetail(page,params); + return page.setRecords(data); + } + + @Override + public List<Map> getSpecialCompareInPeriod(String period) { + + Calendar instance = Calendar.getInstance(); + + if ("year".equals(period)) { + instance.clear(Calendar.MONTH); + instance.set(Calendar.DAY_OF_MONTH,1); + instance.set(Calendar.HOUR_OF_DAY,0); + } + if ("month".equals(period)) { + instance.add(Calendar.MONTH, -1); + } + + Date startTime = instance.getTime(); + + List<Map> data = new ArrayList<>(8); + + //动火 + Map<String, Object> map1 = new HashMap<>(); + map1.put("num", taskInfoMapper.selectCountDoneInPeriod(startTime,TaskInfo.APPROVED)); + map1.put("name", "动火作业"); + data.add(map1); + + //吊装作业 + Map<String, Object> map2 = new HashMap<>(); + map2.put("num", 0); + map2.put("name", "吊装作业"); + data.add(map2); + + //动土作业 + Map<String, Object> map3 = new HashMap<>(); + map3.put("num", 0); + map3.put("name", "动土作业"); + data.add(map3); + + //断路作业 + Map<String, Object> map4 = new HashMap<>(); + map4.put("num", 0); + map4.put("name", "断路作业"); + data.add(map4); + + //高处作业 + Map<String, Object> map5 = new HashMap<>(); + map5.put("num", 0); + map5.put("name", "高处作业"); + data.add(map5); + + //临时用电作业 + Map<String, Object> map6 = new HashMap<>(); + map6.put("num", 0); + map6.put("name", "临时用电作业"); + data.add(map6); + + //盲板抽堵作业 + Map<String, Object> map7 = new HashMap<>(); + map7.put("num", 0); + map7.put("name", "盲板抽堵作业"); + data.add(map7); + + //受限空间作业 + Map<String, Object> map8 = new HashMap<>(); + map8.put("num", 0); + map8.put("name", "受限空间作业"); + data.add(map8); + + return data; + } + + @Override + public Map getWorkEverydayInMonth() { + + Calendar calendar = new GregorianCalendar(); + calendar.setTime(new Date()); + //当前日期往前推days天 + calendar.add(Calendar.DATE, -30); + Date startTime = calendar.getTime(); + + int[] index = new int[30]; + for (int i = 0; i < 30; i++) { + index[i] = i + 1; + } + + //所有 + Map<String, Object> map = new HashMap<>(); + map.put("everyday", taskInfoMapper.selectCountWorkEverydayInMonth(index,startTime,TaskInfo.APPROVED)); + + return map; + } + + @Override + public Map getFourTotal() { + + Map<String, Object> map = new HashMap<>(); + + List<Map> workToday = this.getWorkToday(); + //今日作业总数 + Integer sum = workToday.stream().map(item -> (int) item.get("num")).reduce(0, Integer::sum); + map.put("num0", sum); + //今日预警总数 + map.put("num1", warningService.getCount(WarningInfo.EARLY_WARNING)); + //今日报警总数 + map.put("num2", warningService.getCount(WarningInfo.WARNING)); + //今日设备故障总数 + map.put("num3", warningService.getCount(WarningInfo.FAULT)); + + return map; + } + + @Override + public IPage selectTaskInPeriod(Page<TaskInfo> page, Map filter, UserInfo user) { + LambdaQueryWrapper<TaskInfo> queryWrapper = new LambdaQueryWrapper<>(); + //flag = 4 作业中 + queryWrapper.select(TaskInfo::getId,TaskInfo::getCode,TaskInfo::getArea,TaskInfo::getStarttime,TaskInfo::getEndtime,TaskInfo::getDirector) + .eq(TaskInfo::getFlag,4) + .like(TaskInfo::getCode,filter.get("taskcode")) + .orderByDesc(TaskInfo::getCreatedat); + return taskInfoMapper.selectPage(page,queryWrapper); + } + + @Override + public TaskVo getTaskVoByCode(String code) { + TaskInfo taskInfo = getTaskByCode(code); + TaskVo taskVo = BeanUtils.copy(taskInfo,TaskVo.class); + List<TaskWorkerVo> workers = taskWorkerService.getVoByTaskCode(taskVo.getCode()); + List<TaskSecurity>securities = taskSecurityService.getListByTaskCode(taskVo.getCode()); + List<TaskAnalysis>analyses = taskAnalysisService.getListByTaskCode(taskVo.getCode()); + List<TaskEnclosure> enclosures = taskEnclosureService.getListByTaskCode(taskVo.getCode()); + List<TaskEquipment>equipments = taskEquipmentService.getListByTaskCode(taskVo.getCode()); + List<TaskInvolveDepartment> departments = taskInvolveDepService.getListByTaskCode(taskVo.getCode()); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(taskVo.getCode(),taskVo.getApproversupervisor()); + TaskRisk taskRisk = taskRiskService.getTaskRiskByCode(taskVo.getCode()); + List<TaskReview> reviews = taskReviewService.getListByTaskCode(taskVo.getCode()); + taskVo.setTaskReviews(reviews); + taskVo.setTaskWorkers(workers); + taskVo.setTaskSecurities(securities); + taskVo.setTaskAnalyses(analyses); + taskVo.setTaskEquipments(equipments); + taskVo.setTaskRisk(taskRisk); + taskVo.setResources(enclosures); + taskVo.setDepartments(departments); + taskVo.setSupervisorEquipments(equipmentInfos); + + List<SubTaskInfo>subTaskInfos = subTaskService.getSubTasksByCode(code); + taskVo.setSubTaskInfos(subTaskInfos); + return taskVo; + } + + @Override + public String generateAllWorkCert(String code) { + + String fileDocxUrl = taskPath + code + "-apply.doc"; + String fileReturn = task + code + "-apply.doc"; + + TaskVo taskInfo = this.getTaskVoByCode(code); + //1.word文档替换 + try { + ClassPathResource classPathResource = new ClassPathResource("printTemplate/allworkcert.doc"); + InputStream inputStream = classPathResource.getInputStream(); + WordTemplate template = new WordTemplate(); + template.loadTemplate(null, inputStream); + //数据准备 + Map<String, String> simpleData = new HashMap<>(); + Map<String,WordTemplate.Table> tables = new HashMap<>(); + Map<String,WordTemplate.MergeTable> mergeTables = new HashMap<>(); + Map<String,List<String>> tasktypesMergeMap = new HashMap<>(); + Map<String,List<WordTemplate.Attribute>> ownAttr =new HashMap<>(); + Map<String,String> nameMapGraph = new HashMap<>(); + + { + //基础信息 + {simpleData.put("unit", taskInfo.getUnit()); + simpleData.put("applicant", taskInfo.getApplicant()); + simpleData.put("code", taskInfo.getCode()); + simpleData.put("area", taskInfo.getArea()); + simpleData.put("description", taskInfo.getDescription()); + simpleData.put("analysisarea", taskInfo.getAnalysisarea()); + simpleData.put("analysismedium", taskInfo.getAnalysismedium()); + simpleData.put("mode", taskInfo.getMode()); + simpleData.put("director", taskInfo.getDirector()); + simpleData.put("starttime", WordTemplate.formatTime(taskInfo.getStarttime(),WordTemplate.sdf)); + simpleData.put("endtime", WordTemplate.formatTime(taskInfo.getEndtime(), WordTemplate.sdf)); + simpleData.put("othertask", taskInfo.getOthertask()); + simpleData.put("hazard", taskInfo.getHazard()); + simpleData.put("supervisor", taskInfo.getSupervisor()); + simpleData.put("profession", taskInfo.getProfession()); + simpleData.put("partdirector", taskInfo.getPartdirector()); + simpleData.put("approversupervisor", taskInfo.getApproversupervisor()); + simpleData.put("approverprofession", taskInfo.getApproverprofession()); + + simpleData.put("applyunittime", WordTemplate.formatTime(taskInfo.getApplyunittime(),WordTemplate.sdf)); + + simpleData.put("constructionunit", taskInfo.getConstructionunit()); + simpleData.put("constructiontime", WordTemplate.formatTime(taskInfo.getConstructiontime(), WordTemplate.sdf)); + + simpleData.put("securitytime", WordTemplate.formatTime(taskInfo.getSecuritytime(), WordTemplate.sdf)); + + + simpleData.put("enterprisetime", WordTemplate.formatTime(taskInfo.getEnterprisetime(), WordTemplate.sdf));} + //基础信息签名照 + { + List<TaskReview> taskReviews = taskInfo.getTaskReviews(); + String blank = ""; + nameMapGraph.put("applyunitname", blank); + simpleData.put("applyunitopinion", blank); + nameMapGraph.put("constructionname", blank); + simpleData.put("constructionopinion", blank); + nameMapGraph.put("securityname", blank); + simpleData.put("securityopinion",blank); + nameMapGraph.put("enterprisename", blank); + simpleData.put("enterpriseopinion", blank); + taskReviews.forEach(taskReview -> { + String autograph = taskReview.getAutograph(); + String level = taskReview.getLevel(); + String opinion = taskReview.getOpinion(); + if (("申请部门审批").equals(level)) { + nameMapGraph.put("applyunitname", autograph); + simpleData.put("applyunitopinion", opinion); + } + + if (("施工单位补充确认").equals(level)) { + nameMapGraph.put("constructionname", autograph); + simpleData.put("constructionopinion", opinion); + } + + if (("安全部门审批").equals(level)) { + nameMapGraph.put("securityname", autograph); + simpleData.put("securityopinion",opinion); + } + + if (("单位负责人审批").equals(level)) { + nameMapGraph.put("enterprisename", autograph); + simpleData.put("enterpriseopinion", opinion); + } + + + }); + + + + + + //enterprisename 单位负责人审批 + + } + //动火等级判断 + switch (taskInfo.getLevel()) { + case (byte)0: + simpleData.put("level", "二级");break; + case (byte)1: + simpleData.put("level", "一级");break; + case (byte)2: + simpleData.put("level", "特级");break; + default: + simpleData.put("level", null); + } + //安全部门 + simpleData.put("securitydep", taskInfo.getSecuritydep()); + //作业人 + { + List<TaskWorkerVo> taskWorkersList = taskInfo.getTaskWorkers(); + //作业人员 + String workersname = taskWorkersList.stream().map(TaskWorker::getWorker).distinct().collect(Collectors.joining(",")); + simpleData.put("workersname", workersname); + + String[] workerFields = {"worker", "branch", "number"}; + List<String[]> workers= new ArrayList<String[]>(){{ + taskWorkersList.forEach(item->{ + add(new String[]{item.getWorker(), item.getBranch(), item.getNumber()}); + }); + }}; + WordTemplate.Table workerTable = new WordTemplate.Table(workerFields, workers); + tables.put("workerTable", workerTable); + } + //分析介质 + { + List<TaskAnalysis> taskAnalyses = taskInfo.getTaskAnalyses(); + String[] analysisFields = {"mediumname", "mediumvalue", "analysisat","analyst"}; + List<String[]> taskAnalysis = new ArrayList<String[]>(){{ + taskAnalyses.forEach(item-> add(new String[]{item.getMediumname(), item.getMediumvalue(), WordTemplate.formatTime(item.getAnalysisat(),WordTemplate.sdf_dhms), item.getAnalyst()})); + }}; + WordTemplate.Table analysisTable = new WordTemplate.Table(analysisFields, taskAnalysis); + tables.put("mediumTable", analysisTable); + } + //安全措施 + { + List<TaskSecurity> taskSecurityList = taskInfo.getTaskSecurities(); + Map<String, List<TaskSecurity>> parentGroupData = new HashMap<>(); + taskSecurityList.forEach(item->{ + String tasktype = item.getTasktype(); + if (parentGroupData.containsKey(tasktype)) { + parentGroupData.get(tasktype).add(item); + }else{ + parentGroupData.put(tasktype, new ArrayList<>(Collections.singletonList(item))); + } + }); + + + //遍历分组后内容 + + for (Map.Entry<String, List<TaskSecurity>> parent : parentGroupData.entrySet()) { + + Map<String, List<TaskSecurity>> groupByDataMap = new HashMap<>(); + + String[] taskSecurityFields = {"order", "content", "checked", "createby"}; + String[] taskSecurityMergeFields = {"createby"}; + //根据创建人分组 + parent.getValue().forEach(item -> { + String confirmedby = ""; + if(item.getConfirmedby() != null) + confirmedby = item.getConfirmedby(); + if (!groupByDataMap.containsKey(confirmedby)) { + groupByDataMap.put(confirmedby, new ArrayList<>(Collections.singletonList(item))); + } else { + groupByDataMap.get(confirmedby).add(item); + } + }); + + + int lastOrder = 0; //记录上一个合并表格的最大序号 + int mergeTableSeq = 1; //word合并表后缀序号 + for (Map.Entry<String, List<TaskSecurity>> entry : groupByDataMap.entrySet()) { + String confirmedby = entry.getKey(); + List<TaskSecurity> mappingList = entry.getValue(); + List<String[]> taskSecurities = new ArrayList<>(); + for (int i = mappingList.size() - 1; i >= 0; i--) { + TaskSecurity taskSecurity = mappingList.get(i); + taskSecurities.add(new String[]{ + lastOrder + i + 1 + "", + taskSecurity.getContent().replace("_",taskSecurity.getNum()+""), + taskSecurity.getChecked() == (byte) 1 ? "√" : "/", + confirmedby}); + if (i == 0) { + lastOrder = mappingList.size(); + } + + } + WordTemplate.MergeTable mergeTable = new WordTemplate.MergeTable(taskSecurityFields, taskSecurityMergeFields, taskSecurities); + String mergeTableFlag = parent.getKey() + "mergeTable" + mergeTableSeq; + mergeTables.put(mergeTableFlag, mergeTable); + if (tasktypesMergeMap.get(parent.getKey()) == null) { + tasktypesMergeMap.put(parent.getKey(), new ArrayList<>(Collections.singletonList(mergeTableFlag))); + }else{ + tasktypesMergeMap.get(parent.getKey()).add(mergeTableFlag); + } + mergeTableSeq++; + } + } + + + } + //相关部门 + { + //时间降序吗,最新为第一条 + List<TaskInvolveDepartment> departments = taskInfo.getDepartments(); + + if (departments.size() > 0) { + simpleData.put("involvedep",departments.stream().map(TaskInvolveDepartment::getDepartment).collect(Collectors.joining("、"))); + simpleData.put("departmentconent", departments.get(0).getContent()); + simpleData.put("reviewedbys",departments.stream().map(TaskInvolveDepartment::getReviewedby).collect(Collectors.joining("、"))); + simpleData.put("reviewedtime", WordTemplate.formatTime(departments.get(0).getCreatedat(), WordTemplate.sdf)); + }else{ + simpleData.put("involvedep",null); + simpleData.put("departmentconent", null); + simpleData.put("reviewedbys",null); + simpleData.put("reviewedtime",null); + } + + } + //作业类型 + { + List<SubTaskInfo> subTaskInfos = taskInfo.getSubTaskInfos(); + String collectType = subTaskInfos.stream().map(subTaskInfo -> "☑ " + subTaskInfo.getType()).collect(Collectors.joining(" ")); + simpleData.put("type", collectType); + //8个作业 + + List<WordTemplate.Attribute> attrList; + for (SubTaskInfo subTask : subTaskInfos) { + if (TaskType.HOT.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + String level = ""; + switch (subTask.getLevel()){ + case (byte)0: + level = "二级"; + case (byte)1: + level = "一级"; + case (byte)2: + level = "特级"; + } + + + attrList.add(new WordTemplate.Attribute("动火作业级别", level)); + attrList.add(new WordTemplate.Attribute("动火作业方式", subTask.getFiretype() +"")); + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.SPACE.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("受限空间分类", subTask.getSpacecategory() +"")); + attrList.add(new WordTemplate.Attribute("受限空间名称", subTask.getSpacename() +"")); + attrList.add(new WordTemplate.Attribute("受限空间介质名称", subTask.getSpacemedium() +"")); + attrList.add(new WordTemplate.Attribute("是否酸碱腐蚀",subTask.getAcibase())); + + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.HIGH.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("高度作业等级", subTask.getHeightlevel() +"")); + attrList.add(new WordTemplate.Attribute("高处作业作业高度", subTask.getWorkheight() +"")); + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.HOISTING.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("吊装作业等级", subTask.getHoistinglevel() + "")); + attrList.add(new WordTemplate.Attribute("吊装作业重量", subTask.getHoistingweight() + "")); + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.BLIND.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("盲板材质", subTask.getBlindboardmaterial() +"")); + attrList.add(new WordTemplate.Attribute("盲板规格", subTask.getBlindboardspecification()+"")); + attrList.add(new WordTemplate.Attribute("盲板编号", subTask.getBlindboardnumber() + "")); + attrList.add(new WordTemplate.Attribute("生产单位作业指挥", subTask.getCommander() + "")); + attrList.add(new WordTemplate.Attribute("设备管道名称", subTask.getPipename() + "")); + attrList.add(new WordTemplate.Attribute("设备管道介质", subTask.getPipemedium() + "")); + attrList.add(new WordTemplate.Attribute("设备管道温度", subTask.getPipetemperature() + "")); + attrList.add(new WordTemplate.Attribute("设备管道压力", subTask.getPipepressure() + "")); + //位置图没有 + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.BREAK.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("断路原因", subTask.getBreakreason() +"")); + //断路地段示意图无 + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.ELECTRIC.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("电源接入点", subTask.getElectricityarea() +"")); + attrList.add(new WordTemplate.Attribute("工作电压", subTask.getVoltage() +"")); + attrList.add(new WordTemplate.Attribute("功率", subTask.getPower() +"")); + //断路地段示意图无 + ownAttr.put(subTask.getType(), attrList); + } + + if (TaskType.SOILD.msg.equals(subTask.getType())) { + attrList = new ArrayList<>(); + attrList.add(new WordTemplate.Attribute("动土作业深度(单位:m)", subTask.getSoildepth() +"")); + attrList.add(new WordTemplate.Attribute("动土作业面积(单位:㎡)", subTask.getSoilarea() +"")); + //动土文件地址无 + ownAttr.put(subTask.getType(), attrList); + } + + + } + + } + + //安全交底和风险 + { + + TaskRisk taskRisk = taskInfo.getTaskRisk(); + simpleData.put("environment", taskRisk.getEnvironment()); + simpleData.put("preventive", taskRisk.getPreventive()); + simpleData.put("emergency", taskRisk.getEmergency()); + simpleData.put("other", taskRisk.getOther()); + simpleData.put("taskrisk-director", taskRisk.getDirector()); + simpleData.put("taskrisk-taskdirector", taskRisk.getTaskdirector()); + simpleData.put("confirmat", WordTemplate.formatTime(taskRisk.getConfirmat(),WordTemplate.sdf)); + simpleData.put("contents", taskRisk.getContent()); + } + + + + } + wordService.generateAllTaskCert( + new HashMap<String,Map<String,List<String>>>(){{put("tasktype",tasktypesMergeMap);}}, + new HashMap<String,Map<String,List<WordTemplate.Attribute>>>(){{put("typeAndOwnAttr",ownAttr);}}, + tables, + mergeTables, + simpleData, + nameMapGraph, + template); + template.saveFile(fileDocxUrl); + } catch (FileNotFoundException e) { + e.printStackTrace(); + throw new BusinessException("找不到模板文件路径"); + } catch (IOException | XmlException | InvalidFormatException | InterruptedException e) { + e.printStackTrace(); + } + return fileReturn; + } + + + + + + + + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskWorkerServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskWorkerServiceImpl.java new file mode 100644 index 0000000..bf63171 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/TaskWorkerServiceImpl.java @@ -0,0 +1,92 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Utils.BeanUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; +import com.gk.hotwork.Mapper.TaskWorkerMapper; +import com.gk.hotwork.Service.EquipmentService; +import com.gk.hotwork.Service.TaskLocationService; +import com.gk.hotwork.Service.TaskWorkerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 14:15 + */ +@Service("TaskWorkerService") +public class TaskWorkerServiceImpl extends ServiceImpl<TaskWorkerMapper, TaskWorker> implements TaskWorkerService { + @Autowired + private TaskWorkerMapper taskWorkerMapper; + @Autowired + private EquipmentService equipmentService; + @Autowired + private TaskWorkerService taskWorkerService; + @Autowired + private TaskLocationService taskLocationService; + + @Override + public List<TaskWorker> getListByTaskCode(String code) { + LambdaQueryWrapper<TaskWorker> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskWorker::getTaskcode,code); + wrapper.eq(TaskWorker::getFlag,(byte)0); + return baseMapper.selectList(wrapper); + } + + @Override + public void deleteByTaskCode(String code) { + Byte isDeleted = 1; + List<TaskWorker> workers = getListByTaskCode(code); + for (TaskWorker worker : workers){ + worker.setFlag(isDeleted); + baseMapper.updateById(worker); + } + } + + @Override + public List<TaskWorkerVo> getVoByTaskCode(String code) { + LambdaQueryWrapper<TaskWorker> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TaskWorker::getTaskcode,code); + wrapper.eq(TaskWorker::getFlag,(byte)0); + List<TaskWorker> workers = baseMapper.selectList(wrapper); + List<TaskWorkerVo>workerVos = new ArrayList<>(); + for (TaskWorker worker : workers){ + TaskWorkerVo workerVo = BeanUtils.copy(worker,TaskWorkerVo.class); + List<EquipmentInfo>equipmentInfos = equipmentService.selectByTaskAndWorker(code,worker.getWorker()); + workerVo.setEquipments(equipmentInfos); + String photoAddress = ""; + for (EquipmentInfo equipmentInfo: equipmentInfos){ + if (equipmentInfo.getIsphoto().equals((byte)1)){ + photoAddress = equipmentInfo.getPhotoaddress(); + } + } + TaskLocationInfo taskLocationInfo = taskLocationService.getLocationByTaskAndWorker(code,workerVo.getWorker()); + if (taskLocationInfo !=null){ + workerVo.setLongitude(StringUtils.isBlank(taskLocationInfo.getLongitude())?"":taskLocationInfo.getLongitude()); + workerVo.setLatitude(StringUtils.isBlank(taskLocationInfo.getLatitude())?"":taskLocationInfo.getLatitude()); + workerVo.setPhotoAddress(photoAddress); + } + workerVos.add(workerVo); + } + return workerVos; + } + + @Override + public void saveBatch(List<TaskWorkerVo> workers, UserInfo userInfo) { + List<TaskWorker> taskWorkers = new ArrayList<>(); + for (TaskWorkerVo workerVo : workers){ + TaskWorker taskWorker = BeanUtils.copy(workerVo,TaskWorker.class); + taskWorker.setCreatedat(new Date()); + taskWorker.setCreatedby(userInfo.getRealname()); + taskWorkers.add(taskWorker); + } + taskWorkerService.saveBatch(taskWorkers); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserFaceServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserFaceServiceImpl.java new file mode 100644 index 0000000..a22f43a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserFaceServiceImpl.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.UserFace; +import com.gk.hotwork.Mapper.UserFaceMapper; +import com.gk.hotwork.Service.UserFaceService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +@Service("userFaceService") +public class UserFaceServiceImpl extends ServiceImpl<UserFaceMapper, UserFace> implements UserFaceService { + + + @Autowired + private UserFaceMapper userFaceMapper; + + @Override + public void copeWith(Long userId, String code) { + + if (userId == null) + throw new BusinessException("参数错误,用户id为空"); + if (StringUtils.isBlank(code)) + throw new BusinessException("参数错误,用户脸部code为空"); + UserFace userFace = this.selectByUserId(userId); + if (userFace == null) { + UserFace newOne = new UserFace(); + newOne.setCode(code); + newOne.setUserid(userId); + newOne.setUpdatetime(new Date()); + this.save(newOne); + }else{ + userFace.setCode(code); + this.updateOne(userFace); + } + + } + + @Override + public UserFace selectByUserId(Long id) { + LambdaQueryWrapper<UserFace> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(UserFace::getUserid, id); + return userFaceMapper.selectOne(queryWrapper); + } + + @Override + public void updateOne(UserFace userFace) { + LambdaUpdateWrapper<UserFace> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(UserFace::getCode, userFace.getCode()) + .set(UserFace::getUpdatetime, new Date()) + .eq(UserFace::getUserid,userFace.getUserid()); + this.update(updateWrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserRolesServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserRolesServiceImpl.java new file mode 100644 index 0000000..f0bf97b --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserRolesServiceImpl.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.UserRolesInfo; +import com.gk.hotwork.Mapper.UserRolesInfoMapper; +import com.gk.hotwork.Service.UserRolesService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("UserRolesService") +public class UserRolesServiceImpl extends ServiceImpl<UserRolesInfoMapper, UserRolesInfo> implements UserRolesService { + @Autowired + UserRolesInfoMapper userRolesInfoMapper; + + + @Override + public void deleteByUserId(Long userid) { + userRolesInfoMapper.deleteByUserId(userid); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserServiceImpl.java new file mode 100644 index 0000000..5cdcabc --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/UserServiceImpl.java @@ -0,0 +1,441 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.*; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.*; +import com.gk.hotwork.Domain.Vo.AccountUserVo; +import com.gk.hotwork.Domain.Vo.RegisterVo; +import com.gk.hotwork.Domain.Vo.UserVo; +import com.gk.hotwork.Mapper.UserInfoMapper; +import com.gk.hotwork.Service.*; +import org.apache.catalina.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +@Service("UserService") +public class UserServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserService { + + @Autowired + private UserInfoMapper userInfoMapper; + @Autowired + private RoleService roleService; + @Autowired + private UserFaceService userFaceService; + @Autowired + private UserRolesService userRolesService; + @Autowired + private CompanyService companyService; + @Autowired + private DepartmentService departmentService; + + @Value("${locationUrl}") + private String url; + @Value("${locationUsername}") + private String username; + @Value("${locationPassword}") + private String password; + @Value("${slice.size}") + private Integer sliceSize; + + @Override + public void selectUserDataGrid(PageInfo pageInfo) { + Page<UserVo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize()); + List<OrderItem> orderItems = new ArrayList<>(); + OrderItem orderItem = new OrderItem(); + if (StringUtils.isNotBlank(pageInfo.getSort()) && StringUtils.isNotBlank(pageInfo.getOrder())) { + orderItem.setAsc(pageInfo.getOrder().equalsIgnoreCase("ascending")); + orderItem.setColumn(pageInfo.getSort()); + }else { + orderItem.setAsc(false); + orderItem.setColumn("createddate"); + } + orderItems.add(orderItem); + page.setOrders(orderItems); + List<UserVo> list = userInfoMapper.selectUserDataGrid(page,pageInfo.getCondition()); + for (UserVo userVo : list) { + List<RoleInfo> roleInfoList = roleService.selectRoleByUser(userVo.getId()); + userVo.setRoles(roleInfoList); + UserFace userFace = userFaceService.selectByUserId(userVo.getId()); + if (userFace != null) + userVo.setCode(userFace.getCode()); + } + pageInfo.setResult(list); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public UserInfo selectByUser(String username) { + UserInfo userInfo = new UserInfo(); + userInfo.setUsername(username); + userInfo.setStatus((byte)1); + QueryWrapper<UserInfo> wrapper = new QueryWrapper<> (userInfo); + return userInfoMapper.selectOne(wrapper); + } + + @Override + public List<UserInfo> selectUserInfo(Long id, String username) { + return userInfoMapper.selectUserInfo(id,username); + } + + @Override + public boolean checkUserById(String userId) { + if (StringUtils.isBlank(userId)){ + return false; + } + UserInfo userInfo = userInfoMapper.selectById(userId); + return userInfo != null; + } + + @Override + public UserVo selectUserVoByName(String examtype,String username) { + return userInfoMapper.selectUserVoByName(examtype,username); + } + + + @Override + public void deleteById(Long id) { + LambdaUpdateWrapper<UserInfo> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(UserInfo::getStatus, (byte) 0) + .eq(UserInfo::getId, id); + this.update(updateWrapper); + } + + @Override + public void recoverOneById(Long id) { + LambdaUpdateWrapper<UserInfo> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(UserInfo::getStatus, (byte) 1) + .eq(UserInfo::getId, id); + this.update(updateWrapper); + } + + @Override + public UserInfo selectByRealName(Long id,String realname) { + return userInfoMapper.selectByRealName(id,realname); + } + + @Override + public UserInfo getByRealName(String realname, String depName) { + return userInfoMapper.getByRealName(realname, depName); + } + + @Override + public UserInfo selectByIdCard(Long id,String idcard) { + return userInfoMapper.selectByIdCard(id, idcard); + } + + @Override + public List<UserInfo> selectNotUpload() { + return userInfoMapper.selectNotUpload(); + } + + @Override + public List<UserVo> selectAll(HashMap<String, Object> condition) { + return userInfoMapper.selectAll(condition); + } + + @Override + public List<UserInfo> selectByCompany(String company) { + LambdaQueryWrapper<UserInfo>wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserInfo::getCompany,company); + return baseMapper.selectList(wrapper); + } + + @Override + public Msg saveEmployee(String realname, String empNo, String deviceNo) throws Exception { + Map<String,String> params = new HashMap<>(); + params.put("username", username); + params.put("password", password); + params.put("empName", realname); + params.put("empNo", empNo); + params.put("deviceNo", deviceNo); + String path = url + "/open/information/saveEmployee.do"; + return LocationUtils.net(params,path); + } + + @Override + public Msg setCardValid(String isValid, String cardId) throws Exception { + Map<String,String> params = new HashMap<>(); + params.put("username", username); + params.put("password", password); + params.put("id", cardId); + params.put("isvalid", isValid); + String path = url + "/open/information/updEmployeeState.do"; + return LocationUtils.net(params,path); + } + + @Override + public Msg delEmployee(String cardId) throws Exception { + Map<String,String> params = new HashMap<>(); + params.put("username", username); + params.put("password", password); + params.put("id", cardId); + String path = url + "/open/information/delEmployee.do"; + return LocationUtils.net(params,path); + } + + @Override + public Msg getRealGps() throws Exception { + Map<String,String> params = new HashMap<>(); + params.put("username", username); + params.put("password", password); + String path = url + "/open/information/getRealGps.do"; + return LocationUtils.net(params,path); + } + + @Override + public UserInfo selectUserByCard(String deviceNo, String empNo, String name) { + UserInfo userInfo = new UserInfo(); + userInfo.setDeviceNo(deviceNo); + userInfo.setEmpNo(empNo); + userInfo.setRealname(name); + userInfo.setStatus((byte)1); + QueryWrapper<UserInfo> wrapper = new QueryWrapper<> (userInfo); + return userInfoMapper.selectOne(wrapper); + } + + @Override + public List<UserInfo> getGps(String username) { + LambdaQueryWrapper<UserInfo>wrapper = new LambdaQueryWrapper<>(); + UserInfo userInfo = new UserInfo(); + userInfo.setStatus((byte)1); + wrapper.ne(UserInfo::getDeviceNo, ""); + wrapper.eq(UserInfo::getStatus,(byte)1); + if (StringUtils.isNotBlank(username)){ + wrapper.eq(UserInfo::getRealname,username); + } + return userInfoMapper.selectList(wrapper); + + } + + /** + * @Description: 所有用户大小 + * @date 2021/12/27 10:48 + */ + @Override + public int selectUserSize() { + return userInfoMapper.selectCount( + new LambdaQueryWrapper<>() + ); + } + + @Override + public UserInfo getByDeviceNo(String uid) { + if (StringUtils.isBlank(uid)) throw new BusinessException("接收设备uid为空"); + return userInfoMapper.selectOne( + new LambdaQueryWrapper<UserInfo>() + .eq(UserInfo::getDeviceNo,uid) + .eq(UserInfo::getStatus,1)); + } + + @Override + public IPage<UserVo> selectUserPageInDepartment(Page<UserVo> page, Map<String, Object> filter, UserInfo user) { + List<UserVo> userVos = userInfoMapper.selectUserDataGrid(page, filter); + page.setRecords(userVos); + return page; + } + + @Override + public List<UserVo> getUserList() { + return userInfoMapper.getUserList(); + } + + @Override + public UserInfo examForegroundLogin(String username, String password) { + if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) { + throw new BusinessException("账号密码不能为空"); + } + if (username.length() != 11) throw new BusinessException("请输入11位手机号"); + UserInfo userInfo = this.selectByUser(username); + if (userInfo == null) throw new BusinessException("账号不存在"); + if (!MD5Utils.encode(password).equals(userInfo.getPassword())) throw new BusinessException("密码不正确"); + if (userInfo.getDepartment() != null) { + DepartmentInfo de = departmentService.getById(userInfo.getDepartment()); + if (de != null) { + userInfo.setDepartmentname(de.getDepartment()); + } + } + userInfo.setPassword(null); + return userInfo; + } + + @Override + public Integer selectCountForExam(String name, String idno, String tel, String department,String company) { + Map<Object, Object> params = new HashMap<>(); + params.put("name", name); + params.put("idno", idno); + params.put("tel", tel); + params.put("department", department); + params.put("company", company); + return userInfoMapper.selectCountForExam(params); + } + + @Override + public List<UserInfo> selectPageForExam(String name, String idno, String tel, String department, String company, Integer first, Integer pageSize) { + Map<Object, Object> params = new HashMap<>(); + params.put("name", name); + params.put("idno", idno); + params.put("tel", tel); + params.put("department", department); + params.put("company", company); + params.put("first", first); + params.put("pageSize", pageSize); + return userInfoMapper.selectPageForExam(params); + } + + @Override + @Transactional + public void register(RegisterVo registerVo) { + if (StringUtils.isBlank(registerVo.getRealname())) throw new BusinessException("用户姓名不能为空"); + if (StringUtils.isBlank(registerVo.getUsername()) ||registerVo.getUsername().length() != 11) throw new BusinessException("手机号不为11"); + if (StringUtils.isBlank(registerVo.getPassword())) throw new BusinessException("密码不能为空"); + if (StringUtils.isBlank(registerVo.getCompany())) throw new BusinessException("单位不能为空"); + if (registerVo.getCompanyid() == null) throw new BusinessException("单位参数不能为空"); + CompanyInfo company = companyService.getById(registerVo.getCompanyid()); + if (company == null) throw new BusinessException("单位不存在"); + + if (StringUtils.isBlank(registerVo.getIdcard())|| !IdCardUtil.strongVerifyIdNumber(registerVo.getIdcard())) + throw new BusinessException("身份证非法规则"); + + if (this.phoneIsOccupied(registerVo.getRealname())) + throw new BusinessException("手机号已经被占用"); + if (this.idCardIsOccupied(registerVo.getIdcard())) + throw new BusinessException("身份证已经被占用"); + + int count = userInfoMapper.selectCount(new LambdaQueryWrapper<>()); + int slice = (count + 1) % sliceSize; + UserInfo userInfo = new UserInfo(); + userInfo.setRealname(registerVo.getRealname()); + userInfo.setPassword(MD5Utils.encode(registerVo.getPassword())); + userInfo.setUsername(registerVo.getUsername()); + userInfo.setIdcard(registerVo.getIdcard()); + userInfo.setJob(registerVo.getJob()); + userInfo.setIsdel((byte) 0); + userInfo.setStatus(((byte) 1)); + userInfo.setCreatedby(userInfo.getRealname()); + userInfo.setCompany(company.getCompany()); + userInfo.setCompanyid(company.getId()); + userInfo.setDepartment(registerVo.getDepartment()); + userInfo.setCreateddate(new Date()); + userInfo.setType(3); + userInfo.setSlice(slice == 0 ? sliceSize + "" : slice + ""); + this.save(userInfo); + //默认普通员工角色 + UserRolesInfo ur = new UserRolesInfo(); + ur.setUserid(userInfo.getId()); + RoleInfo role = roleService.getOne(new LambdaQueryWrapper<RoleInfo>().eq(RoleInfo::getName, "员工")); + if (role == null) throw new BusinessException("请查询角色是否存在员工"); + ur.setRoleid(role.getId()); + userRolesService.save(ur); + + } + + @Override + public void pwdChange(String username, String password, String phone) { + if (StringUtils.isBlank(username)) throw new BusinessException("用户姓名不能为空"); + if (StringUtils.isBlank(password)) throw new BusinessException("密码不能为空"); + if (StringUtils.isBlank(phone)) throw new BusinessException("手机号不能为空"); + if (phone.length() != 11) throw new BusinessException("手机号不为11位"); + UserInfo userInfo = this.selectByUser(phone); + if (userInfo == null) throw new BusinessException("用户不存在"); + if (username.equals(userInfo.getRealname())) { + userInfo.setLastmodifiedby(username); + userInfo.setLastmodifieddate(new Date()); + userInfo.setPassword(MD5Utils.encode(password)); + this.updateById(userInfo); + }else{ + throw new BusinessException("用户信息不匹配"); + } + + } + + @Override + public AccountUserVo getAccount(String username, String department) { + if (StringUtils.isBlank(username)) throw new BusinessException("用户姓名不能为空"); + AccountUserVo accountUserVo = userInfoMapper.getAccountByUsername(username); + if (accountUserVo == null){ + if (StringUtils.isBlank(department)){ + accountUserVo = userInfoMapper.getAccountByUsername("admin"); + }else { + accountUserVo = userInfoMapper.getAccountByDepartment(department); + } + } + return accountUserVo; + } + /** + * @Description: 手机号是否被占用 + * @date 2022/5/11 9:38 + */ + @Override + public boolean phoneIsOccupied(String phone) { + if (StringUtils.isBlank(phone)) throw new BusinessException("手机号为空"); + Integer count = userInfoMapper.selectCount(new LambdaQueryWrapper<UserInfo>() + .eq(UserInfo::getUsername, phone).eq(UserInfo::getStatus, 1)); + return count > 0; + } + + /** + * @Description: 身份证是否被占用 + * @date 2022/5/11 9:40 + */ + @Override + public boolean idCardIsOccupied(String idCard) { + if (StringUtils.isBlank(idCard)) throw new BusinessException("身份证号为空"); + Integer count = userInfoMapper.selectCount(new LambdaQueryWrapper<UserInfo>() + .eq(UserInfo::getIdcard, idCard).eq(UserInfo::getStatus, 1)); + return count > 0; + } + + + /** + * @Description: 考试后台登录 + * @date 2022/5/12 9:34 + */ + @Override + public UserInfo examBackgroundLogin(String username, String password) { + if (StringUtils.isBlank(username)) throw new BusinessException("用户姓名不能为空"); + if (StringUtils.isBlank(password)) throw new BusinessException("密码不能为空"); + + //查找admin type = 1 的用户信息 + UserInfo admin = userInfoMapper.selectOne( + new LambdaQueryWrapper<UserInfo>() + .eq(UserInfo::getUsername, username) + .eq(UserInfo::getType, 1) + .eq(UserInfo::getStatus, 1)); + if (admin == null) throw new BusinessException("账户不存在"); + if (!MD5Utils.encode(password).equals(admin.getPassword())) throw new BusinessException("密码输入错误"); + return admin; + } + /** + 查询by姓名 + */ + @Override + public UserInfo getUserByRealName(String trim) { + return userInfoMapper.getUserByRealName(trim); + } + /** + 查询by姓名 and dep + */ + @Override + public UserInfo getUserByRealNameAndDep(String name, Long dep) { + return userInfoMapper.getUserByRealNameAndDep(name, dep); + } + + /** + 查询by Id + */ + @Override + public UserInfo getByUserId(Long userId) { + return userInfoMapper.getByUserId(userId); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/VideoServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/VideoServiceImpl.java new file mode 100644 index 0000000..8e38cf4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/VideoServiceImpl.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.VideoInfo; +import com.gk.hotwork.Mapper.VideoInfoMapper; +import com.gk.hotwork.Service.VideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("VideoService") +public class VideoServiceImpl extends ServiceImpl<VideoInfoMapper, VideoInfo> implements VideoService { + @Autowired + VideoInfoMapper videoInfoMapper; + + @Override + public List<VideoInfo> selectByTime(String endtimeStr) { + return videoInfoMapper.selectByTime(endtimeStr); + } + +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/WarningServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WarningServiceImpl.java new file mode 100644 index 0000000..5120d21 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WarningServiceImpl.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Utils.PageUtil; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.WarningInfo; +import com.gk.hotwork.Mapper.WarningInfoMapper; +import com.gk.hotwork.Service.WarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/9/9 14:20 + */ +@Service("WarningService") +public class WarningServiceImpl extends ServiceImpl<WarningInfoMapper, WarningInfo> implements WarningService { + @Autowired + private WarningInfoMapper warningInfoMapper; + @Override + public WarningInfo getByContent(String taskCode, String worker, String content) { + LambdaQueryWrapper<WarningInfo> wrapper = new LambdaQueryWrapper<>(); + String taskType = "动火作业"; + wrapper.eq(WarningInfo::getContent,content); + wrapper.eq(WarningInfo::getTasktype,taskType); + wrapper.eq(WarningInfo::getWorker,worker); + wrapper.eq(WarningInfo::getTaskcode,taskCode); + return baseMapper.selectOne(wrapper); + } + + @Override + public List<WarningInfo> getBeforeWarn(String taskCode, String worker, String type, Date now) { + LambdaQueryWrapper<WarningInfo> wrapper = new LambdaQueryWrapper<>(); + String taskType = "动火作业"; + wrapper.eq(WarningInfo::getTaskcode,taskCode); + wrapper.eq(WarningInfo::getTasktype,taskType); + wrapper.eq(WarningInfo::getWorker,worker); + wrapper.eq(WarningInfo::getType,type); + wrapper.eq(WarningInfo::getIsdeal,(byte)0); + wrapper.le(WarningInfo::getCreatedat,now); + return baseMapper.selectList(wrapper); + } + + @Override + public void selectDataGrid(PageInfo pageInfo) { + Page<TaskInfo> page = PageUtil.getPage(pageInfo,"createdat"); + if (StringUtils.isBlank(pageInfo.getSort())){ + pageInfo.setSort("createdat"); + } + if (StringUtils.isBlank(pageInfo.getOrder())){ + pageInfo.setOrder("desc"); + } + List<WarningInfo>warningInfos = warningInfoMapper.selectTaskDataGrid(pageInfo.getCondition(),page); + pageInfo.setResult(warningInfos); + pageInfo.setTotalCount(page.getTotal()); + } + + @Override + public Integer getCount(Byte type) { + LambdaQueryWrapper<WarningInfo> wrapper = new LambdaQueryWrapper<>(); + String taskType = "动火作业"; + Calendar instance = Calendar.getInstance(); + instance.set(Calendar.HOUR_OF_DAY, 0); + instance.set(Calendar.MINUTE, 0); + instance.set(Calendar.SECOND, 0); + wrapper.eq(WarningInfo::getTasktype,taskType); + wrapper.eq(WarningInfo::getIsdeal,(byte)0); + wrapper.eq(WarningInfo::getType,type); + wrapper.ge(WarningInfo::getCreatedat, instance.getTime()); + return baseMapper.selectCount(wrapper); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/WordServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WordServiceImpl.java new file mode 100644 index 0000000..fff0d81 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WordServiceImpl.java @@ -0,0 +1,50 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.gk.hotwork.Domain.Utils.WordTemplate; +import com.gk.hotwork.Service.WordService; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.xwpf.usermodel.*; +import org.apache.xmlbeans.XmlException; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.util.*; + +@Service("wordService") +public class WordServiceImpl implements WordService { + + private static final WordTemplate.FontCustomize task_table_1 = new WordTemplate.FontCustomize(7, "宋体"); + private static final WordTemplate.FontCustomize task_table_2 = new WordTemplate.FontCustomize(12, "仿宋"); + + @Value("${taskPath}") + private String taskPath; + @Value("${taskPathPrefix}") + private String taskPathPrefix; + /** + * @Description: 生成真实word @Params tables:里表格, simpleData:单一数据 + * @date 2021/8/26 14:43 + */ + public void generateAllTaskCert(Map<String,Map<String,List<String>>> taskTypeMap, + Map<String,Map<String,List<WordTemplate.Attribute>>> type, + Map<String, WordTemplate.Table> tables, + Map<String, WordTemplate.MergeTable> mergeTables, + Map<String, String> simpleData, + Map<String,String> nameMapGraph, + WordTemplate template) throws IOException, XmlException, InvalidFormatException, InterruptedException { + + //自检列表重新生成变量 + template.generateSelfCheckTableParam(0,taskTypeMap,task_table_1.fontSize, task_table_1.fontFamily); + //找到type及其模板行生成相关 + template.generateOwnTypeAndAttrs(0,type,task_table_1.fontSize, task_table_1.fontFamily); + //二维码 + template.replaceQRCode(taskPath,simpleData.get("code"),40,40,350,0); + //替换签名 + template.replaceAutoGraph(taskPathPrefix,nameMapGraph,50,30,0,0); + //第一个table替换相应样式 + template.replace(0, tables,mergeTables, simpleData, task_table_1.fontSize, task_table_1.fontFamily); +// //第二个table替换相应样式 + template.replace(1, tables,new HashMap<>(), simpleData, task_table_2.fontSize, task_table_2.fontFamily); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/WorkCertServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WorkCertServiceImpl.java new file mode 100644 index 0000000..1c4f986 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/WorkCertServiceImpl.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.WorkCertInfo; +import com.gk.hotwork.Mapper.WorkCertInfoMapper; +import com.gk.hotwork.Service.WorkCertService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("WorkCertService") +public class WorkCertServiceImpl extends ServiceImpl<WorkCertInfoMapper, WorkCertInfo> implements WorkCertService { + @Autowired + WorkCertInfoMapper workCertInfoMapper; + + @Override + public List<WorkCertInfo> selectByMobile(String mobile) { + return workCertInfoMapper.selectByMobile(mobile); + } +} diff --git a/src/main/java/com/gk/hotwork/Service/SmsLogService.java b/src/main/java/com/gk/hotwork/Service/SmsLogService.java new file mode 100644 index 0000000..2c52ea0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SmsLogService.java @@ -0,0 +1,8 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SmsLog; + +public interface SmsLogService extends IService<SmsLog> { + +} diff --git a/src/main/java/com/gk/hotwork/Service/SmsService.java b/src/main/java/com/gk/hotwork/Service/SmsService.java new file mode 100644 index 0000000..31a3944 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SmsService.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Service; + +import java.util.Map; + +public interface SmsService { + + void send(String phone,String phoneUser,String tplId, Map<String,Object> params); + + /** + * @Description: 在某段时间key是否超过限制,超过则抛出的异常信息为msg + * @date 2022/5/16 10:33 + */ + boolean isMaxLimited(String key, Integer limit, String msg); + + +} diff --git a/src/main/java/com/gk/hotwork/Service/SubTaskService.java b/src/main/java/com/gk/hotwork/Service/SubTaskService.java new file mode 100644 index 0000000..7fd9782 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SubTaskService.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SubTaskInfo; +import com.gk.hotwork.Domain.UserInfo; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/10/11 16:42 + */ +public interface SubTaskService extends IService<SubTaskInfo> { + List<SubTaskInfo> getSubTasksByCode(String code); + + void removeByCode(String taskCode); + + void saveSubTasks(List<SubTaskInfo> subTaskInfos, String taskCode, UserInfo userInfo, String option); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskAnalysisService.java b/src/main/java/com/gk/hotwork/Service/TaskAnalysisService.java new file mode 100644 index 0000000..1ec0658 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskAnalysisService.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskAnalysis; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 11:09 + */ +public interface TaskAnalysisService extends IService<TaskAnalysis> { + List<TaskAnalysis> getListByTaskCode(String code); + + void deleteByTaskCode(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskEnclosureService.java b/src/main/java/com/gk/hotwork/Service/TaskEnclosureService.java new file mode 100644 index 0000000..84e5ef0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskEnclosureService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskEnclosure; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.TaskCheck; + +import java.util.List; + +public interface TaskEnclosureService extends IService<TaskEnclosure> { + List<TaskEnclosure> getListByTaskCode(String code); + + void removeByTaskCode(String code); + + void removeByTaskCodeAndType(String code, String type); + + List<TaskEnclosure> getFileByCodeAndType(String code, String type); + + void removeSubFile(String taskCode); + + void removeAndSave(TaskCheck taskCheck, UserInfo userInfo); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskEquipmentBindService.java b/src/main/java/com/gk/hotwork/Service/TaskEquipmentBindService.java new file mode 100644 index 0000000..c6a1dc9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskEquipmentBindService.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskEquipmentBindInfo; + +public interface TaskEquipmentBindService extends IService<TaskEquipmentBindInfo> { + + void removeByTaskCode(String code, String worker); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskEquipmentService.java b/src/main/java/com/gk/hotwork/Service/TaskEquipmentService.java new file mode 100644 index 0000000..a176a96 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskEquipmentService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskEquipment; + +import java.util.List; + +public interface TaskEquipmentService extends IService<TaskEquipment> { + List<TaskEquipment> getListByTaskCode(String code); + + void removeByTaskCode(String code); + + void removeByTaskCodeByConstruction(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskGasService.java b/src/main/java/com/gk/hotwork/Service/TaskGasService.java new file mode 100644 index 0000000..a4113f8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskGasService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskGasInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; + +import java.util.Date; +import java.util.List; + +public interface TaskGasService extends IService<TaskGasInfo> { + + void selectDataGrid(PageInfo pageInfo); + + List<TaskGasInfo> selectLastGas(String taskCode, String worker); + + List<TaskGasInfo> getWarnList(String code, String worker, Date startTime, Date now); + + boolean isEquipmentError(String code, String worker, Date startTime, Date now); + + List<TaskGasInfo> getEarlyWarnList(String code, String worker, Date startTime, Date now); +} + diff --git a/src/main/java/com/gk/hotwork/Service/TaskInvolveDepService.java b/src/main/java/com/gk/hotwork/Service/TaskInvolveDepService.java new file mode 100644 index 0000000..b7d8fe5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskInvolveDepService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskInvolveDepartment; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/26 10:27 + */ +public interface TaskInvolveDepService extends IService<TaskInvolveDepartment> { + List<TaskInvolveDepartment> getListByTaskCode(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskLocationService.java b/src/main/java/com/gk/hotwork/Service/TaskLocationService.java new file mode 100644 index 0000000..20155d9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskLocationService.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskLocationInfo; + +public interface TaskLocationService extends IService<TaskLocationInfo> { + + TaskLocationInfo getLocationByTaskAndWorker(String code, String worker); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskLogService.java b/src/main/java/com/gk/hotwork/Service/TaskLogService.java new file mode 100644 index 0000000..e48acb2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskLogService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskLog; + +/** + * @author : jingjy + * @date : 2021/8/20 15:06 + */ +public interface TaskLogService extends IService<TaskLog> { + +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskReviewService.java b/src/main/java/com/gk/hotwork/Service/TaskReviewService.java new file mode 100644 index 0000000..4b8b50a --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskReviewService.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskReview; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/11/16 9:45 + */ +public interface TaskReviewService extends IService<TaskReview> { + void saveReview(TaskReview taskReview); + + List<TaskReview> getListByTaskCode(String code); + + void deleteByTaskCode(String taskCode); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskRiskService.java b/src/main/java/com/gk/hotwork/Service/TaskRiskService.java new file mode 100644 index 0000000..94c1ba5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskRiskService.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskRisk; + +public interface TaskRiskService extends IService<TaskRisk> { + + TaskRisk getTaskRiskByCode(String code); + + void removeByCode(String code); + + void deleteByTaskCode(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskSecurityService.java b/src/main/java/com/gk/hotwork/Service/TaskSecurityService.java new file mode 100644 index 0000000..6326f7f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskSecurityService.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskSecurity; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 14:09 + */ +public interface TaskSecurityService extends IService<TaskSecurity> { + List<TaskSecurity> getListByTaskCode(String code); + + void deleteByTaskCode(String code); + + void removeByTaskCode(String code); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskService.java b/src/main/java/com/gk/hotwork/Service/TaskService.java new file mode 100644 index 0000000..da506b1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskService.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Vo.TaskVo; +import com.gk.hotwork.Domain.Vo.WorkShowTaskVo; +import com.gk.hotwork.Domain.Vo.specTask.ActiveTaskLocationDto; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @author : jingjy + * @date : 2021/8/19 17:07 + */ +public interface TaskService extends IService<TaskInfo> { + + List<ActiveTaskLocationDto> selectActiveTaskLocation(Date time,Byte type); + + void selectDataGrid(PageInfo pageInfo); + + String generateCode(UserInfo user, String workCode); + + void saveTaskByApp(TaskVo taskVo, UserInfo user); + + void selectDataGridByDep(PageInfo pageInfo); + + void selectDataGridViewable(PageInfo pageInfo); + + void getWaitReviewDataGrid(PageInfo pageInfo); + + TaskInfo getTaskByCode(String code); + + List<TaskVo> getPendingTask(String type, String name); + + List<TaskInfo> selectAllWorkCertUndone(); + + List<TaskVo> getDoingTask(); + + List<Map> getWorkToday(); + + IPage getWorkTodayDetail(Page<WorkShowTaskVo> page, Map filter); + + List<Map> getSpecialCompareInPeriod(String period); + + Map getWorkEverydayInMonth(); + + Map getFourTotal(); + + IPage selectTaskInPeriod(Page<TaskInfo> page, Map filter, UserInfo user); + + TaskVo getTaskVoByCode(String code); + + String generateAllWorkCert(String code); + + void selectStatisticsData(PageInfo pageInfo); + + List<TaskVo> getWorkShowTaskList(UserInfo user); + + List<TaskVo> getWorkShowPersonList(UserInfo user); + + void selectDataGridTesting(PageInfo pageInfo); + + void saveTaskForAnalysis(TaskVo taskVo, UserInfo userInfo); + + void updateTaskByApp(TaskVo taskVo, UserInfo userInfo); + + void updateTaskByAppForAnalysis(TaskVo taskVo, UserInfo userInfo); +} diff --git a/src/main/java/com/gk/hotwork/Service/TaskWorkerService.java b/src/main/java/com/gk/hotwork/Service/TaskWorkerService.java new file mode 100644 index 0000000..6f4ce71 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/TaskWorkerService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.TaskWorker; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Vo.TaskWorkerVo; + +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/8/20 14:14 + */ +public interface TaskWorkerService extends IService<TaskWorker> { + List<TaskWorker> getListByTaskCode(String code); + + void deleteByTaskCode(String code); + + List<TaskWorkerVo> getVoByTaskCode(String code); + + void saveBatch(List<TaskWorkerVo> workers, UserInfo userInfo); +} diff --git a/src/main/java/com/gk/hotwork/Service/UserFaceService.java b/src/main/java/com/gk/hotwork/Service/UserFaceService.java new file mode 100644 index 0000000..a602eea --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/UserFaceService.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.UserFace; + +public interface UserFaceService extends IService<UserFace> { + + /** + * @Description: 更新用户信息 + */ + void copeWith(Long userId, String code); + + /** + * @Description: 查找用户信息 根据{{用户id}} + */ + + UserFace selectByUserId(Long id); + + /** + * @Description: 更新用户脸部信息 根据{{用户id}} + */ + + void updateOne(UserFace userFace); +} diff --git a/src/main/java/com/gk/hotwork/Service/UserRolesService.java b/src/main/java/com/gk/hotwork/Service/UserRolesService.java new file mode 100644 index 0000000..024c1e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/UserRolesService.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.UserRolesInfo; + +public interface UserRolesService extends IService<UserRolesInfo> { + + void deleteByUserId(Long userid); +} diff --git a/src/main/java/com/gk/hotwork/Service/UserService.java b/src/main/java/com/gk/hotwork/Service/UserService.java new file mode 100644 index 0000000..0a171e6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/UserService.java @@ -0,0 +1,111 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.RoleInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.Vo.AccountUserVo; +import com.gk.hotwork.Domain.Vo.RegisterVo; +import com.gk.hotwork.Domain.Vo.UserVo; +import org.apache.catalina.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface UserService extends IService<UserInfo> { + + void selectUserDataGrid(PageInfo pageInfo); + + UserInfo selectByUser(String username); + + List<UserInfo> selectUserInfo(Long id, String username); + + boolean checkUserById(String userId); + + UserVo selectUserVoByName(String examtype, String username); + + void deleteById(Long id); + + void recoverOneById(Long id); + + UserInfo selectByRealName(Long id,String realname); + + UserInfo getByRealName(String realname, String depName); + + UserInfo selectByIdCard(Long id,String idcard); + + List<UserInfo> selectNotUpload(); + + List<UserVo> selectAll(HashMap<String, Object> condition); + + List<UserInfo> selectByCompany(String company); + + Msg saveEmployee(String realname, String empNo, String deviceNo) throws Exception; + + Msg setCardValid(String isValid, String cardId) throws Exception; + + Msg delEmployee(String cardId) throws Exception; + + Msg getRealGps() throws Exception; + + UserInfo selectUserByCard(String deviceNo, String empNo, String name); + + List<UserInfo> getGps(String username); + + int selectUserSize(); + + UserInfo getByDeviceNo(String uid); + + IPage<UserVo> selectUserPageInDepartment(Page<UserVo> page, Map<String, Object> filter, UserInfo user); + + List<UserVo> getUserList(); + + UserInfo examForegroundLogin(String username, String password); + + Integer selectCountForExam(String name, String idno, String tel, String department,String company); + + List<UserInfo> selectPageForExam(String name, String idno, String tel, String department, String company, Integer first, Integer pageSize); + + void register(RegisterVo registerVo); + + void pwdChange(String username, String password, String phone); + + AccountUserVo getAccount(String username, String department); + + + /** + * @Description: 手机号是否正在被使用 + * @date 2022/5/11 9:33 + */ + boolean phoneIsOccupied(String phone); + + /** + * @Description: 身份证是否正在被使用 + * @date 2022/5/11 9:39 + */ + boolean idCardIsOccupied(String idCard); + + /** + * @Description: 考试后台登录 + * @date 2022/5/12 9:32 + */ + UserInfo examBackgroundLogin(String username, String password); + /** + 查询by姓名 + */ + UserInfo getUserByRealName(String trim); + /** + 查询by姓名 and dep + */ + UserInfo getUserByRealNameAndDep(String name, Long dep); + /** + 查询by Id + */ + UserInfo getByUserId(Long userId); + +} diff --git a/src/main/java/com/gk/hotwork/Service/VideoService.java b/src/main/java/com/gk/hotwork/Service/VideoService.java new file mode 100644 index 0000000..e6572ef --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/VideoService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.VideoInfo; + +import java.util.List; + +public interface VideoService extends IService<VideoInfo> { + + List<VideoInfo> selectByTime(String endtimeStr); + +} diff --git a/src/main/java/com/gk/hotwork/Service/WarningService.java b/src/main/java/com/gk/hotwork/Service/WarningService.java new file mode 100644 index 0000000..9d23bab --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/WarningService.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.Utils.PageInfo; +import com.gk.hotwork.Domain.WarningInfo; + +import java.util.Date; +import java.util.List; + +/** + * @author : jingjy + * @date : 2021/9/9 14:17 + */ +public interface WarningService extends IService<WarningInfo> { + WarningInfo getByContent(String taskCode, String worker, String content); + + List<WarningInfo> getBeforeWarn(String taskCode, String worker, String type, Date now); + + void selectDataGrid(PageInfo pageInfo); + + Integer getCount(Byte type); +} diff --git a/src/main/java/com/gk/hotwork/Service/WordService.java b/src/main/java/com/gk/hotwork/Service/WordService.java new file mode 100644 index 0000000..57c3073 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/WordService.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.Service; + + +import com.gk.hotwork.Domain.Utils.WordTemplate; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.xmlbeans.XmlException; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +public interface WordService { + + void generateAllTaskCert(Map<String,Map<String, List<String>>> taskTypeMap, + Map<String,Map<String,List<WordTemplate.Attribute>>> type, + Map<String, WordTemplate.Table> tables, + Map<String, WordTemplate.MergeTable> mergeTables, + Map<String, String> simpleData, + Map<String,String> nameMapGraph, + WordTemplate template) throws IOException, XmlException, InvalidFormatException, InterruptedException; +} diff --git a/src/main/java/com/gk/hotwork/Service/WorkCertService.java b/src/main/java/com/gk/hotwork/Service/WorkCertService.java new file mode 100644 index 0000000..c82b8f4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/WorkCertService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.Service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.WorkCertInfo; + +import java.util.List; + +public interface WorkCertService extends IService<WorkCertInfo> { + + List<WorkCertInfo> selectByMobile(String mobile); + +} diff --git a/src/main/java/com/gk/hotwork/ServletInitializer.java b/src/main/java/com/gk/hotwork/ServletInitializer.java new file mode 100644 index 0000000..ad3c2e9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/ServletInitializer.java @@ -0,0 +1,14 @@ +package com.gk.hotwork; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + //Application的类名 + return application.sources(HotworkApplication.class); + } + +} diff --git a/src/main/java/com/gk/hotwork/Sms/SmsServiceConfig.java b/src/main/java/com/gk/hotwork/Sms/SmsServiceConfig.java new file mode 100644 index 0000000..8cd3852 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Sms/SmsServiceConfig.java @@ -0,0 +1,95 @@ +package com.gk.hotwork.Sms; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import com.gk.hotwork.Sms.Supplier.Abstract.Supplier; +import com.gk.hotwork.Sms.Supplier.Ali; +import com.gk.hotwork.Sms.Supplier.Jh; +import io.swagger.models.auth.In; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +@Component("smsServiceConfig") +@ConfigurationProperties(prefix = "sms") +public class SmsServiceConfig { + + private static final Logger logger = Logger.getLogger(SmsServiceConfig.class); + + @Autowired + private Ali ali; + @Autowired + private Jh jh; + + //开关 + private boolean enable; + //激活 + private String active; + //每日限制条数 + private Integer limit; + + private List<Supplier> suppliers; + + private Supplier activeSupplier; + + @PostConstruct + void initSupplier(){ + this.suppliers = new ArrayList<>(); + this.suppliers.add(ali); + this.suppliers.add(jh); + Optional<Supplier> first = this.suppliers.stream().filter(item -> item.getName().equals(this.active)).findFirst(); + if (first.isPresent()) { + this.activeSupplier = first.get(); + logger.info("初始化短信配置成功"); + }else{ + logger.error("初始化短信配置失败"); + } + } + + + public boolean isEnable() { + return enable; + } + + public void setEnable(boolean enable) { + this.enable = enable; + } + + public List<Supplier> getSuppliers() { + return suppliers; + } + + public void setSuppliers(List<Supplier> suppliers) { + this.suppliers = suppliers; + } + + public String getActive() { + return active; + } + + public Supplier getActiveSupplier() { + return activeSupplier; + } + + public void setActiveSupplier(Supplier activeSupplier) { + this.activeSupplier = activeSupplier; + } + + public void setActive(String active) { + this.active = active; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/src/main/java/com/gk/hotwork/Sms/Supplier/Abstract/Supplier.java b/src/main/java/com/gk/hotwork/Sms/Supplier/Abstract/Supplier.java new file mode 100644 index 0000000..805d81f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Sms/Supplier/Abstract/Supplier.java @@ -0,0 +1,54 @@ +package com.gk.hotwork.Sms.Supplier.Abstract; + +import java.security.NoSuchAlgorithmException; +import java.util.Map; + +public abstract class Supplier{ + + /** + * @Description: name 唯一,active依靠name来获取当前生效短信供应商 + * @date 2022/5/19 10:29 + */ + private String name; + + private String url; + + private String key; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + /** + * @Description: 一般供应商发送信息 包括 手机号:用户名,key,模板id,和传输模板参数内容 + * @date 2022/5/18 17:03 + */ + public abstract boolean sendSms(String phone,String tplId, Map<String, Object> params); + + /** + * @Description: key 要求不以明文 配置在配置信息;需要解密 + * @date 2022/5/18 17:19 + */ + public abstract String keyDecoder(String key); + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gk/hotwork/Sms/Supplier/Ali.java b/src/main/java/com/gk/hotwork/Sms/Supplier/Ali.java new file mode 100644 index 0000000..aadeece --- /dev/null +++ b/src/main/java/com/gk/hotwork/Sms/Supplier/Ali.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.Sms.Supplier; + +import com.gk.hotwork.Sms.Supplier.Abstract.Supplier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.Map; + +@Component("ali") +@ConfigurationProperties(prefix = "sms.supplier.ali") +public class Ali extends Supplier { + + @Override + public boolean sendSms(String phone,String tplId,Map<String, Object> params) { + return false; + } + + + @Override + public String keyDecoder(String key) { + return null; + } +} diff --git a/src/main/java/com/gk/hotwork/Sms/Supplier/Jh.java b/src/main/java/com/gk/hotwork/Sms/Supplier/Jh.java new file mode 100644 index 0000000..823920d --- /dev/null +++ b/src/main/java/com/gk/hotwork/Sms/Supplier/Jh.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.Sms.Supplier; + +import cn.hutool.crypto.symmetric.AES; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.HttpUtils; +import com.gk.hotwork.Sms.Supplier.Abstract.Supplier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; +/** +* @Description: 聚合 +* @date 2022/5/18 16:49 +*/ +@Component("jh") +@ConfigurationProperties(prefix = "sms.supplier.jh") +public class Jh extends Supplier { + + + private AES aes = new AES("CBC", "PKCS7Padding", + // 密钥,不可更改 + "kikokiko00012345".getBytes(), + // iv加盐 + "wakuwaku00012345".getBytes()); + + public boolean sendSms(String mobile, String tplId, Map<String,Object> paramsContent) { + try { + Map<String, Object> params = new HashMap<>(); + params.put("mobile", mobile);//接收短信的手机号码 + params.put("tpl_id", tplId);//短信模板ID,请参考个人中心短信模板设置 + StringBuilder sb = new StringBuilder(); + for (Map.Entry<String, Object> entry : paramsContent.entrySet()) { + //包含特殊字符# 使用转义字符代替 + String value = entry.getValue().toString().replace("#", "%23"); + sb.append("&#").append(entry.getKey()) + .append("#=").append(value); + } + params.put("tpl_value", sb.deleteCharAt(0).toString()); + params.put("key", this.keyDecoder(this.getKey()));//应用APPKEY(应用详细页查询) + params.put("dtype", "json");//返回数据的格式,xml或json,默认json + String response = HttpUtils.net(this.getUrl(), params, "GET"); + JSONObject jsonResult = JSONObject.parseObject(response); + String errorCode = jsonResult.getString("error_code"); + String reason = jsonResult.getString("reason"); + if ("0".equals(errorCode)) { + return true; + } else { + throw new BusinessException(reason); + } + } catch (Exception e) { + e.printStackTrace(); + throw new BusinessException("系统错误"); + } + } + + @Override + public String keyDecoder(String key) { + return aes.decryptStr(key); + } + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/config/MybatisPlusConfig.java b/src/main/java/com/gk/hotwork/doublePrevention/config/MybatisPlusConfig.java new file mode 100644 index 0000000..b30d84b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/config/MybatisPlusConfig.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.doublePrevention.config; + +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MybatisPlusConfig { + + + /** + * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除) + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor1(){ + MybatisPlusInterceptor myInterceptor = new MybatisPlusInterceptor(); + myInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); + return myInterceptor; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckContentController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckContentController.java new file mode 100644 index 0000000..d91644e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckContentController.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckContentQueryReqDTO; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.security.Principal; + + +public class PreventDangerCheckContentController extends BaseController { + + + /** + * 隐患检查内容-分页查询 + */ + @PostMapping("/select/getCheckContentPage") + public ResultVO<PreventDangerCheckContent> getCheckContentPage(Principal principal, @RequestBody PreventDangerCheckContentQueryReqDTO checkContentQueryReqDTO) { + + return null; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskController.java new file mode 100644 index 0000000..017d0c7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskController.java @@ -0,0 +1,102 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/checkTask") +public class PreventDangerCheckTaskController extends BaseController { + + @Autowired + private DangerService dangerService; + + /** + * 隐患排查任务-分页查询 + */ + @PostMapping("/select/getTaskPage") + public ResultVO<PreventDangerCheckTask> getTaskPage(Authentication authentication, @RequestBody PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getTaskPage(currentUser.getUid(), taskQueryReqDTO); + } + + /** + * 隐患排查任务-分页查询-手机端使用 + */ + @PostMapping("/select/getTaskPageForMobile") + public ResultVO<PreventDangerCheckTask> getTaskPageForMobile(Authentication authentication, @RequestBody PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getTaskPageForMobile(currentUser.getUid(), taskQueryReqDTO); + } + /** + * 隐患排查任务-分页查询-手机端使用-测试 + */ + @PostMapping("/select/getTaskPageForMobileTest") + public ResultVO<PreventDangerCheckTask> getTaskPageForMobileTest(Authentication authentication, @RequestBody PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getTaskPageForMobileTest(currentUser.getUid(), taskQueryReqDTO); + } + /** + * 隐患排查任务-新增 + */ + @PostMapping("/insert/saveTask") + public ResultVO<PreventDangerCheckTask> saveTask(Authentication authentication, @RequestBody PreventDangerCheckTaskSaveReqDTO taskSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.saveTask(currentUser.getUid(), taskSaveReqDTO); + } + + /** + * 隐患排查任务-上报 + */ + @PostMapping("/update/updateTask") + public ResultVO<PreventDangerCheckTask> updateTask(Authentication authentication, @RequestBody PreventDangerCheckTaskUpdateReqDTO taskUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.updateTask(currentUser.getUid(), taskUpdateReqDTO); + } + + /** + * 隐患排查任务-删除 + */ + @PostMapping("/delete/deleteTask") + public ResultVO<PreventDangerCheckTask> deleteTask(Authentication authentication, @RequestBody PreventDangerCheckTaskDeleteReqDTO taskDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.deleteTask(currentUser.getUid(), taskDeleteReqDTO); + } + + /** + * 排查任务-认领任务 + */ + @PostMapping("/update/taskToUser") + public ResultVO<PreventDangerCheckTask> taskToUser(Authentication authentication, @RequestBody PreventDangerCheckTaskDeleteReqDTO taskToUserDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.taskToUser(currentUser, taskToUserDTO); + } + + /** + * 排查任务-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateCheckTaskReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.updateCheckTaskReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskUnitController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskUnitController.java new file mode 100644 index 0000000..c2b0cc5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckTaskUnitController.java @@ -0,0 +1,84 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/taskUnit") +public class PreventDangerCheckTaskUnitController extends BaseController { + + @Autowired + private DangerService dangerService; + + /** + * 隐患排查任务单元-分页查询 + */ + @PostMapping("/select/getTaskUnitPage") + public ResultVO<PreventDangerCheckTaskUnit> getTaskUnitPage(Authentication authentication, @RequestBody PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getTaskUnitPage(currentUser.getUid(), taskUnitQueryReqDTO); + } + + /** + * 隐患排查任务单元-任务单元列表 + */ + @PostMapping("/select/listTaskUnit") + public ResultVO<PreventDangerCheckTaskUnit> listTaskUnit(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.listTaskUnit(currentUser.getUid()); + } + + /** + * 隐患排查任务单元-新增 + */ + @PostMapping("/insert/saveTaskUnit") + public ResultVO<PreventDangerCheckTaskUnit> saveTaskUnit(Authentication authentication, @RequestBody PreventDangerCheckTaskUnitSaveReqDTO taskUnitSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.saveTaskUnit(currentUser.getUid(), taskUnitSaveReqDTO); + } + + /** + * 隐患排查任务单元-修改 + */ + @PostMapping("/update/updateTaskUnit") + public ResultVO<PreventDangerCheckTaskUnit> updateTaskUnit(Authentication authentication, @RequestBody PreventDangerCheckTaskUnitUpdateReqDTO taskUnitUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.updateTaskUnit(currentUser.getUid(), taskUnitUpdateReqDTO); + } + + /** + * 隐患排查任务单元-删除 + */ + @PostMapping("/delete/deleteTaskUnit") + public ResultVO<PreventDangerCheckTaskUnit> deleteTaskUnit(Authentication authentication, @RequestBody PreventDangerCheckTaskUnitDeleteReqDTO taskUnitDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.deleteTaskUnit(currentUser.getUid(), taskUnitDeleteReqDTO); + } + /** + * 隐患排查任务单元-批量删除 + */ + @PostMapping("/delete/deleteBatchTaskUnit") + public ResultVO<PreventDangerCheckTaskUnit> deleteBatchTaskUnit(Authentication authentication, @RequestBody DeleteBatchReqDTO deleteBatchReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.deleteBatchTaskUnit(currentUser, deleteBatchReqDTO); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckWorkController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckWorkController.java new file mode 100644 index 0000000..abafa73 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerCheckWorkController.java @@ -0,0 +1,95 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/checkWork") +public class PreventDangerCheckWorkController extends BaseController { + + @Autowired + private DangerService dangerService; + + /** + * 隐患排查作业-分页查询 + */ + @PostMapping("/select/getCheckWorkPage") + public ResultVO<PreventDangerCheckWork> getCheckWorkPage(Authentication authentication, @RequestBody PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getCheckWorkPage(currentUser.getUid(), workQueryReqDTO); + } + + /** + * 隐患排查作业-任务列表 + */ + @PostMapping("/select/listCheckWork") + public ResultVO<PreventDangerCheckWork> listCheckWork(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.listCheckWork(currentUser.getUid()); + } + + /** + * 隐患排查作业-查看检查内容 + */ + @PostMapping("/select/getCheckWorkContent") + public ResultVO<PreventDangerCheckWork> getCheckWorkContent(Authentication authentication, @RequestBody PreventDangerCheckWorkContentQueryReqDTO contentReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.getCheckWorkContent(currentUser.getUid(), contentReqDTO); + } + + /** + * 隐患排查作业-新增 + */ + @PostMapping("/insert/saveCheckWork") + public ResultVO<PreventDangerCheckWork> saveCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkSaveReqDTO workSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.saveCheckWork(currentUser.getUid(), workSaveReqDTO); + } + + /** + * 隐患排查作业-修改 + */ + @PostMapping("/update/updateCheckWork") + public ResultVO<PreventDangerCheckWork> updateCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkUpdateReqDTO workUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.updateCheckWork(currentUser.getUid(), workUpdateReqDTO); + } + + /** + * 隐患排查作业-删除 + */ + @PostMapping("/delete/deleteCheckWork") + public ResultVO<PreventDangerCheckWork> deleteCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkDeleteReqDTO workDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.deleteCheckWork(currentUser.getUid(), workDeleteReqDTO); + } + + /** + * 排查作业-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateCheckWorkReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return dangerService.updateCheckWorkReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerManageController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerManageController.java new file mode 100644 index 0000000..75ebfab --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerManageController.java @@ -0,0 +1,135 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Domain.Utils.Properties; +import com.gk.hotwork.Domain.Utils.UploadUtil; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManage; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventDangerManageQueryRespDTO; +import com.gk.hotwork.doublePrevention.service.RectifyService; + +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; + +import java.time.LocalDate; + +@RestController +@RequestMapping("prevent/dangerManage") +public class PreventDangerManageController extends BaseController{ + + + + @Autowired + private RectifyService rectifyService; + + /** + * 隐患治理清单-分页查询 + */ + @PostMapping("/select/getDangerManagePage") + public ResultVO<PreventDangerManage> getDangerManagePage(Authentication authentication, @RequestBody PreventDangerManageQueryReqDTO manageQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.getDangerManagePage(currentUser.getUid(), manageQueryReqDTO); + } + + /** + * 隐患治理清单-列表 + */ + @PostMapping("/select/listDangerManage") + public ResultVO<PreventDangerManage> listDangerManage(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.listDangerManage(currentUser.getUid()); + } + + /** + * 隐患治理清单-新增 + */ + @PostMapping("/insert/saveDangerManage") + public ResultVO<PreventDangerManage> saveDangerManage(Authentication authentication, @RequestBody PreventDangerManageSaveReqDTO manageSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.saveDangerManage(currentUser.getUid(), manageSaveReqDTO); + } + + /** + * 隐患治理清单-修改 + */ + @PostMapping("/update/updateDangerManage") + public ResultVO<PreventDangerManage> updateDangerManage(Authentication authentication, @RequestBody PreventDangerManageUpdateReqDTO manageUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.updateDangerManage(currentUser.getUid(), manageUpdateReqDTO); + } + + /** + * 隐患治理清单-删除 + */ + @PostMapping("/delete/deleteDangerManage") + public ResultVO<PreventDangerManage> deleteDangerManage(Authentication authentication, @RequestBody PreventDangerManageDeleteReqDTO manageDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.deleteDangerManage(currentUser.getUid(), manageDeleteReqDTO); + } + + /** + * 隐患管理-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateDangerManagerReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.updateDangerManagerReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } + + /** + * 隐患管理-关闭隐患单 + */ + @PostMapping("/update/closeDanger") + public ResultVO<PreventRiskAnaUnit> closeDanger(Authentication authentication, @RequestBody PreventCloseDangerReqDTO closeDangerReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.closeDanger(currentUser.getUid(), closeDangerReqDTO); + } + @GetMapping("/count/byCreateDate") + public ResultVO getDangerCountByCreateDate(String date){ + ResultVO resultVO = new ResultVO<>(); + LocalDate localDate = null; + if(date == null || date.isEmpty()){ + resultVO.setCode(ResultCodes.CLIENT_PARAM_ERROR.getCode()); + resultVO.setMsg(ResultCodes.CLIENT_PARAM_ERROR.getDesc()); + return resultVO; + } + try { + localDate = LocalDate.parse(date); + } catch (Exception e) { + resultVO.setCode(ResultCodes.CLIENT_PARAM_ERROR.getCode()); + resultVO.setMsg(ResultCodes.CLIENT_PARAM_ERROR.getDesc()); + return resultVO; + } + return rectifyService.countDangerByDate(localDate); + } + + @GetMapping("/find/serialCode") + public ResultVO findDangerManageBySerialCode(String serialCode){ + ResultVO<PreventDangerManageQueryRespDTO> resultVO = new ResultVO<>(); + resultVO.setCode(ResultCodes.OK.getCode()); + if(serialCode == null || serialCode.length() < 13){ + return resultVO; + } + resultVO = rectifyService.findByDangerSerialCode(serialCode); + return resultVO; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerRectifyController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerRectifyController.java new file mode 100644 index 0000000..0b96506 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventDangerRectifyController.java @@ -0,0 +1,122 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify; +import com.gk.hotwork.doublePrevention.entity.dto.query.OwnRectifyPageQuery; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.RectifyService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/dangerRectify") +public class PreventDangerRectifyController extends BaseController { + + @Autowired + private RectifyService rectifyService; + + /** + * 隐患整改清单-分页查询 + */ + @PostMapping("/select/getDangerRectifyPage") + public ResultVO<PreventDangerRectify> getDangerRectifyPage(Authentication authentication, @RequestBody PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.getDangerRectifyPage(currentUser.getUid(), rectifyQueryReqDTO); + } + + /** + * 隐患整改清单-查询:待验收与已验收 + */ + @PostMapping("/select/getRectifyOverPage") + public ResultVO<PreventDangerRectify> getRectifyOverPage(Authentication authentication, @RequestBody PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.getRectifyOverPage(currentUser.getUid(), rectifyOverQueryReqDTO); + } + +// /** +// * 隐患整改清单-新增 +// */ +// @PostMapping("/insert/saveDangerRectify") +// public ResultVO<PreventDangerRectify> saveDangerRectify(Principal principal, @RequestBody PreventDangerRectifySaveReqDTO rectifySaveReqDTO) { +// +// //此处principal.getName就是id +// String userId =principal.getName(); +// return rectifyService.saveDangerRectify(Long.valueOf(userId), rectifySaveReqDTO); +// } + + /** + * 隐患整改清单-修改 + */ + @PostMapping("/update/updateDangerRectify") + public ResultVO<PreventDangerRectify> updateDangerRectify(Authentication authentication, @RequestBody PreventDangerRectifyUpdateReqDTO rectifyUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.updateDangerRectify(currentUser.getUid(), rectifyUpdateReqDTO); + } + + /** + * 隐患整改清单-删除 + */ + @PostMapping("/delete/deleteDangerRectify") + public ResultVO<PreventDangerRectify> deleteDangerRectify(Authentication authentication, @RequestBody PreventDangerRectifyDeleteReqDTO rectifyDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.deleteDangerRectify(currentUser.getUid(), rectifyDeleteReqDTO); + } + + /** + * 隐患整改清单--验收 + */ + @PostMapping("/update/reportRectify") + public ResultVO<PreventDangerRectify> reportRectify(Authentication authentication, @RequestBody PreventDangerReportRectifyReqDTO reportRectiity) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.reportRectify(currentUser.getUid(), reportRectiity); + } + + /** + * 隐患整改清单-填报--整改 + */ + @PostMapping("/update/applyReport") + public ResultVO<PreventDangerRectify> applyReport(Authentication authentication, @RequestBody PreventDangerReportRectifyReqDTO reportRectiity) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.applyReport(currentUser.getUid(), reportRectiity); + } + + /** + * 隐患整改--延期 + */ + @PostMapping("/update/timeOutRectify") + public ResultVO<PreventDangerRectify> timeOutRectify(Authentication authentication, @RequestBody PreventDangerRectifyUpdateReqDTO updateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return rectifyService.timeOutRectify(currentUser.getUid(), updateReqDTO); + } + + /** + * @Description: 获取当前用户需要他整改的即将超期的隐患单子 + */ + @PostMapping("/own/toRectify/page") + public ResultVO ownRectifyPage(@RequestBody PageQuery<OwnRectifyPageQuery> pageQuery) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return rectifyService.listOwnRectifyPage(currentUser, pageQuery); + } + + + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventFileHandlerController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventFileHandlerController.java new file mode 100644 index 0000000..a73ae0a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventFileHandlerController.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.service.FileHandlerService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + + + +@RestController +@RequestMapping("prevent/fileHandler") +public class PreventFileHandlerController extends BaseController { + + @Autowired + private FileHandlerService handlerService; + + + /** + * 生产装置-导入 + */ + @PostMapping("/insert/deviceImport") + public ResultVO<PreventProduceDevice> deviceImport(Authentication authentication, @RequestParam MultipartFile file) throws Exception { + + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return handlerService.deviceImport(currentUser, file ); + } + + /** + * 风险分析单元-导入 + */ + @PostMapping("/insert/riskUnitImport") + public ResultVO<PreventRiskAnaUnit> riskUnitImport(Authentication authentication, @RequestParam MultipartFile file) throws Exception { + + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return handlerService.riskUnitImport(currentUser, file ); + } + + /** + * 安全风险事件-导入 + */ + @PostMapping("/insert/eventImport") + public ResultVO<PreventRiskEvent> eventImport(Authentication authentication, @RequestParam MultipartFile file) throws Exception { + + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return handlerService.eventImport(currentUser, file ); + } + + /** + * 管控措施-导入 + */ + @PostMapping("/insert/measureImport") + public ResultVO<PreventRiskEvent> measureImport(Authentication authentication, @RequestParam MultipartFile file) throws Exception { + + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return handlerService.measureImport(currentUser, file ); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceDeviceController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceDeviceController.java new file mode 100644 index 0000000..35efdd9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceDeviceController.java @@ -0,0 +1,106 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.*; + + +/** + * @author qihs + * @since 2022-06-25 10:40:17 + */ +@RestController +@RequestMapping("prevent/device") +public class PreventProduceDeviceController extends BaseController { + + @Autowired + private RiskService riskService; + + /** + * 生产装置-分页查询 + * @param deviceQueryReqDtoReqDto + */ + @PostMapping("/select/getDevicePage") + public ResultVO<PreventProduceDevice> getDevicePage(@RequestBody PreventProduceDeviceQueryReqDTO deviceQueryReqDtoReqDto) { + + return riskService.getDevicePage(deviceQueryReqDtoReqDto); + } + + /** + * 生产装置-新增 + * @param deviceSaveReqDto + */ + @PostMapping("/insert/saveDevice") + public ResultVO<PreventProduceDevice> saveDevice(Authentication authentication, @RequestBody PreventProduceDeviceSaveReqDTO deviceSaveReqDto) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.saveDevice(currentUser.getUid(), deviceSaveReqDto); + } + + /** + * 生产装置- 查询生产装置列表 + */ + @PostMapping("/select/listDevices") + public ResultVO<PreventProduceDevice> getListDevices(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getListDevices(currentUser.getUid()); + } + + /** + * 生产装置-删除 + * @param deviceDeleteReqDTO + */ + @PostMapping("/delete/deleteDevice") + public ResultVO<PreventProduceDevice> deleteDevice(Authentication authentication, @RequestBody PreventProduceDeviceDeleteReqDTO deviceDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteOne(currentUser.getUid(), deviceDeleteReqDTO); + } + /** + * 生产装置-批量删除 + */ + @PostMapping("/delete/deleteBatchDevice") + public ResultVO<PreventProduceDevice> deleteBatchDevice(Authentication authentication, @RequestBody DeleteBatchReqDTO deleteBatchReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteBatchDevice(currentUser, deleteBatchReqDTO); + } + + /** + * 生产装置-修改 + * @param deviceUpdateReqDTO + */ + @PostMapping("/update/updateDevice") + public ResultVO<PreventProduceDevice> updateDevice(Authentication authentication, @RequestBody PreventProduceDeviceUpdateReqDTO deviceUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateOneById(currentUser.getUid(), deviceUpdateReqDTO); + } + + + + + + + /** + * 生产装置-按照等级查询 + * @param deviceQueryReqDTO + */ + @GetMapping("/select/getListByLevel") + public ResultVO<PreventProduceDevice> getByLevel(@RequestBody PreventProduceDeviceQueryReqDTO deviceQueryReqDTO) { + + return riskService.getByLevel(deviceQueryReqDTO); + } + + + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceMapController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceMapController.java new file mode 100644 index 0000000..2aeb88c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventProduceMapController.java @@ -0,0 +1,76 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventRiskMap; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapDeleteReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapSaveReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapUpdateReqDTO; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/map") +public class PreventProduceMapController extends BaseController { + + @Autowired + private RiskService riskService; + + + /** + * 风险分布图-分页查询详细信息 + */ + @PostMapping("/select/getRiskMapPage") + public ResultVO<PreventRiskMap> getMapPage(@RequestBody PreventRiskMapQueryReqDTO riskMapQueryReqDTO) { + + return riskService.getMapPage(riskMapQueryReqDTO); + } + + /** + * 风险分布图-新增 + */ + @PostMapping("/insert/saveRiskMap") + public ResultVO<PreventRiskMap> saveRiskMap(Authentication authentication, PreventRiskMapSaveReqDTO riskMapSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.saveRiskMap(currentUser.getUid(), riskMapSaveReqDTO); + } + + /** + * 风险分布图-删除 + */ + @PostMapping("/delete/deleteRiskMap") + public ResultVO<PreventRiskMap> deleteRiskMap(Authentication authentication, @RequestBody PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteRiskMap(currentUser.getUid(), riskMapDeleteReqDTO); + } + + /** + * 风险分布图-修改 + */ + @PostMapping("/update/updateRiskMap") + public ResultVO<PreventRiskMap> updateRiskMap(Authentication authentication, @RequestBody PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskMap(currentUser.getUid(), riskMapUpdateReqDTO); + } + + + /** + * 风险分布图-图 + */ + @PostMapping("/select/getMapImage") + public ResultVO<PreventRiskMap> getMapImage(@RequestBody Long id) { + + return riskService.getMapImage(id); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckRecordFromTaskController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckRecordFromTaskController.java new file mode 100644 index 0000000..b919502 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckRecordFromTaskController.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckRecordFromTask; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckRecordFromTaskReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportRecordFromTask") +public class PreventReportCheckRecordFromTaskController extends BaseController { + @Autowired + private ReportService reportService; + + /** + * 上报数据-任务记录-分页查询 + */ + @PostMapping("/select/getRecordFromTaskPage") + public ResultVO<PreventReportCheckRecordFromTask> getRecordFromTaskPage(Authentication authentication, @RequestBody PreventReportCheckRecordFromTaskReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getRecordFromTaskPage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckTaskFromWorkController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckTaskFromWorkController.java new file mode 100644 index 0000000..e52c5da --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportCheckTaskFromWorkController.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckTaskFromWork; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckTaskFromWorkReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportTaskFromWork") +public class PreventReportCheckTaskFromWorkController extends BaseController { + + @Autowired + private ReportService reportService; + + /** + * 上报数据-任务配置-分页查询 + */ + @PostMapping("/select/getReportTaskFromWorkPage") + public ResultVO<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(Authentication authentication, @RequestBody PreventReportCheckTaskFromWorkReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportTaskFromWorkPage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigController.java new file mode 100644 index 0000000..30ee8ca --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigController.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfig; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigUpdateReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportConfig") +public class PreventReportConfigController extends BaseController { + + @Autowired + private ReportService reportService; + + /** + * 数据上报配置-查询 + */ + @PostMapping("/select/getConfig") + public ResultVO<PreventReportConfig> getConfig(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportConfig(currentUser.getUid()); + } + + /** + * 数据上报配置-修改 + */ + @PostMapping("/update/updateConfig") + public ResultVO<PreventReportConfig> updateConfig(Authentication authentication, @RequestBody PreventReportConfigUpdateReqDTO updateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.updateReportConfig(currentUser.getUid(), updateReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigLogController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigLogController.java new file mode 100644 index 0000000..c10ce09 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportConfigLogController.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfigLog; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportConfigLog") +public class PreventReportConfigLogController extends BaseController { + + @Autowired + private ReportService reportService; + + /** + * 数据上报配置历史记录-查询 + */ + @PostMapping("/select/getConfigLogPage") + public ResultVO<PreventReportConfigLog> getReportConfigLogPage(Authentication authentication, @RequestBody PreventReportConfigLogQueryReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportConfigLogPage(currentUser.getUid(), queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportControlMeasureController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportControlMeasureController.java new file mode 100644 index 0000000..b3a17af --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportControlMeasureController.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportRiskControlMeasureReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportMeasure") +public class PreventReportControlMeasureController extends BaseController { + + + @Autowired + private ReportService reportService; + + /** + * 上报数据-管控措施-分页查询 + */ + @PostMapping("/select/getReportMeasurePage") + public ResultVO<PreventReportRiskControlMeasure> getReportMeasurePage(Authentication authentication, @RequestBody PreventReportRiskControlMeasureReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportMeasurePage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportDangerInfoController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportDangerInfoController.java new file mode 100644 index 0000000..3b4515b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportDangerInfoController.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportDangerInfo; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportDangerInfoReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportDangerInfo") +public class PreventReportDangerInfoController extends BaseController { + + @Autowired + private ReportService reportService; + + /** + * 上报数据-隐患信息-分页查询 + */ + @PostMapping("/select/getReportDangerInfoPage") + public ResultVO<PreventReportDangerInfo> getReportDangerInfoPage(Authentication authentication, @RequestBody PreventReportDangerInfoReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportDangerInfoPage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskAnaUnitController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskAnaUnitController.java new file mode 100644 index 0000000..3ef3585 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskAnaUnitController.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportRiskUnit") +public class PreventReportRiskAnaUnitController extends BaseController { + + @Autowired + private ReportService reportService; + /** + * 上报数据-风险分析单元-分页查询 + */ + @PostMapping("/select/getReportRiskUnitPage") + public ResultVO<PreventReportRiskAnaUnit> getReportRiskUnitPage(Authentication authentication, @RequestBody PreReportRiskUnitQueryReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportRiskUnitPage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskEventController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskEventController.java new file mode 100644 index 0000000..308aab0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventReportRiskEventController.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/reportRiskEvent") +public class PreventReportRiskEventController extends BaseController { + + @Autowired + private ReportService reportService; + + /** + * 上报数据-事件-分页查询 + */ + @PostMapping("/select/getReportEventPage") + public ResultVO<PreventReportRiskEvent> getReportEventPage(Authentication authentication, @RequestBody PreReportRiskEventQueryReqDTO queryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return reportService.getReportEventPage(currentUser, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskAnaUnitController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskAnaUnitController.java new file mode 100644 index 0000000..fc18d09 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskAnaUnitController.java @@ -0,0 +1,100 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("prevent/riskAnaUnit") +public class PreventRiskAnaUnitController extends BaseController { + + @Autowired + private RiskService riskService; + /** + * 风险分析单元-分页查询 + */ + @PostMapping("/select/getRiskUnitPage") + public ResultVO<PreventRiskAnaUnit> getRiskUnitPage(Authentication authentication, @RequestBody PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getRiskUnitPage(currentUser.getUid(), riskAnaUnitQueryReqDTO); + } + + /** + * 风险分析单元-新增 + */ + @PostMapping("/insert/saveRiskAnaUnit") + public ResultVO<PreventRiskAnaUnit> saveRiskAnaUnit(Authentication authentication, @RequestBody PreventRiskAnaUnitSaveReqDTO riskAnaUnitSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.saveRiskAnaUnit(currentUser.getUid(), riskAnaUnitSaveReqDTO); + } + + /** + * 风险分析单元-修改 + */ + @PostMapping("/update/updateRiskAnaUnit") + public ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitById(Authentication authentication, @RequestBody PreventRiskAnaUnitUpdateReqDTO riskAnaUnitUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskAnaUnitById(currentUser.getUid(), riskAnaUnitUpdateReqDTO); + } + + /** + * 风险分析单元-删除 + */ + @PostMapping("/delete/deleteRiskAnaUnit") + public ResultVO<PreventRiskAnaUnit> deleteRiskAnaUnitById(Authentication authentication, @RequestBody PreventRiskAnaUnitDeleteReqDTO riskAnaUnitDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteRiskAnaUnitById(currentUser.getUid(), riskAnaUnitDeleteReqDTO); + } + /** + * 风险分析单元-批量删除 + */ + @PostMapping("/delete/deleteBatchRiskAnaUnit") + public ResultVO<PreventRiskAnaUnit> deleteBatchRiskAnaUnit(Authentication authentication, @RequestBody DeleteBatchReqDTO deleteBatchReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteBatchRiskAnaUnit(currentUser, deleteBatchReqDTO); + } + + /** + * 安全风险分析单元-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskAnaUnitReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } + + /** + * 生产装置ID- 查询单元 + */ + @GetMapping("/select/getRiskAnaUnitByDeviceId") + public ResultVO<PreventRiskAnaUnit> getRiskAnaUnitByDeviceId(Authentication authentication, Long deviceId) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getRiskAnaUnitByDeviceId(currentUser.getUid(), deviceId); + } + + /** + * 风险分析单元-新增-参数查询 + */ +// @PostMapping("/select/getList") +// public ResultVO<PreventRiskAnaUnit> getDeviceList(Principal principal) { +// +// String userId =principal.getName(); +// return riskService.getDeviceList(Long.valueOf(userId)); +// } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskControlMeasureController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskControlMeasureController.java new file mode 100644 index 0000000..ffddfc0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskControlMeasureController.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/riskControlMeasure") +public class PreventRiskControlMeasureController extends BaseController { + + @Autowired + private RiskService riskService; + + /** + * 管控措施-分页查询 + */ + @PostMapping("/select/getRiskControlMeasurePage") + public ResultVO<PreventRiskControlMeasure> getRiskControlMeasurePage(Authentication authentication, @RequestBody PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getRiskControlMeasurePage(currentUser.getUid(), measureQueryReqDTO); + } + + /** + * 管控措施-新增 + */ + @PostMapping("/insert/saveRiskControlMeasure") + public ResultVO<PreventRiskControlMeasure> saveRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.saveRiskControlMeasure(currentUser.getUid(), measureSaveReqDTO); + } + + /** + * 管控措施-修改 + */ + @PostMapping("/update/updateRiskControlMeasure") + public ResultVO<PreventRiskControlMeasure> updateRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureUpdateReqDTO measureUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskControlMeasure(currentUser.getUid(), measureUpdateReqDTO); + } + + /** + * 管控措施-删除 + */ + @PostMapping("/delete/deleteRiskControlMeasure") + public ResultVO<PreventRiskControlMeasure> deleteRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureDeleteReqDTO measureDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteRiskControlMeasure(currentUser.getUid(), measureDeleteReqDTO); + } + /** + * 管控措施-批量删除 + */ + @PostMapping("/delete/deleteBatchRiskControlMeasure") + public ResultVO<PreventRiskControlMeasure> deleteBatchRiskControlMeasure(Authentication authentication, @RequestBody DeleteBatchReqDTO deleteBatchReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteBatchRiskControlMeasure(currentUser, deleteBatchReqDTO); + } + /** + * 管控措施- 管控措施模板 + */ + @PostMapping("/select/listMeasures") + public ResultVO<PreventRiskControlMeasure> listMeasures(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.listMeasures(currentUser.getUid()); + } + + /** + * 安全风险事件-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateMeasuresReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateMeasuresReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } + + /** + * 管控措施- 管控措施列表 + */ + @PostMapping("/select/listControlMeasure") + public ResultVO<PreventRiskControlMeasure> listControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.listControlMeasure(currentUser, listQueryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskEventController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskEventController.java new file mode 100644 index 0000000..5028ed8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/PreventRiskEventController.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.doublePrevention.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("prevent/riskEvent") +public class PreventRiskEventController extends BaseController { + + @Autowired + private RiskService riskService; + + /** + * 风险事件-分页查询 + */ + @PostMapping("/select/getRiskEventPage") + public ResultVO<PreventRiskEvent> getRiskEventPage(Authentication authentication, @RequestBody PreventRiskEventQueryReqDTO riskEventQueryReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getRiskEventPage(currentUser.getUid(), riskEventQueryReqDTO); + } + + /** + * 风险事件-新增 + */ + @PostMapping("/insert/saveRiskEvent") + public ResultVO<PreventRiskEvent> saveRiskEvent(Authentication authentication, @RequestBody PreventRiskEventSaveReqDTO riskEventSaveReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.saveRiskEvent(currentUser.getUid(), riskEventSaveReqDTO); + } + + /** + * 风险事件-修改 + */ + @PostMapping("/update/updateRiskEvent") + public ResultVO<PreventRiskEvent> updateRiskEvent(Authentication authentication, @RequestBody PreventRiskEventUpdateReqDTO riskEventUpdateReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskEvent(currentUser.getUid(), riskEventUpdateReqDTO); + } + + /** + * 风险事件-删除 + */ + @PostMapping("/delete/deleteRiskEvent") + public ResultVO<PreventRiskEvent> deleteRiskEvent(Authentication authentication, @RequestBody PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteRiskEvent(currentUser.getUid(), riskEventDeleteReqDTO); + } + /** + * 风险事件-批量删除 + */ + @PostMapping("/delete/deleteBatchRiskEvent") + public ResultVO<PreventRiskEvent> deleteBatchRiskEvent(Authentication authentication, @RequestBody DeleteBatchReqDTO deleteBatchReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.deleteBatchRiskEvent(currentUser, deleteBatchReqDTO); + } + + /** + * 风险事件-单元list + */ + @PostMapping("/select/listRiskUnits") + public ResultVO<PreventRiskEvent> listRiskUnits(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.listRiskUnits(currentUser.getUid()); + } + + /** + * 风险事件-事件list + */ + @PostMapping("/select/getListEvents") + public ResultVO<PreventRiskEvent> getListEvents(Authentication authentication) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.getListEvents(currentUser.getUid()); + } + + /** + * 安全风险事件-手工上报-配置 + */ + @PostMapping("/update/updateReport") + public ResultVO<PreventRiskAnaUnit> updateRiskEventReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + //获取用户信息 + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return riskService.updateRiskEventReport(currentUser.getUid(), preventHandReportConfigReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/StatisticsController.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/StatisticsController.java new file mode 100644 index 0000000..3d8a6db --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/StatisticsController.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.doublePrevention.controller; + + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionCompletedReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionTaskReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectorReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsPreventDangerPageReqDTO; +import com.gk.hotwork.doublePrevention.service.StatisticsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("prevent/riskEvent/statistics") +public class StatisticsController { + + @Autowired + private StatisticsService statisticsService; + + + /** + * @Description: 巡检人员统计 + */ + @RequestMapping(value = "/inspectors", method = RequestMethod.POST) + public ResultVO<List<Map>> inspectorsStatistics(@RequestBody StatisticsInspectorReqDTO reqDTO) { + List<Map> result = statisticsService.selectInspectorsStatistics(reqDTO); + return new ResultVO<>(ResultCodes.OK, result); + } + + + /** + * @Description: 巡检完成统计 + */ + @RequestMapping(value = "/inspection-completed", method = RequestMethod.POST) + public ResultVO<List<Map>> inspectionCompleted(@RequestBody StatisticsInspectionCompletedReqDTO reqDTO) { + List<Map> result = statisticsService.selectInspectionCompleted(reqDTO); + return new ResultVO<>(ResultCodes.OK, result); + } + + + /** + * @Description: 巡检任务统计 + */ + @RequestMapping(value = "/inspection-task", method = RequestMethod.POST) + public ResultVO<Map<String, List<Map>>> inspectionTask(@RequestBody StatisticsInspectionTaskReqDTO reqDTO) { + Map<String, List<Map>> result = statisticsService.selectInspectionTask(reqDTO); + return new ResultVO<>(ResultCodes.OK, result); + } + + + @RequestMapping(value = "/page", method = RequestMethod.POST) + public ResultVO selectPage(@RequestBody StatisticsPreventDangerPageReqDTO reqDTO) { + PageInfoExtension<Map> result = statisticsService.selectPreventDangerPage(reqDTO); + return new ResultVO<>(ResultCodes.OK, result); + } + + @RequestMapping(value = "/device/level",method = RequestMethod.POST) + public ResultVO deviceLevel() { + Map result= statisticsService.countDeviceEveryLevel(); + return new ResultVO<>(ResultCodes.OK, result); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/controller/TTst.java b/src/main/java/com/gk/hotwork/doublePrevention/controller/TTst.java new file mode 100644 index 0000000..5436a4a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/controller/TTst.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.doublePrevention.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/dob") +public class TTst { + + @RequestMapping(value = "/tt",method = RequestMethod.GET) + public Object ttt(){ + return "aaa"; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckContent.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckContent.java new file mode 100644 index 0000000..c7f8146 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckContent.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * (PreventDangerCheckContent)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:19 + */ +@TableName("prevent_danger_check_content") +public class PreventDangerCheckContent implements Serializable { + + /** + * 主键 + */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + + /** + * 关联风险管控措施id + */ + private Long controlMeasureId; + /** + * 关联风险管控措施uuid + */ + private String controlMeasureUuid; + /** + * 隐患排查内容 + */ + private String checkContent; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getControlMeasureId() { + return controlMeasureId; + } + + public void setControlMeasureId(Long controlMeasureId) { + this.controlMeasureId = controlMeasureId; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public String getControlMeasureUuid() { + return controlMeasureUuid; + } + + public void setControlMeasureUuid(String controlMeasureUuid) { + this.controlMeasureUuid = controlMeasureUuid; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTask.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTask.java new file mode 100644 index 0000000..e489918 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTask.java @@ -0,0 +1,386 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventDangerCheckTask)实体类 + */ +@TableName("prevent_danger_check_task") +public class PreventDangerCheckTask implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 排查结果:1-正常,2-存在隐患 + */ + private Byte result; + /** + * 排查任务状态:1-待排查,2-已完成,3-超时未排查,4-排查中 + */ + private Byte taskStatus; + /** + * 任务类型-1-周期性任务;2-日常任务 + */ + private Byte taskType; + /** + * 本次排查开始时间 + */ + private Date startTime; + /** + * 任务有效时间 + */ + private Date validTime; + /** + * 通知时间 + */ + private Date noticeTime; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 关联隐患排查 作业 id + */ + private Long checkWorkId; + /** + * 关联隐患 任务单元 id + */ + private Long checkTaskUnitId; + /** + * 执行人ID + */ + private Long execUserId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 关联隐患 作业 uuid + */ + private String checkWorkUuid; + /** + * 关联隐患 任务单元 Uuid + */ + private String checkTaskUnitUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 执行人Name + */ + private String execUserName; + /** + * 创建人 + */ + private String createUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 任务编码 + */ + private String taskCode; + + /** + * 排查结果说明 + */ + private String desc; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 执行部门uuID + */ + private String execDepUuid; + /** + * 任务认领状态:1-未认领,2-已认领 + */ + private Byte taskBelong; + /** + * 任务认领时间 + */ + private Date belongTime; + + public Date getBelongTime() { + return belongTime; + } + + public void setBelongTime(Date belongTime) { + this.belongTime = belongTime; + } + + public Byte getTaskBelong() { + return taskBelong; + } + + public void setTaskBelong(Byte taskBelong) { + this.taskBelong = taskBelong; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public String getExecDepUuid() { + return execDepUuid; + } + + public void setExecDepUuid(String execDepUuid) { + this.execDepUuid = execDepUuid; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Byte getTaskType() { + return taskType; + } + + public void setTaskType(Byte taskType) { + this.taskType = taskType; + } + + public Long getCheckTaskUnitId() { + return checkTaskUnitId; + } + + public void setCheckTaskUnitId(Long checkTaskUnitId) { + this.checkTaskUnitId = checkTaskUnitId; + } + + public String getCheckTaskUnitUuid() { + return checkTaskUnitUuid; + } + + public void setCheckTaskUnitUuid(String checkTaskUnitUuid) { + this.checkTaskUnitUuid = checkTaskUnitUuid; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public Byte getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(Byte taskStatus) { + this.taskStatus = taskStatus; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getValidTime() { + return validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public Date getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Date noticeTime) { + this.noticeTime = noticeTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getCheckWorkUuid() { + return checkWorkUuid; + } + + public void setCheckWorkUuid(String checkWorkUuid) { + this.checkWorkUuid = checkWorkUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public String getExecUserName() { + return execUserName; + } + + public void setExecUserName(String execUserName) { + this.execUserName = execUserName; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskRectifyDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskRectifyDO.java new file mode 100644 index 0000000..bf89988 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskRectifyDO.java @@ -0,0 +1,335 @@ +package com.gk.hotwork.doublePrevention.entity; + +import java.io.Serializable; +import java.util.Date; + + +public class PreventDangerCheckTaskRectifyDO implements Serializable { + + // manage 详表 + + private Long manageId; + + private String manageUuid; + + private Date registerTime; + + private Byte dangerLevel; + + private Byte dangerType; + + private Byte dangerSource; + + private Byte dangerStatus; + + private Long registantId; + + private Long produceDeviceId; + + private String dangerCode; + + private String registantName; + + private String dangerDesc; + + private String dangerReason; + + private Byte dangerResult; + + private Long depId; + + private Long riskUnitId; + + private Byte dangerReview; + + private String dangerCloseReason; + + // rectify 表 + + private Long rectifyId; + + private Byte rectifyType; + + private Date rectifyTime; + + private Long liablePersonId; + + private Date checkAcceptTime; + + private Long checkAcceptPersonId; + + private String liablePerson; + + private String checkAcceptPerson; + + private String rectifyDepId; + + private String rectifyDesc; + + private String cost; + + private String rectifyApplyTime; + + private String timeOutDesc; + + private String rectifyInfo; + + + + public Long getManageId() { + return manageId; + } + + public void setManageId(Long manageId) { + this.manageId = manageId; + } + + public String getManageUuid() { + return manageUuid; + } + + public void setManageUuid(String manageUuid) { + this.manageUuid = manageUuid; + } + + public Date getRegisterTime() { + return registerTime; + } + + public void setRegisterTime(Date registerTime) { + this.registerTime = registerTime; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Long getRegistantId() { + return registantId; + } + + public void setRegistantId(Long registantId) { + this.registantId = registantId; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public String getRegistantName() { + return registantName; + } + + public void setRegistantName(String registantName) { + this.registantName = registantName; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public String getDangerCloseReason() { + return dangerCloseReason; + } + + public void setDangerCloseReason(String dangerCloseReason) { + this.dangerCloseReason = dangerCloseReason; + } + + + public Long getRectifyId() { + return rectifyId; + } + + public void setRectifyId(Long rectifyId) { + this.rectifyId = rectifyId; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(String rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + public String getRectifyApplyTime() { + return rectifyApplyTime; + } + + public void setRectifyApplyTime(String rectifyApplyTime) { + this.rectifyApplyTime = rectifyApplyTime; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskUnit.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskUnit.java new file mode 100644 index 0000000..bf9a10d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckTaskUnit.java @@ -0,0 +1,150 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventDangerCheckTaskUnit)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:13 + */ +@TableName("prevent_danger_check_task_unit") +public class PreventDangerCheckTaskUnit implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 任务单元名称 + */ + private String taskUnitName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 备注或描述信息 + */ + private String note; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWork.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWork.java new file mode 100644 index 0000000..2c8f46b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWork.java @@ -0,0 +1,388 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventDangerCheckWork)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:11 + */ +@TableName("prevent_danger_check_work") +public class PreventDangerCheckWork implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 排查作业类型:1-周期作业;2-日常作业 + */ + private Byte checkWorkType; + /** + * 排查作业状态:1-开启,2-关闭,3-过期 + */ + private Byte checkWorkStatus; + /** + * 排查周期-数值 + */ + private Integer checkCycle; + /** + * 排查周期,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte checkCycleUnit; + /** + * 有效时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte validTimeUnit; + /** + * 通知时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte noticeTimeUnit; + /** + * 提前通知时间-数值 + */ + private Integer noticeTime; + /** + * 任务有效时间- 数值 + */ + private Integer validTime; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 作业调度起始时间 + */ + private Date firstStartTime; + /** + * 上一次排查开始时间 + */ + private Date lastCheckTime; + /** + * 预期下次开始时间 + */ + private Date nextCheckTime; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 执行部门 + */ + private String execDep; + /** + * 执行部门uuID + */ + private String execDepUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 作业名称 + */ + private String checkWorkName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 创建人 + */ + private Long createByUserId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 任务单元ID + */ + private Long taskUnitId; + /** + * 任务单元uuid + */ + private String taskUnitUuid; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getValidTime() { + return validTime; + } + + public void setValidTime(Integer validTime) { + this.validTime = validTime; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } + + public Byte getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(Byte checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public Integer getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Integer noticeTime) { + this.noticeTime = noticeTime; + } + + public Byte getValidTimeUnit() { + return validTimeUnit; + } + + public void setValidTimeUnit(Byte validTimeUnit) { + this.validTimeUnit = validTimeUnit; + } + + public Byte getNoticeTimeUnit() { + return noticeTimeUnit; + } + + public void setNoticeTimeUnit(Byte noticeTimeUnit) { + this.noticeTimeUnit = noticeTimeUnit; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public String getTaskUnitUuid() { + return taskUnitUuid; + } + + public void setTaskUnitUuid(String taskUnitUuid) { + this.taskUnitUuid = taskUnitUuid; + } + + public Date getFirstStartTime() { + return firstStartTime; + } + + public void setFirstStartTime(Date firstStartTime) { + this.firstStartTime = firstStartTime; + } + + public Date getLastCheckTime() { + return lastCheckTime; + } + + public void setLastCheckTime(Date lastCheckTime) { + this.lastCheckTime = lastCheckTime; + } + + public Date getNextCheckTime() { + return nextCheckTime; + } + + public void setNextCheckTime(Date nextCheckTime) { + this.nextCheckTime = nextCheckTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public String getExecDep() { + return execDep; + } + + public void setExecDep(String execDep) { + this.execDep = execDep; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getExecDepUuid() { + return execDepUuid; + } + + public void setExecDepUuid(String execDepUuid) { + this.execDepUuid = execDepUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWorkSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWorkSchedule.java new file mode 100644 index 0000000..34e1a4f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerCheckWorkSchedule.java @@ -0,0 +1,172 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventDangerCheckWorkSchedule)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:18 + */ +@TableName("prevent_danger_check_work_schedule") +public class PreventDangerCheckWorkSchedule implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Integer deleteStatus; + /** + * 上次调度时间 + */ + private Date lastScheduleTime; + /** + * 下次调度时间 + */ + private Date nextScheduleTime; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 关联排查作业id + */ + private Long checkWorkId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 关联排查作业uuid + */ + private String checkWorkUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Integer getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Integer deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getLastScheduleTime() { + return lastScheduleTime; + } + + public void setLastScheduleTime(Date lastScheduleTime) { + this.lastScheduleTime = lastScheduleTime; + } + + public Date getNextScheduleTime() { + return nextScheduleTime; + } + + public void setNextScheduleTime(Date nextScheduleTime) { + this.nextScheduleTime = nextScheduleTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getCheckWorkUuid() { + return checkWorkUuid; + } + + public void setCheckWorkUuid(String checkWorkUuid) { + this.checkWorkUuid = checkWorkUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerImage.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerImage.java new file mode 100644 index 0000000..8908cd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerImage.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("prevent_danger_image") +public class PreventDangerImage implements Serializable { + + + @TableId(type = IdType.AUTO) + private Long id; + + private String imagePath; + + private Long parentId; + + private Byte status; + + private Byte type; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getImagePath() { + return imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManage.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManage.java new file mode 100644 index 0000000..4e48d94 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManage.java @@ -0,0 +1,389 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventDangerManage)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:13 + */ +@TableName("prevent_danger_manage") +public class PreventDangerManage implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + + + //隐患编码 + private String serialCode; + + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 上报时间 + */ + private Date registerTime; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 隐患状态:0-整改中;1-待验收;2-延期整改;3-超期未整改;9-已验收 + */ + private Byte dangerStatus; + /** + * 上报人id + */ + private Long registantId; + /** + * 生产装置名称 + */ + private Long produceDeviceId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 关联隐患排查任务id + */ + private Long taskId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 隐患编号 + */ + private String dangerCode; + /** + * 上报人 + */ + private String registantName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 隐患情况描述 + */ + private String dangerDesc; + /** + * 隐患产生原因分析 + */ + private String dangerReason; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 隐患造成的结果:1-无;2-轻伤;3-重伤;4-死亡;5-设备损坏;6-系统停车 + */ + private Byte dangerResult; + /** + * 隐患所属部门id + */ + private Long depId; + /** + * 所属风险分析单元id + */ + private Long riskUnitId; + /** + * 隐患是否确认 1-处理中,2-已关闭 + */ + private Byte dangerReview; + /** + * 隐患关闭原因 + */ + private String dangerCloseReason; + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + public String getDangerCloseReason() { + return dangerCloseReason; + } + + public void setDangerCloseReason(String dangerCloseReason) { + this.dangerCloseReason = dangerCloseReason; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getRegisterTime() { + return registerTime; + } + + public void setRegisterTime(Date registerTime) { + this.registerTime = registerTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Long getRegistantId() { + return registantId; + } + + public void setRegistantId(Long registantId) { + this.registantId = registantId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getRegistantName() { + return registantName; + } + + public void setRegistantName(String registantName) { + this.registantName = registantName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManageTimeout.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManageTimeout.java new file mode 100644 index 0000000..4bd3a65 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerManageTimeout.java @@ -0,0 +1,71 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("prevent_danger_manage_timeout") +public class PreventDangerManageTimeout { + + /** + * 主键id + * */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * 隐患管理ID + */ + private Long dangerManagerId; + /** + * 隐患整改ID + */ + private Long dangerRectifyId; + /** + * 延期状态 1-未延期,2-延期 + */ + private Byte timeoutStatus; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Long getDangerRectifyId() { + return dangerRectifyId; + } + + public void setDangerRectifyId(Long dangerRectifyId) { + this.dangerRectifyId = dangerRectifyId; + } + + public Byte getTimeoutStatus() { + return timeoutStatus; + } + + public void setTimeoutStatus(Byte timeoutStatus) { + this.timeoutStatus = timeoutStatus; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerRectify.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerRectify.java new file mode 100644 index 0000000..ff00c31 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventDangerRectify.java @@ -0,0 +1,382 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * (PreventDangerRectify)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:14 + */ +@TableName("prevent_danger_rectify") +public class PreventDangerRectify implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改期限 + */ + private Date rectifyTime; + /** + * 验收时间 + */ + private Date checkAcceptTime; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 整改责任人id + */ + private Long liablePersonId; + /** + * 验收人id + */ + private Long checkAcceptPersonId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 整改责任人 + */ + private String liablePerson; + /** + * 验收人姓名 + */ + private String checkAcceptPerson; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 整改措施 + */ + private String rectifyDesc; + /** + * 验收情况说明 + */ + private String checkAcceptDesc; + + /** + * 隐患管理单Code + */ + private String dangerCode; + /** + * 隐患管理单id + */ + private Long dangerManagerId; + /** + * 隐患管理单uuid + */ + private String dangerManagerUuid; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 申请验收时间 + */ + private Date applyTime; + /** + * 延期原因 + */ + private String timeOutDesc; + /** + * 整改说明 + */ + private String rectifyInfo; + /** + * 隐患是否确认 1-处理中,2-已关闭 + */ + private Byte dangerReview; + + @TableField(exist = false) + private PreventDangerManage preventDangerManage; + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public String getDangerManagerUuid() { + return dangerManagerUuid; + } + + public void setDangerManagerUuid(String dangerManagerUuid) { + this.dangerManagerUuid = dangerManagerUuid; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public String getCheckAcceptDesc() { + return checkAcceptDesc; + } + + public void setCheckAcceptDesc(String checkAcceptDesc) { + this.checkAcceptDesc = checkAcceptDesc; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventProduceDevice.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventProduceDevice.java new file mode 100644 index 0000000..bb8eb65 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventProduceDevice.java @@ -0,0 +1,210 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventProduceDevice)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:17 + */ +@TableName("prevent_produce_device") +public class PreventProduceDevice implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 所属部门id + */ + private Long depId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 所属部门uuid + */ + private String depUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 所属部门名称 + */ + private String depName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + //uuid + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getDepUuid() { + return depUuid; + } + + public void setDepUuid(String depUuid) { + this.depUuid = depUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportBatch.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportBatch.java new file mode 100644 index 0000000..7a8f863 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportBatch.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_report_batch") +public class PreventReportBatch { + + /** + * 主键id + * */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * batchId 批次上报后,返回的id + * */ + private String batchId; + /** + * batchTime 批次上报后,接收到返回值的时间 + * */ + private Date reportTime; + /** + * 上报数据来源标识 + * */ + private String dataSource; + /** + * 上报数据类型 + * 1-风险分析单元 + * 2-风险事件 + * 3-风险管控措施 + * 4-任务配置 + * 5-任务记录 + * 6-隐患信息 + * */ + private Byte dataType; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getBatchId() { + return batchId; + } + + public void setBatchId(String batchId) { + this.batchId = batchId; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getDataType() { + return dataType; + } + + public void setDataType(Byte dataType) { + this.dataType = dataType; + } + + public String getDataSource() { + return dataSource; + } + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckRecordFromTask.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckRecordFromTask.java new file mode 100644 index 0000000..3c6eab3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckRecordFromTask.java @@ -0,0 +1,203 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_check_record_from_task") +public class PreventReportCheckRecordFromTask implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 隐患排查作业UUID + */ + private String checkTaskId; + /** + * 排 查 结 果 + */ + private String checkStatus; + /** + * 排查时间 + */ + private Date checkTime; + /** + * 修改人手机号 + */ + private String updateByMobile; + /** + * 创建人人手机号 + */ + private String createByMobile; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * taskId + */ + private Long taskId; + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(String checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public String getCheckStatus() { + return checkStatus; + } + + public void setCheckStatus(String checkStatus) { + this.checkStatus = checkStatus; + } + + public Date getCheckTime() { + return checkTime; + } + + public void setCheckTime(Date checkTime) { + this.checkTime = checkTime; + } + + public String getCreateByMobile() { + return createByMobile; + } + + public void setCreateByMobile(String createByMobile) { + this.createByMobile = createByMobile; + } + + public String getUpdateByMobile() { + return updateByMobile; + } + + public void setUpdateByMobile(String updateByMobile) { + this.updateByMobile = updateByMobile; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckTaskFromWork.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckTaskFromWork.java new file mode 100644 index 0000000..df8bf19 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportCheckTaskFromWork.java @@ -0,0 +1,191 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_check_task_from_work") +public class PreventReportCheckTaskFromWork implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 巡检周期 + */ + private Integer checkCycle; + /** + * 巡检周期单位 小时,日,月,年 + */ + private String checkCycleUnit; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * workId + */ + private Long workId; + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public String getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(String checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfig.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfig.java new file mode 100644 index 0000000..bfd2b84 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfig.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_report_config") +public class PreventReportConfig { + + /** + * 主键 + */ + private Integer id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 上报数据 + */ + private String reportData; + /** + * 上报数据名称 + */ + private String reportDataName; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public String getReportData() { + return reportData; + } + + public void setReportData(String reportData) { + this.reportData = reportData; + } + + public String getReportDataName() { + return reportDataName; + } + + public void setReportDataName(String reportDataName) { + this.reportDataName = reportDataName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfigLog.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfigLog.java new file mode 100644 index 0000000..dec0cda --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportConfigLog.java @@ -0,0 +1,97 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_report_config_log") +public class PreventReportConfigLog { + + /** + * 主键 + */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 上报数据 + */ + private String reportData; + /** + * 上报数据名称 + */ + private String reportDataName; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public String getReportData() { + return reportData; + } + + public void setReportData(String reportData) { + this.reportData = reportData; + } + + public String getReportDataName() { + return reportDataName; + } + + public void setReportDataName(String reportDataName) { + this.reportDataName = reportDataName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportDangerInfo.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportDangerInfo.java new file mode 100644 index 0000000..3c26c80 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportDangerInfo.java @@ -0,0 +1,383 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_danger_info") +public class PreventReportDangerInfo implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 管控措施 ID-->管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查记录 ID-->隐患排查任务UUID + */ + private String checkRecordId; + /** + * 隐患名称 + */ + private String dangerName; + /** + * 隐患等级 + */ + private String dangerLevel; + /** + * 隐患来源 + */ + private String dangerSrc; + /** + * 隐患治理类型 + */ + private String dangerManageType; + /** + * 隐患描述 + */ + private String dangerDesc; + /** + * 隐患产生原因 + */ + private String dangerReason; + /** + * 控制措施 + */ + private String controlMeasures; + /** + * 资金 + */ + private String cost; + /** + * 隐患治理期限 + */ + private Date dangerManageDeadline; + /** + * 隐患状态 + */ + private String dangerState; + /** + * 隐患类型 + */ + private String hazardDangerType; + /** + * 登记人姓名 + */ + private String registrant; + /** + * 登记时间 + */ + private Date registTime; + /** + * 整改责任人姓名 + */ + private String liablePerson; + /** + * 验收人 + */ + private String checkAcceptPerson; + /** + * 验收情况 + */ + private String checkAcceptComment; + /** + * 验收时间 + */ + private Date checkAcceptTime; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Long dangerManagerId; + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getCheckRecordId() { + return checkRecordId; + } + + public void setCheckRecordId(String checkRecordId) { + this.checkRecordId = checkRecordId; + } + + public String getDangerName() { + return dangerName; + } + + public void setDangerName(String dangerName) { + this.dangerName = dangerName; + } + + public String getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(String dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public String getDangerSrc() { + return dangerSrc; + } + + public void setDangerSrc(String dangerSrc) { + this.dangerSrc = dangerSrc; + } + + public String getDangerManageType() { + return dangerManageType; + } + + public void setDangerManageType(String dangerManageType) { + this.dangerManageType = dangerManageType; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public String getControlMeasures() { + return controlMeasures; + } + + public void setControlMeasures(String controlMeasures) { + this.controlMeasures = controlMeasures; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + public Date getDangerManageDeadline() { + return dangerManageDeadline; + } + + public void setDangerManageDeadline(Date dangerManageDeadline) { + this.dangerManageDeadline = dangerManageDeadline; + } + + public String getDangerState() { + return dangerState; + } + + public void setDangerState(String dangerState) { + this.dangerState = dangerState; + } + + public String getHazardDangerType() { + return hazardDangerType; + } + + public void setHazardDangerType(String hazardDangerType) { + this.hazardDangerType = hazardDangerType; + } + + public String getRegistrant() { + return registrant; + } + + public void setRegistrant(String registrant) { + this.registrant = registrant; + } + + public Date getRegistTime() { + return registTime; + } + + public void setRegistTime(Date registTime) { + this.registTime = registTime; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getCheckAcceptComment() { + return checkAcceptComment; + } + + public void setCheckAcceptComment(String checkAcceptComment) { + this.checkAcceptComment = checkAcceptComment; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskAnaUnit.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskAnaUnit.java new file mode 100644 index 0000000..d1b79a6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskAnaUnit.java @@ -0,0 +1,194 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_ana_unit") +public class PreventReportRiskAnaUnit implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 责任部门 + */ + private String hazardDep; + /** + * 责任人姓名 + */ + private String hazardLiablePerson; + + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * 风险分析单元id + */ + private Long riskUnitId; + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getHazardDep() { + return hazardDep; + } + + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep; + } + + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskControlMeasure.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskControlMeasure.java new file mode 100644 index 0000000..6cf24b9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskControlMeasure.java @@ -0,0 +1,229 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_control_measure") +public class PreventReportRiskControlMeasure implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 风险事件单元 UUID + */ + private String riskEventId; + /** + * 管控方式 + */ + private String dataSrc; + /** + * 管控措施描述 + */ + private String riskMeasureDesc; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 管控措施分类1 + */ + private String classify1; + /** + * 管控措施分类2 + */ + private String classify2; + /** + * 管控措施分类3 + */ + private String classify3; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * 管控措施id + */ + private Long riskMeasureId; + + public Long getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(Long riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(String riskEventId) { + this.riskEventId = riskEventId; + } + + public String getDataSrc() { + return dataSrc; + } + + public void setDataSrc(String dataSrc) { + this.dataSrc = dataSrc; + } + + public String getRiskMeasureDesc() { + return riskMeasureDesc; + } + + public void setRiskMeasureDesc(String riskMeasureDesc) { + this.riskMeasureDesc = riskMeasureDesc; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getClassify1() { + return classify1; + } + + public void setClassify1(String classify1) { + this.classify1 = classify1; + } + + public String getClassify2() { + return classify2; + } + + public void setClassify2(String classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskEvent.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskEvent.java new file mode 100644 index 0000000..edcd045 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventReportRiskEvent.java @@ -0,0 +1,167 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_event") +public class PreventReportRiskEvent implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 风险事件名称 + */ + private String riskEventName; + /** + * 关联风险分析单元UUID + */ + private String riskUnitId; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + /** + * 风险事件id + */ + private Long riskEventId; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(String riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskAnaUnit.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskAnaUnit.java new file mode 100644 index 0000000..d64370d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskAnaUnit.java @@ -0,0 +1,291 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventRiskAnaUnit)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:16 + */ +@TableName("prevent_risk_ana_unit") +public class PreventRiskAnaUnit implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 所属风险源id + */ + private Long produceDeviceId; + /** + * 责任部门id + */ + private Long liableDepId; + /** + * 责任人id + */ + private Long liablePersonId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 责任部门uuid + */ + private String liableDepUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 责任人uuid + */ + private String liablePersonUuid; + /** + * 所属生产装置uuid + */ + private String produceDeviceUuid; + /** + * 安全风险分析对象编码 + */ + private String riskCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 责任部门 + */ + private String liableDep; + /** + * 责任人姓名 + */ + private String liablePerson; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getLiableDepUuid() { + return liableDepUuid; + } + + public void setLiableDepUuid(String liableDepUuid) { + this.liableDepUuid = liableDepUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getLiablePersonUuid() { + return liablePersonUuid; + } + + public void setLiablePersonUuid(String liablePersonUuid) { + this.liablePersonUuid = liablePersonUuid; + } + + public String getProduceDeviceUuid() { + return produceDeviceUuid; + } + + public void setProduceDeviceUuid(String produceDeviceUuid) { + this.produceDeviceUuid = produceDeviceUuid; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getLiableDep() { + return liableDep; + } + + public void setLiableDep(String liableDep) { + this.liableDep = liableDep; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlMeasure.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlMeasure.java new file mode 100644 index 0000000..d4fbb30 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlMeasure.java @@ -0,0 +1,352 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_risk_control_measure") +public class PreventRiskControlMeasure { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件ID + */ + private Long riskEventId; + /** + * 关联隐患排查任务单元id + */ + private Long checkTaskUnitId; + /** + * 隐患排查作业id + */ + private Long checkWorkId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 关联隐患排查任务单元uuid + */ + private String checkTaskUnitUuid; + /** + * 关联风险事件uuid + */ + private String riskEventUuid; + /** + * 隐患排查作业uuid + */ + private String checkWorkUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 隐患排查任务id + */ + private Long checkTaskId; + /** + * 隐患排查任务uuid + */ + private String checkTaskUuid; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + + + + @TableField(exist = false) + private PreventDangerCheckContent preventDangerCheckContent; + + public PreventDangerCheckContent getPreventDangerCheckContent() { + return preventDangerCheckContent; + } + + public void setPreventDangerCheckContent(PreventDangerCheckContent preventDangerCheckContent) { + this.preventDangerCheckContent = preventDangerCheckContent; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(Long checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public String getCheckTaskUuid() { + return checkTaskUuid; + } + + public void setCheckTaskUuid(String checkTaskUuid) { + this.checkTaskUuid = checkTaskUuid; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public Long getCheckTaskUnitId() { + return checkTaskUnitId; + } + + public void setCheckTaskUnitId(Long checkTaskUnitId) { + this.checkTaskUnitId = checkTaskUnitId; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getCheckTaskUnitUuid() { + return checkTaskUnitUuid; + } + + public void setCheckTaskUnitUuid(String checkTaskUnitUuid) { + this.checkTaskUnitUuid = checkTaskUnitUuid; + } + + public String getRiskEventUuid() { + return riskEventUuid; + } + + public void setRiskEventUuid(String riskEventUuid) { + this.riskEventUuid = riskEventUuid; + } + + public String getCheckWorkUuid() { + return checkWorkUuid; + } + + public void setCheckWorkUuid(String checkWorkUuid) { + this.checkWorkUuid = checkWorkUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlTemplate.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlTemplate.java new file mode 100644 index 0000000..9a3f009 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskControlTemplate.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * (PreventRiskControlTemplate)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:17 + */ +@TableName("prevent_risk_control_template") +public class PreventRiskControlTemplate implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Integer deleteStatus; + /** + * 排序字段 + */ + private Integer orderIndex; + /** + * 父级别措施id + */ + private Long parentId; + /** + * + 风控措施名称 : + 管控措施分类1:1-工程技术,2-维护保养,3-操作行为,4-应急设施; + 管控措施分类2 子级目录: + 1、工程技术:1-工艺控制,2-关键设备/部件,3-安全附件,4-安全仪表,5-其他; + 2、维护保养:1-动设备,2-静设备; + 3、操作行为:1-人员资质,2-操作记录,3-交接班; + 4、应急设施:1-应急设施,2-个体防护,3-消防设施,4-应急预案 + */ + private String riskMeasureName; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Integer getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Integer deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getRiskMeasureName() { + return riskMeasureName; + } + + public void setRiskMeasureName(String riskMeasureName) { + this.riskMeasureName = riskMeasureName; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskEvent.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskEvent.java new file mode 100644 index 0000000..3f356ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskEvent.java @@ -0,0 +1,219 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventRiskEvent)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:16 + */ +@TableName("prevent_risk_event") +public class PreventRiskEvent implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 所属安全风险分析单元id + */ + private Long riskUnitId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 所属安全风险分析单元uuid + */ + private String riskUnitUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 可能照成的后果 + */ + private String eventResult; + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getRiskUnitUuid() { + return riskUnitUuid; + } + + public void setRiskUnitUuid(String riskUnitUuid) { + this.riskUnitUuid = riskUnitUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskMap.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskMap.java new file mode 100644 index 0000000..ffa9d74 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventRiskMap.java @@ -0,0 +1,148 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +/** + * (PreventRiskMapServiceImpl)实体类 + * + * @author makejava + * @since 2022-06-25 10:40:05 + */ +@TableName("prevent_risk_map") +public class PreventRiskMap implements Serializable { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 描述信息 + */ + private String descInfo; + /** + * 图片路径 + */ + private String imgPath; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getImgPath() { + return imgPath; + } + + public void setImgPath(String imgPath) { + this.imgPath = imgPath; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskAndMeasure.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskAndMeasure.java new file mode 100644 index 0000000..187b2f4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskAndMeasure.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("prevent_task_and_measure") +public class PreventTaskAndMeasure { + /** + * 主键id + * */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * 排查任务Id + * */ + private Long checkTaskId; + /** + * 管控措施Id + * */ + private Long controlMeasureId; + /** + * 管控措施对应的排查内容 + * */ + private String checkContent; + /** + * 删除标志 + * */ + private Byte deleteStatus; + /** + * 单项检查内容结果 + * */ + private Byte checkResult; + + public Byte getCheckResult() { + return checkResult; + } + + public void setCheckResult(Byte checkResult) { + this.checkResult = checkResult; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public Long getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(Long checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public Long getControlMeasureId() { + return controlMeasureId; + } + + public void setControlMeasureId(Long controlMeasureId) { + this.controlMeasureId = controlMeasureId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskUnitAndMeasure.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskUnitAndMeasure.java new file mode 100644 index 0000000..5959aa6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventTaskUnitAndMeasure.java @@ -0,0 +1,133 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_task_unit_and_measure") +public class PreventTaskUnitAndMeasure { + /** + * 主键id + * */ + @TableId(value = "id" , type = IdType.AUTO) + private Long id; + /** + * 排查任务Id + * */ + private Long taskUnitId; + /** + * 管控措施Id + * */ + private Long measureId; + /** + * 排查任务UUID + * */ + private String taskUnitUuid; + /** + * 管控措施UUID + * */ + private String measureUuid; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public String getTaskUnitUuid() { + return taskUnitUuid; + } + + public void setTaskUnitUuid(String taskUnitUuid) { + this.taskUnitUuid = taskUnitUuid; + } + + public String getMeasureUuid() { + return measureUuid; + } + + public void setMeasureUuid(String measureUuid) { + this.measureUuid = measureUuid; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventWorkAndMeasure.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventWorkAndMeasure.java new file mode 100644 index 0000000..a844ef9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/PreventWorkAndMeasure.java @@ -0,0 +1,67 @@ +package com.gk.hotwork.doublePrevention.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("prevent_work_and_measure") +public class PreventWorkAndMeasure { + /** + * id + * */ + private String id; + /** + * 排查任务Id + * */ + private String measureUuid; + /** + * WorkUuid + * */ + private String workUuid; + /** + * 排查任务Id + * */ + private Long measureId; + /** + * WorkUuid + * */ + private Long workId; + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMeasureUuid() { + return measureUuid; + } + + public void setMeasureUuid(String measureUuid) { + this.measureUuid = measureUuid; + } + + public String getWorkUuid() { + return workUuid; + } + + public void setWorkUuid(String workUuid) { + this.workUuid = workUuid; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/CheckResultReportDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/CheckResultReportDO.java new file mode 100644 index 0000000..8d86ff1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/CheckResultReportDO.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + + +public class CheckResultReportDO { + /** + * id + */ + private Long id; + /** + * 管控措施Id + */ + private Long controlMeasureId; + /** + * 处理结果, 1-正常;2-不正常 + */ + private Byte checkResult; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getControlMeasureId() { + return controlMeasureId; + } + + public void setControlMeasureId(Long controlMeasureId) { + this.controlMeasureId = controlMeasureId; + } + + public Byte getCheckResult() { + return checkResult; + } + + public void setCheckResult(Byte checkResult) { + this.checkResult = checkResult; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/MeasureAndContentDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/MeasureAndContentDO.java new file mode 100644 index 0000000..2a065bc --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/MeasureAndContentDO.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + + +import java.util.Date; + +public class MeasureAndContentDO { + /** + * 主键 + */ + private Long id; + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskAnaUnitDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskAnaUnitDO.java new file mode 100644 index 0000000..996ac84 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskAnaUnitDO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + +public class PreventRiskAnaUnitDO { + + /** + * 主键 + */ + private Long id; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureDO.java new file mode 100644 index 0000000..3b24ffe --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureDO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + +public class PreventRiskControlMeasureDO { + + /** + * 隐患排查内容 + */ + private String checkContent; + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureListDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureListDO.java new file mode 100644 index 0000000..5b2d274 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskControlMeasureListDO.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + + +public class PreventRiskControlMeasureListDO { + /** + * 主键 + */ + private Long id; + + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * */ + private String checkContent; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskEventDO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskEventDO.java new file mode 100644 index 0000000..704454b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/PreventRiskEventDO.java @@ -0,0 +1,161 @@ +package com.gk.hotwork.doublePrevention.entity.dto; + +import org.springframework.data.annotation.Transient; + +import java.util.Date; + +public class PreventRiskEventDO { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 所属安全风险分析单元id + */ + private Long riskUnitId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 所属安全风险分析单元uuid + */ + private String riskUnitUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + + @Transient + private PreventRiskAnaUnitDO riskAnaUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getRiskUnitUuid() { + return riskUnitUuid; + } + + public void setRiskUnitUuid(String riskUnitUuid) { + this.riskUnitUuid = riskUnitUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public PreventRiskAnaUnitDO getRiskAnaUnit() { + return riskAnaUnit; + } + + public void setRiskAnaUnit(PreventRiskAnaUnitDO riskAnaUnit) { + this.riskAnaUnit = riskAnaUnit; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/OwnRectifyPageQuery.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/OwnRectifyPageQuery.java new file mode 100644 index 0000000..168beb6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/OwnRectifyPageQuery.java @@ -0,0 +1,6 @@ +package com.gk.hotwork.doublePrevention.entity.dto.query; + +import java.io.Serializable; + +public class OwnRectifyPageQuery implements Serializable { +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/db/OwnRectifyPageDBQuery.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/db/OwnRectifyPageDBQuery.java new file mode 100644 index 0000000..641a66c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/query/db/OwnRectifyPageDBQuery.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.query.db; + +import java.io.Serializable; + +public class OwnRectifyPageDBQuery implements Serializable { + + + private Long currentUid; + + public Long getCurrentUid() { + return currentUid; + } + + public void setCurrentUid(Long currentUid) { + this.currentUid = currentUid; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckRecordFromTaskDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckRecordFromTaskDTO.java new file mode 100644 index 0000000..14868e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckRecordFromTaskDTO.java @@ -0,0 +1,156 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_check_record_from_task") +public class ReportCheckRecordFromTaskDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 隐患排查作业UUID + */ + private String checkTaskId; + /** + * 排 查 结 果 + */ + private String checkStatus; + /** + * 排查时间 + */ + private String checkTime; + /** + * 修改人手机号 + */ + private String updateByMobile; + /** + * 创建人人手机号 + */ + private String createByMobile; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(String checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public String getCheckStatus() { + return checkStatus; + } + + public void setCheckStatus(String checkStatus) { + this.checkStatus = checkStatus; + } + + public String getCheckTime() { + return checkTime; + } + + public void setCheckTime(String checkTime) { + this.checkTime = checkTime; + } + + public String getCreateByMobile() { + return createByMobile; + } + + public void setCreateByMobile(String createByMobile) { + this.createByMobile = createByMobile; + } + + public String getUpdateByMobile() { + return updateByMobile; + } + + public void setUpdateByMobile(String updateByMobile) { + this.updateByMobile = updateByMobile; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckTaskFromWorkDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckTaskFromWorkDTO.java new file mode 100644 index 0000000..15546c2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportCheckTaskFromWorkDTO.java @@ -0,0 +1,144 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_check_task_from_work") +public class ReportCheckTaskFromWorkDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 巡检周期 + */ + private Integer checkCycle; + /** + * 巡检周期单位 小时,日,月,年 + */ + private String checkCycleUnit; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public String getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(String checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportDangerInfoDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportDangerInfoDTO.java new file mode 100644 index 0000000..90c166c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportDangerInfoDTO.java @@ -0,0 +1,335 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_danger_info") +public class ReportDangerInfoDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 管控措施 ID-->管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查记录 ID-->隐患排查任务UUID + */ + private String checkRecordId; + /** + * 隐患名称 + */ + private String dangerName; + /** + * 隐患等级 + */ + private String dangerLevel; + /** + * 隐患来源 + */ + private String dangerSrc; + /** + * 隐患治理类型 + */ + private String dangerManageType; + /** + * 隐患描述 + */ + private String dangerDesc; + /** + * 隐患产生原因 + */ + private String dangerReason; + /** + * 控制措施 + */ + private String controlMeasures; + /** + * 资金 + */ + private String cost; + /** + * 隐患治理期限 + */ + private String dangerManageDeadline; + /** + * 隐患状态 + */ + private String dangerState; + /** + * 隐患类型 + */ + private String hazardDangerType; + /** + * 登记人姓名 + */ + private String registrant; + /** + * 登记时间 + */ + private String registTime; + /** + * 整改责任人姓名 + */ + private String liablePerson; + /** + * 验收人 + */ + private String checkAcceptPerson; + /** + * 验收情况 + */ + private String checkAcceptComment; + /** + * 验收时间 + */ + private String checkAcceptTime; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getCheckRecordId() { + return checkRecordId; + } + + public void setCheckRecordId(String checkRecordId) { + this.checkRecordId = checkRecordId; + } + + public String getDangerName() { + return dangerName; + } + + public void setDangerName(String dangerName) { + this.dangerName = dangerName; + } + + public String getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(String dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public String getDangerSrc() { + return dangerSrc; + } + + public void setDangerSrc(String dangerSrc) { + this.dangerSrc = dangerSrc; + } + + public String getDangerManageType() { + return dangerManageType; + } + + public void setDangerManageType(String dangerManageType) { + this.dangerManageType = dangerManageType; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public String getControlMeasures() { + return controlMeasures; + } + + public void setControlMeasures(String controlMeasures) { + this.controlMeasures = controlMeasures; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + public String getDangerManageDeadline() { + return dangerManageDeadline; + } + + public void setDangerManageDeadline(String dangerManageDeadline) { + this.dangerManageDeadline = dangerManageDeadline; + } + + public String getDangerState() { + return dangerState; + } + + public void setDangerState(String dangerState) { + this.dangerState = dangerState; + } + + public String getHazardDangerType() { + return hazardDangerType; + } + + public void setHazardDangerType(String hazardDangerType) { + this.hazardDangerType = hazardDangerType; + } + + public String getRegistrant() { + return registrant; + } + + public void setRegistrant(String registrant) { + this.registrant = registrant; + } + + public String getRegistTime() { + return registTime; + } + + public void setRegistTime(String registTime) { + this.registTime = registTime; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getCheckAcceptComment() { + return checkAcceptComment; + } + + public void setCheckAcceptComment(String checkAcceptComment) { + this.checkAcceptComment = checkAcceptComment; + } + + public String getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(String checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskAnaUnitDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskAnaUnitDTO.java new file mode 100644 index 0000000..0f90feb --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskAnaUnitDTO.java @@ -0,0 +1,146 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_ana_unit") +public class ReportRiskAnaUnitDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 责任部门 + */ + private String hazardDep; + /** + * 责任人姓名 + */ + private String hazardLiablePerson; + + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getHazardDep() { + return hazardDep; + } + + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep; + } + + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskControlMeasureDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskControlMeasureDTO.java new file mode 100644 index 0000000..fdb8d7a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskControlMeasureDTO.java @@ -0,0 +1,181 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_control_measure") +public class ReportRiskControlMeasureDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 风险事件单元 UUID + */ + private String riskEventId; + /** + * 管控方式 + */ + private String dataSrc; + /** + * 管控措施描述 + */ + private String riskMeasureDesc; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 管控措施分类1 + */ + private String classify1; + /** + * 管控措施分类2 + */ + private String classify2; + /** + * 管控措施分类3 + */ + private String classify3; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(String riskEventId) { + this.riskEventId = riskEventId; + } + + public String getDataSrc() { + return dataSrc; + } + + public void setDataSrc(String dataSrc) { + this.dataSrc = dataSrc; + } + + public String getRiskMeasureDesc() { + return riskMeasureDesc; + } + + public void setRiskMeasureDesc(String riskMeasureDesc) { + this.riskMeasureDesc = riskMeasureDesc; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getClassify1() { + return classify1; + } + + public void setClassify1(String classify1) { + this.classify1 = classify1; + } + + public String getClassify2() { + return classify2; + } + + public void setClassify2(String classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskEventDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskEventDTO.java new file mode 100644 index 0000000..d94930a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/HandlerDO/ReportRiskEventDTO.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.util.Date; + +@TableName("prevent_report_risk_event") +public class ReportRiskEventDTO implements Serializable { + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 风险事件名称 + */ + private String riskEventName; + /** + * 关联风险分析单元UUID + */ + private String riskUnitId; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private String createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private String updateDate; + /** + * 修改人 + */ + private String updateBy; + + + public String getDeleted() { + return deleted; + } + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(String riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getCreateDate() { + return createDate; + } + + public void setCreateDate(String createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(String updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultDTO.java new file mode 100644 index 0000000..d3777be --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultDTO.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report; + +public class ReportResultDTO { + + private String code; + + private String msg; + + private ReportResultObjDTO obj; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public ReportResultObjDTO getObj() { + return obj; + } + + public void setObj(ReportResultObjDTO obj) { + this.obj = obj; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultObjDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultObjDTO.java new file mode 100644 index 0000000..36a9519 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/ReportResultObjDTO.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report; + +public class ReportResultObjDTO { + + private String batchId; + + public String getBatchId() { + return batchId; + } + + public void setBatchId(String batchId) { + this.batchId = batchId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskEventQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskEventQueryReqDTO.java new file mode 100644 index 0000000..dceaa5f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskEventQueryReqDTO.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreReportRiskEventQueryReqDTO { + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskUnitQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskUnitQueryReqDTO.java new file mode 100644 index 0000000..e74948d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreReportRiskUnitQueryReqDTO.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreReportRiskUnitQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 责任部门 + */ + private String hazardDep; + /** + * 责任人姓名 + */ + private String hazardLiablePerson; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getHazardDep() { + return hazardDep; + } + + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep; + } + + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckRecordFromTaskReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckRecordFromTaskReqDTO.java new file mode 100644 index 0000000..3fe6f40 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckRecordFromTaskReqDTO.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreventReportCheckRecordFromTaskReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckTaskFromWorkReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckTaskFromWorkReqDTO.java new file mode 100644 index 0000000..89a8032 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportCheckTaskFromWorkReqDTO.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreventReportCheckTaskFromWorkReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportDangerInfoReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportDangerInfoReqDTO.java new file mode 100644 index 0000000..900712a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportDangerInfoReqDTO.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreventReportDangerInfoReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportRiskControlMeasureReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportRiskControlMeasureReqDTO.java new file mode 100644 index 0000000..bb04fb0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/req/PreventReportRiskControlMeasureReqDTO.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.req; + +public class PreventReportRiskControlMeasureReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskEventQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskEventQueryRespDTO.java new file mode 100644 index 0000000..2ec7f7c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskEventQueryRespDTO.java @@ -0,0 +1,169 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import java.util.Date; + +public class PreReportRiskEventQueryRespDTO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 风险事件名称 + */ + private String riskEventName; + /** + * 关联风险分析单元UUID + */ + private String riskUnitId; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(String riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskUnitQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskUnitQueryRespDTO.java new file mode 100644 index 0000000..1df0205 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreReportRiskUnitQueryRespDTO.java @@ -0,0 +1,174 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreReportRiskUnitQueryRespDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 责任部门 + */ + private String hazardDep; + /** + * 责任人姓名 + */ + private String hazardLiablePerson; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleted; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 上报时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getHazardDep() { + return hazardDep; + } + + public void setHazardDep(String hazardDep) { + this.hazardDep = hazardDep; + } + + public String getHazardLiablePerson() { + return hazardLiablePerson; + } + + public void setHazardLiablePerson(String hazardLiablePerson) { + this.hazardLiablePerson = hazardLiablePerson; + } + + public Byte getDeleted() { + return deleted; + } + + public void setDeleted(Byte deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckRecordFromTaskRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckRecordFromTaskRespDTO.java new file mode 100644 index 0000000..45ab15b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckRecordFromTaskRespDTO.java @@ -0,0 +1,206 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import java.util.Date; + +public class PreventReportCheckRecordFromTaskRespDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 隐患排查作业UUID + */ + private String checkTaskId; + /** + * 排 查 结 果 + */ + private String checkStatus; + /** + * 排查时间 + */ + private Date checkTime; + /** + * 修改人手机号 + */ + private String updateByMobile; + /** + * 创建人人手机号 + */ + private String createByMobile; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(String checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public String getCheckStatus() { + return checkStatus; + } + + public void setCheckStatus(String checkStatus) { + this.checkStatus = checkStatus; + } + + public Date getCheckTime() { + return checkTime; + } + + public void setCheckTime(Date checkTime) { + this.checkTime = checkTime; + } + + public String getCreateByMobile() { + return createByMobile; + } + + public void setCreateByMobile(String createByMobile) { + this.createByMobile = createByMobile; + } + + public String getUpdateByMobile() { + return updateByMobile; + } + + public void setUpdateByMobile(String updateByMobile) { + this.updateByMobile = updateByMobile; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckTaskFromWorkRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckTaskFromWorkRespDTO.java new file mode 100644 index 0000000..59ecc7a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportCheckTaskFromWorkRespDTO.java @@ -0,0 +1,195 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import java.util.Date; + +public class PreventReportCheckTaskFromWorkRespDTO { + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 巡检周期 + */ + private Integer checkCycle; + /** + * 巡检周期单位 小时,日,月,年 + */ + private String checkCycleUnit; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public String getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(String checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportDangerInfoRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportDangerInfoRespDTO.java new file mode 100644 index 0000000..b09172f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportDangerInfoRespDTO.java @@ -0,0 +1,385 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import java.util.Date; + +public class PreventReportDangerInfoRespDTO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 安全风险分析对象编码 + */ + private String hazardCode; + /** + * 管控措施 ID-->管控措施UUID + */ + private String riskMeasureId; + /** + * 隐患排查记录 ID-->隐患排查任务UUID + */ + private String checkRecordId; + /** + * 隐患名称 + */ + private String dangerName; + /** + * 隐患等级 + */ + private String dangerLevel; + /** + * 隐患来源 + */ + private String dangerSrc; + /** + * 隐患治理类型 + */ + private String dangerManageType; + /** + * 隐患描述 + */ + private String dangerDesc; + /** + * 隐患产生原因 + */ + private String dangerReason; + /** + * 控制措施 + */ + private String controlMeasures; + /** + * 资金 + */ + private String cost; + /** + * 隐患治理期限 + */ + private Date dangerManageDeadline; + /** + * 隐患状态 + */ + private String dangerState; + /** + * 隐患类型 + */ + private String hazardDangerType; + /** + * 登记人姓名 + */ + private String registrant; + /** + * 登记时间 + */ + private Date registTime; + /** + * 整改责任人姓名 + */ + private String liablePerson; + /** + * 验收人 + */ + private String checkAcceptPerson; + /** + * 验收情况 + */ + private String checkAcceptComment; + /** + * 验收时间 + */ + private Date checkAcceptTime; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getHazardCode() { + return hazardCode; + } + + public void setHazardCode(String hazardCode) { + this.hazardCode = hazardCode; + } + + public String getRiskMeasureId() { + return riskMeasureId; + } + + public void setRiskMeasureId(String riskMeasureId) { + this.riskMeasureId = riskMeasureId; + } + + public String getCheckRecordId() { + return checkRecordId; + } + + public void setCheckRecordId(String checkRecordId) { + this.checkRecordId = checkRecordId; + } + + public String getDangerName() { + return dangerName; + } + + public void setDangerName(String dangerName) { + this.dangerName = dangerName; + } + + public String getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(String dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public String getDangerSrc() { + return dangerSrc; + } + + public void setDangerSrc(String dangerSrc) { + this.dangerSrc = dangerSrc; + } + + public String getDangerManageType() { + return dangerManageType; + } + + public void setDangerManageType(String dangerManageType) { + this.dangerManageType = dangerManageType; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public String getControlMeasures() { + return controlMeasures; + } + + public void setControlMeasures(String controlMeasures) { + this.controlMeasures = controlMeasures; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + public Date getDangerManageDeadline() { + return dangerManageDeadline; + } + + public void setDangerManageDeadline(Date dangerManageDeadline) { + this.dangerManageDeadline = dangerManageDeadline; + } + + public String getDangerState() { + return dangerState; + } + + public void setDangerState(String dangerState) { + this.dangerState = dangerState; + } + + public String getHazardDangerType() { + return hazardDangerType; + } + + public void setHazardDangerType(String hazardDangerType) { + this.hazardDangerType = hazardDangerType; + } + + public String getRegistrant() { + return registrant; + } + + public void setRegistrant(String registrant) { + this.registrant = registrant; + } + + public Date getRegistTime() { + return registTime; + } + + public void setRegistTime(Date registTime) { + this.registTime = registTime; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getCheckAcceptComment() { + return checkAcceptComment; + } + + public void setCheckAcceptComment(String checkAcceptComment) { + this.checkAcceptComment = checkAcceptComment; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportRiskControlMeasureRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportRiskControlMeasureRespDTO.java new file mode 100644 index 0000000..8ff9321 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/resp/PreventReportRiskControlMeasureRespDTO.java @@ -0,0 +1,231 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.resp; + +import java.util.Date; + +public class PreventReportRiskControlMeasureRespDTO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private String id; + /** + * 公司编码 + */ + private String companyCode; + /** + * 删除标志:0-有效,1-删除 + */ + private String deleted; + /** + * 创建时间 + */ + private Date createDate; + /** + * 创建人 + */ + private String createBy; + /** + * 最后修改时间 + */ + private Date updateDate; + /** + * 修改人 + */ + private String updateBy; + /** + * 风险事件单元 UUID + */ + private String riskEventId; + /** + * 管控方式 + */ + private String dataSrc; + /** + * 管控措施描述 + */ + private String riskMeasureDesc; + /** + * 隐患排查内容 + */ + private String troubleshootContent; + /** + * 管控措施分类1 + */ + private String classify1; + /** + * 管控措施分类2 + */ + private String classify2; + /** + * 管控措施分类3 + */ + private String classify3; + /** + * 上报时间 + */ + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 数据来源 1-本系统排查任务产生;2-同步数据 + */ + private Byte dataSource; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getUpdateDate() { + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(String riskEventId) { + this.riskEventId = riskEventId; + } + + public String getDataSrc() { + return dataSrc; + } + + public void setDataSrc(String dataSrc) { + this.dataSrc = dataSrc; + } + + public String getRiskMeasureDesc() { + return riskMeasureDesc; + } + + public void setRiskMeasureDesc(String riskMeasureDesc) { + this.riskMeasureDesc = riskMeasureDesc; + } + + public String getTroubleshootContent() { + return troubleshootContent; + } + + public void setTroubleshootContent(String troubleshootContent) { + this.troubleshootContent = troubleshootContent; + } + + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + public String getClassify1() { + return classify1; + } + + public void setClassify1(String classify1) { + this.classify1 = classify1; + } + + public String getClassify2() { + return classify2; + } + + public void setClassify2(String classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getDataSource() { + return dataSource; + } + + public void setDataSource(Byte dataSource) { + this.dataSource = dataSource; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/vo/ReportLogVO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/vo/ReportLogVO.java new file mode 100644 index 0000000..57d0008 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/report/vo/ReportLogVO.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.doublePrevention.entity.dto.report.vo; + +import java.util.Date; + +public class ReportLogVO { + + private Date reportTime; + + private Long eid; + + private Long depId; + + private String respText; + + private String respBatchId; + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/DeleteBatchReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/DeleteBatchReqDTO.java new file mode 100644 index 0000000..2db8a29 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/DeleteBatchReqDTO.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import java.util.List; + +public class DeleteBatchReqDTO { + + /** + * 主键 + */ + private List<Long> idList; + + public List<Long> getIdList() { + return idList; + } + + public void setIdList(List<Long> idList) { + this.idList = idList; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventCloseDangerReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventCloseDangerReqDTO.java new file mode 100644 index 0000000..37658d6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventCloseDangerReqDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventCloseDangerReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 关闭隐患原因 + */ + private String dangerCloseReason; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDangerCloseReason() { + return dangerCloseReason; + } + + public void setDangerCloseReason(String dangerCloseReason) { + this.dangerCloseReason = dangerCloseReason; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckContentQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckContentQueryReqDTO.java new file mode 100644 index 0000000..dbfa1a6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckContentQueryReqDTO.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckContentQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskDeleteReqDTO.java new file mode 100644 index 0000000..c25e0b3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskDeleteReqDTO.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckTaskDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskQueryReqDTO.java new file mode 100644 index 0000000..194851b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskQueryReqDTO.java @@ -0,0 +1,72 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckTaskQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 排查结果:1-正常,2-存在隐患,3-未排查;4-其他 + */ + private Byte result; + /** + * 排查任务状态:1-待排查,2-排查中,3-已完成,4-超时未排查 + */ + private Byte taskStatus; + /** + * 任务类型:1-手动添加,2-自动调度 + */ + private Byte taskType; + /** + * 部门id + */ + private Long execDepId; + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public Byte getTaskType() { + return taskType; + } + + public void setTaskType(Byte taskType) { + this.taskType = taskType; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public Byte getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(Byte taskStatus) { + this.taskStatus = taskStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskSaveReqDTO.java new file mode 100644 index 0000000..992695c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskSaveReqDTO.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerCheckTaskSaveReqDTO { + + /** + * 排查开始时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date startTime; + /** + * 任务有效时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date validTime; + /** + * 执行人id + */ + private Long execUserId; + /** + * 任务单元id + */ + private Long taskUnitId; + + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getValidTime() { + return validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitDeleteReqDTO.java new file mode 100644 index 0000000..950f846 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitDeleteReqDTO.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckTaskUnitDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitQueryReqDTO.java new file mode 100644 index 0000000..1cb03a1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitQueryReqDTO.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckTaskUnitQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 任务单元Id + */ + private Long taskUnitId; + /** + * 任务单元Id + */ + private String taskUnitName; + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitSaveReqDTO.java new file mode 100644 index 0000000..0d70944 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitSaveReqDTO.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import java.util.List; + +public class PreventDangerCheckTaskUnitSaveReqDTO { + + /** + * 任务单元名称 + */ + private String taskUnitName; + /** + * 备注或描述信息 + */ + private String note; + /** + * 管控措施id + */ + private List<Long> measureList; + + public List<Long> getMeasureList() { + return measureList; + } + + public void setMeasureList(List<Long> measureList) { + this.measureList = measureList; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitUpdateReqDTO.java new file mode 100644 index 0000000..ef5982d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUnitUpdateReqDTO.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import java.util.List; + +public class PreventDangerCheckTaskUnitUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 管控措施Id + */ + private List<Long> measureList; + /** + * 任务单元名称 + */ + private String taskUnitName; + /** + * 备注或描述信息 + */ + private String note; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public List<Long> getMeasureList() { + return measureList; + } + + public void setMeasureList(List<Long> measureList) { + this.measureList = measureList; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUpdateReqDTO.java new file mode 100644 index 0000000..36da74a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckTaskUpdateReqDTO.java @@ -0,0 +1,45 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.gk.hotwork.doublePrevention.entity.dto.CheckResultReportDO; + +import java.util.List; + +public class PreventDangerCheckTaskUpdateReqDTO { + /** + * 主键 + */ + private Long id; + /** + * 执行人Id + */ + private Long execUserId; + /** + * 数据上报结果 + */ + private List<CheckResultReportDO> checkResults; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public List<CheckResultReportDO> getCheckResults() { + return checkResults; + } + + public void setCheckResults(List<CheckResultReportDO> checkResults) { + this.checkResults = checkResults; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkContentQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkContentQueryReqDTO.java new file mode 100644 index 0000000..baaeaa9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkContentQueryReqDTO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckWorkContentQueryReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkDeleteReqDTO.java new file mode 100644 index 0000000..c4e1323 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkDeleteReqDTO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckWorkDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkQueryReqDTO.java new file mode 100644 index 0000000..69f4ae9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkQueryReqDTO.java @@ -0,0 +1,85 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerCheckWorkQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 排查作业类型:1-日常作业;2-周期作业 + */ + private Byte checkWorkType; + /** + * 排查作业状态:1-开启,2-关闭,3-过期 + */ + private Byte checkWorkStatus; + /** + * 作业Id + */ + private Long checkWorkId; + /** + * 作业名称 + */ + private String checkWorkName; + /** + * 部门id + */ + private Long execDepId; + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkSaveReqDTO.java new file mode 100644 index 0000000..df17fca --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkSaveReqDTO.java @@ -0,0 +1,142 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerCheckWorkSaveReqDTO { + + /** + * 排查作业类型:1-日常作业;2-周期作业 + */ + private Byte checkWorkType; + /** + * 排查周期-数值 + */ + private Integer checkCycle; + /** + * 时间单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte checkCycleUnit; + /** + * 有效时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte validTimeUnit; + /** + * 通知时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte noticeTimeUnit; + /** + * 提前通知时间-数值 + */ + private Integer noticeTime; + /** + * 作业有效期-数值 + */ + private Integer validTime; + /** + * 作业开启后首次排查任务开始时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date firstStartTime; + /** + * 检查作业名称 + */ + private String checkWorkName; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 任务单元Id + */ + private Long taskUnitId; + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public Byte getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(Byte checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Integer getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Integer noticeTime) { + this.noticeTime = noticeTime; + } + + public Byte getValidTimeUnit() { + return validTimeUnit; + } + + public void setValidTimeUnit(Byte validTimeUnit) { + this.validTimeUnit = validTimeUnit; + } + + public Byte getNoticeTimeUnit() { + return noticeTimeUnit; + } + + public void setNoticeTimeUnit(Byte noticeTimeUnit) { + this.noticeTimeUnit = noticeTimeUnit; + } + + public Integer getValidTime() { + return validTime; + } + + public void setValidTime(Integer validTime) { + this.validTime = validTime; + } + + public Date getFirstStartTime() { + return firstStartTime; + } + + public void setFirstStartTime(Date firstStartTime) { + this.firstStartTime = firstStartTime; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkUpdateReqDTO.java new file mode 100644 index 0000000..3bf70c7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerCheckWorkUpdateReqDTO.java @@ -0,0 +1,167 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerCheckWorkUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 排查作业类型:1-日常作业;2-周期作业 + */ + private Byte checkWorkType; + /** + * 排查作业状态:1-开启,2-关闭 + */ + private Byte checkWorkStatus; + /** + * 排查周期-数值 + */ + private Integer checkCycle; + /** + * 时间单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte checkCycleUnit; + /** + * 有效时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte validTimeUnit; + /** + * 通知时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte noticeTimeUnit; + /** + * 作业调度有效期 + */ + private Integer validTime; + /** + * 作业名称 + */ + private String checkWorkName; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 任务单元Id + */ + private Long taskUnitId; + /** + * 提前通知时间-数值 + */ + private Integer noticeTime; + /** + * 作业开启后首次排查任务开始时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date firstStartTime; + + + public Integer getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Integer noticeTime) { + this.noticeTime = noticeTime; + } + + public Date getFirstStartTime() { + return firstStartTime; + } + + public void setFirstStartTime(Date firstStartTime) { + this.firstStartTime = firstStartTime; + } + + public Byte getValidTimeUnit() { + return validTimeUnit; + } + + public void setValidTimeUnit(Byte validTimeUnit) { + this.validTimeUnit = validTimeUnit; + } + + public Byte getNoticeTimeUnit() { + return noticeTimeUnit; + } + + public void setNoticeTimeUnit(Byte noticeTimeUnit) { + this.noticeTimeUnit = noticeTimeUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public Byte getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(Byte checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Integer getValidTime() { + return validTime; + } + + public void setValidTime(Integer validTime) { + this.validTime = validTime; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageDeleteReqDTO.java new file mode 100644 index 0000000..9db99c8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageDeleteReqDTO.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerManageDeleteReqDTO { + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageQueryReqDTO.java new file mode 100644 index 0000000..7fe718c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageQueryReqDTO.java @@ -0,0 +1,133 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerManageQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 隐患状态:1-整改中;2-待验收;3-已验收 + */ + private Byte dangerStatus; + /** + * 部门id + */ + private Long depId; + //隐患编码 + private String serialCode; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date endTime; +// /** +// * 隐患名称 +// */ +// private String dangerCode; +// /** +// * 上报人 +// */ +// private Long registantId; + + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageSaveReqDTO.java new file mode 100644 index 0000000..b6717a7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageSaveReqDTO.java @@ -0,0 +1,220 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public class PreventDangerManageSaveReqDTO { + //隐患单 + /** + * 隐患情况描述 + */ + private String dangerDesc; + /** + * 隐患所属部门id + */ + private Long depId; + /** + * 生产装置Id + */ + private Long produceDeviceId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患产生原因分析 + */ + private String dangerReason; + /** + * 隐患可能后果:1-无;2-轻伤;3-重伤;4-死亡;5-设备损坏;6-系统停车 + */ + private Byte dangerResult; + + //整改单 + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改责任人 + */ + private Long liablePersonId; + /** + * 整改期限 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date rectifyTime; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 整改内容 + */ + private String rectifyDesc; + /** + * 施工单位 + */ + private Long rectifyDepId; + /** + * 隐患名称 + */ + private String dangerCode; + + private List<String> reportImages; + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public List<String> getReportImages() { + return reportImages; + } + + public void setReportImages(List<String> reportImages) { + this.reportImages = reportImages; + } + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageUpdateReqDTO.java new file mode 100644 index 0000000..85d782e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerManageUpdateReqDTO.java @@ -0,0 +1,229 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public class PreventDangerManageUpdateReqDTO { + /** + * 主键 + */ + private Long id; + + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 生产装置ID + */ + private Long produceDeviceId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 隐患情况描述 + */ + private String dangerDesc; + /** + * 隐患产生原因分析 + */ + private String dangerReason; + /** + * 隐患所属部门id + */ + private Long depId; + /** + * 隐患可能后果:1-无;2-轻伤;3-重伤;4-死亡;5-设备损坏;6-系统停车 + */ + private Byte dangerResult; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 整改期限 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date rectifyTime; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改措施 + */ + private String rectifyDesc; + /** + * 整改责任人 + */ + private Long liablePersonId; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 隐患名称 + */ + private String dangerCode; + + + private List<String> reportImages; + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public List<String> getReportImages() { + return reportImages; + } + + public void setReportImages(List<String> reportImages) { + this.reportImages = reportImages; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyDeleteReqDTO.java new file mode 100644 index 0000000..0c5c6c7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyDeleteReqDTO.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventDangerRectifyDeleteReqDTO { + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyQueryReqDTO.java new file mode 100644 index 0000000..57bcf26 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyQueryReqDTO.java @@ -0,0 +1,102 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerRectifyQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 整改状态 + */ + private Byte dangerStatus; + + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date endTime; + + //隐患编码 + private String serialCode; + + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifySaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifySaveReqDTO.java new file mode 100644 index 0000000..1efaaba --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifySaveReqDTO.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerRectifySaveReqDTO { + + /** + * 隐患管理单Id + */ + private Long dangerManagerId; + /** + * 整改期限 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date rectifyTime; + /** + * 整改责任人 + */ + private Long liablePersonId; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改内容说明 + */ + private String rectifyDesc; + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyUpdateReqDTO.java new file mode 100644 index 0000000..2904fc6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerRectifyUpdateReqDTO.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.math.BigDecimal; +import java.util.Date; + +public class PreventDangerRectifyUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 隐患管理单Id + */ + private Long dangerManagerId; + /** + * 整改期限 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date rectifyTime; + /** + * 整改责任人 + */ + private Long liablePersonId; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改内容说明 + */ + private String rectifyDesc; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 延期原因 + */ + private String timeOutDesc; + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerReportRectifyReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerReportRectifyReqDTO.java new file mode 100644 index 0000000..51ce462 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventDangerReportRectifyReqDTO.java @@ -0,0 +1,118 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; +import java.util.List; + + +public class PreventDangerReportRectifyReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 主键 + */ + private Long dangerManagerId; + /** + * 验收人ID + */ + private Long checkAcceptPersonId; + /** + * 施工单位 + */ + private String constructionUnit; + /** + * 验收情况说明 + */ + private String checkAcceptDesc; + /** + * 整改情况说明 + */ + private String rectifyInfo; + /** + * 整改时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date applyTime; + + + private List<String> rectifyImages; + + private List<String> acceptImages; + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public String getConstructionUnit() { + return constructionUnit; + } + + public void setConstructionUnit(String constructionUnit) { + this.constructionUnit = constructionUnit; + } + + public String getCheckAcceptDesc() { + return checkAcceptDesc; + } + + public void setCheckAcceptDesc(String checkAcceptDesc) { + this.checkAcceptDesc = checkAcceptDesc; + } + + public List<String> getRectifyImages() { + return rectifyImages; + } + + public void setRectifyImages(List<String> rectifyImages) { + this.rectifyImages = rectifyImages; + } + + public List<String> getAcceptImages() { + return acceptImages; + } + + public void setAcceptImages(List<String> acceptImages) { + this.acceptImages = acceptImages; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventHandReportConfigReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventHandReportConfigReqDTO.java new file mode 100644 index 0000000..94e1960 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventHandReportConfigReqDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventHandReportConfigReqDTO { + /** + * 主键 + */ + private Long id; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceDeleteReqDTO.java new file mode 100644 index 0000000..66b322f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceDeleteReqDTO.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventProduceDeviceDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceQueryReqDTO.java new file mode 100644 index 0000000..cbb20f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceQueryReqDTO.java @@ -0,0 +1,91 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + + +public class PreventProduceDeviceQueryReqDTO { + + + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; +// /** +// * 所属部门名称 +// */ +// private String depName; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 风险源所在区域 + */ + private String location; + /** + * 所属部门名称 + */ + private Long depId; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceSaveReqDTO.java new file mode 100644 index 0000000..ff7e144 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceSaveReqDTO.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventProduceDeviceSaveReqDTO { + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 所属部门id + */ + private Long depId; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + +// public Long getUserId() { +// return userId; +// } +// +// public void setUserId(Long userId) { +// this.userId = userId; +// } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceUpdateReqDTO.java new file mode 100644 index 0000000..020a606 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventProduceDeviceUpdateReqDTO.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventProduceDeviceUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; + /** + * 所属部门Id + */ + private Long depId; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRectifyOverQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRectifyOverQueryReqDTO.java new file mode 100644 index 0000000..b0472ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRectifyOverQueryReqDTO.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRectifyOverQueryReqDTO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 隐患状态:1-整改中;2-待验收;3-已验收 + */ + private Byte dangerStatus; + /** + * 用户id + */ + private Long checkAcceptPersonid; + /** + * 整改类型 + */ + private Byte rectifyType; + /** + * 整改类型 + */ + private Long depId; + /** + * 标志位,前端不用 + */ + private Byte status; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + public Long getCheckAcceptPersonid() { + return checkAcceptPersonid; + } + + public void setCheckAcceptPersonid(Long checkAcceptPersonid) { + this.checkAcceptPersonid = checkAcceptPersonid; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigLogQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigLogQueryReqDTO.java new file mode 100644 index 0000000..eb926fe --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigLogQueryReqDTO.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_report_config") +public class PreventReportConfigLogQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 开始时间 + */ + private Date startTime; + /** + * 结束时间 + */ + private Date endTime; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigUpdateReqDTO.java new file mode 100644 index 0000000..85950d8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventReportConfigUpdateReqDTO.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.baomidou.mybatisplus.annotation.TableName; + +@TableName("prevent_report_config") +public class PreventReportConfigUpdateReqDTO { + + /** + * 主键 + */ + private Integer id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitDeleteReqDTO.java new file mode 100644 index 0000000..8af54ce --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitDeleteReqDTO.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskAnaUnitDeleteReqDTO { + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitQueryReqDTO.java new file mode 100644 index 0000000..4dcb2df --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitQueryReqDTO.java @@ -0,0 +1,61 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventRiskAnaUnitQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 责任部门 + */ + private Long liableDepId; + /** + * 责任人姓名 + */ + private Long liablePersonId; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitSaveReqDTO.java new file mode 100644 index 0000000..553aac6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitSaveReqDTO.java @@ -0,0 +1,66 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventRiskAnaUnitSaveReqDTO { + + /** + * 安全风险分析对象编码 + */ + private String riskCode; + /** + * 安全风险分析单元 + */ + private String riskUnitName; + /** + * 责任部门Id + */ + private Long liableDepId; + /** + * 责任人Id + */ + private Long liablePersonId; + /** + * 生产设施Id + */ + private Long produceDeviceId; + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitUpdateReqDTO.java new file mode 100644 index 0000000..9182081 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskAnaUnitUpdateReqDTO.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskAnaUnitUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + + /** + * 安全风险分析对象编码 + */ + private String riskCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 责任部门Id + */ + private Long liableDepId; + /** + * 责任人Id + */ + private Long liablePersonId; + /** + * 生产设施Id + */ + private Long produceDeviceId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureDeleteReqDTO.java new file mode 100644 index 0000000..3ac8618 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureDeleteReqDTO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskControlMeasureDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureListQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureListQueryReqDTO.java new file mode 100644 index 0000000..430082a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureListQueryReqDTO.java @@ -0,0 +1,75 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskControlMeasureListQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 自定义 + */ + private Byte classify2; + + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureQueryReqDTO.java new file mode 100644 index 0000000..fdbc203 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureQueryReqDTO.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskControlMeasureQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 风险事件名称 + */ + private Long riskEventId; + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java new file mode 100644 index 0000000..8585533 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureSaveReqDTO.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskControlMeasureSaveReqDTO { + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件Id + */ + private Long riskEventId; + /** + * 风险管控措施描述 + */ + private String measureDesc; + + /** + * 隐患排查内容 + */ + private String checkContent; + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java new file mode 100644 index 0000000..43aca6c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskControlMeasureUpdateReqDTO.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskControlMeasureUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件名称 + */ + private Long riskEventId; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 隐患排查内容 + */ + private String checkContent; + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventDeleteReqDTO.java new file mode 100644 index 0000000..dfb59d1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventDeleteReqDTO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskEventDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventQueryReqDTO.java new file mode 100644 index 0000000..c46dfe9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventQueryReqDTO.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventRiskEventQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 所属安全风险分析单元Id + */ + private Long riskUnitId; + /** + * 安全风险事件名称 + */ + private String riskEventName; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventSaveReqDTO.java new file mode 100644 index 0000000..0bd264d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventSaveReqDTO.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskEventSaveReqDTO { + + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 安全风险结果 + */ + private String eventResult; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventUpdateReqDTO.java new file mode 100644 index 0000000..083e8e9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskEventUpdateReqDTO.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskEventUpdateReqDTO { + /** + * 主键 + */ + private Long id; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 安全风险结果 + */ + private String eventResult; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapDeleteReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapDeleteReqDTO.java new file mode 100644 index 0000000..e48781a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapDeleteReqDTO.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskMapDeleteReqDTO { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapQueryReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapQueryReqDTO.java new file mode 100644 index 0000000..7e9e15d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapQueryReqDTO.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +public class PreventRiskMapQueryReqDTO { + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapSaveReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapSaveReqDTO.java new file mode 100644 index 0000000..6559de2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapSaveReqDTO.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + + +import org.springframework.web.multipart.MultipartFile; + +public class PreventRiskMapSaveReqDTO { + + + /** + * 描述信息 + */ + private String descInfo; + /** + * 图片 + */ + private MultipartFile img; + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public MultipartFile getImg() { + return img; + } + + public void setImg(MultipartFile img) { + this.img = img; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapUpdateReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapUpdateReqDTO.java new file mode 100644 index 0000000..d84a0e7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/PreventRiskMapUpdateReqDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +public class PreventRiskMapUpdateReqDTO { + + /** + * 主键 + */ + private Long id; + /** + * 描述信息 + */ + private String descInfo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionCompletedReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionCompletedReqDTO.java new file mode 100644 index 0000000..62aed9b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionCompletedReqDTO.java @@ -0,0 +1,57 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +public class StatisticsInspectionCompletedReqDTO implements Serializable { + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + private Long depId; + + private Byte status; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionTaskReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionTaskReqDTO.java new file mode 100644 index 0000000..db8d5ce --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectionTaskReqDTO.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; + +public class StatisticsInspectionTaskReqDTO implements Serializable { + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + private Long depId; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectorReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectorReqDTO.java new file mode 100644 index 0000000..89f957a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsInspectorReqDTO.java @@ -0,0 +1,47 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +public class StatisticsInspectorReqDTO implements Serializable { + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endTime; + + private Long depId; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsPreventDangerPageReqDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsPreventDangerPageReqDTO.java new file mode 100644 index 0000000..c4ab2f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/req/StatisticsPreventDangerPageReqDTO.java @@ -0,0 +1,110 @@ +package com.gk.hotwork.doublePrevention.entity.dto.req; + +import java.io.Serializable; + +public class StatisticsPreventDangerPageReqDTO implements Serializable { + + + private Integer pageIndex; + + private Integer pageSize; + + private String serialCode; + + private Byte dangerLevel; + + private Byte dangerType; + + private Byte dangerSource; + + private Byte dangerStatus; + + // 验收人 + private String acceptPersonName; + + // 整改责任人 + private String liablePersonName; + + // 上报人 + private String registantName; + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public String getAcceptPersonName() { + return acceptPersonName; + } + + public void setAcceptPersonName(String acceptPersonName) { + this.acceptPersonName = acceptPersonName; + } + + public String getLiablePersonName() { + return liablePersonName; + } + + public void setLiablePersonName(String liablePersonName) { + this.liablePersonName = liablePersonName; + } + + public String getRegistantName() { + return registantName; + } + + public void setRegistantName(String registantName) { + this.registantName = registantName; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskQueryRespDTO.java new file mode 100644 index 0000000..dc489c9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskQueryRespDTO.java @@ -0,0 +1,350 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; +import java.util.List; + +public class PreventDangerCheckTaskQueryRespDTO { + + + private Integer pageIndex; + + private Integer pageSize; + /** + * 主键 + */ + private Long id; + /** + * 排查结果:1-正常,2-存在隐患,3-未排查;4-其他 + */ + private Byte result; + /** + * 排查任务状态:1-待排查,2-排查中,3-已完成,4-超时未排查 + */ + private Byte taskStatus; + /** + * 本次排查开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + /** + * 任务有效时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date validTime; + /** + * 通知时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date noticeTime; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 关联隐患排查作业id + */ + private Long checkWorkId; + /** + * 执行人Name + */ + private String execUserName; + /** + * 创建人 + */ + private String createUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 任务名称 + */ + private String taskCode; + /** + * 任务类型:1-手动添加,2-自动调度 + */ + private Byte taskType; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 执行人ID + */ + private Long execUserId; + /** + * 排查结果说明 + */ + private String desc; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 执行部门 + */ + private String execDep; + /** + * 任务认领状态:1-未认领,2-已认领 + */ + private Byte taskBelong; + /** + * 任务认领时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date belongTime; + /** + * 隐患排查内容 + */ + private List<PreventrCheckContentRespDTO> checkContent; + + public Date getBelongTime() { + return belongTime; + } + + public void setBelongTime(Date belongTime) { + this.belongTime = belongTime; + } + + public String getExecDep() { + return execDep; + } + + public void setExecDep(String execDep) { + this.execDep = execDep; + } + + public Byte getTaskBelong() { + return taskBelong; + } + + public void setTaskBelong(Byte taskBelong) { + this.taskBelong = taskBelong; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public Date getValidTime() { + return validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Byte getTaskType() { + return taskType; + } + + public void setTaskType(Byte taskType) { + this.taskType = taskType; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Date noticeTime) { + this.noticeTime = noticeTime; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public List<PreventrCheckContentRespDTO> getCheckContent() { + return checkContent; + } + + public void setCheckContent(List<PreventrCheckContentRespDTO> checkContent) { + this.checkContent = checkContent; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public Byte getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(Byte taskStatus) { + this.taskStatus = taskStatus; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } + + public String getExecUserName() { + return execUserName; + } + + public void setExecUserName(String execUserName) { + this.execUserName = execUserName; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskRectifyRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskRectifyRespDTO.java new file mode 100644 index 0000000..ab73432 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskRectifyRespDTO.java @@ -0,0 +1,342 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import java.io.Serializable; +import java.util.Date; + + +public class PreventDangerCheckTaskRectifyRespDTO implements Serializable { + + + // manage 详表 + + private Long manageId; + + private String manageUuid; + + private Date registerTime; + + private Byte dangerLevel; + + private Byte dangerType; + + private Byte dangerSource; + + private Byte dangerStatus; + + private Long registantId; + + private Long produceDeviceId; + + private String dangerCode; + + private String registantName; + + private String dangerDesc; + + private String dangerReason; + + private Byte dangerResult; + + private Long depId; + + private Long riskUnitId; + + private Byte dangerReview; + + private String dangerCloseReason; + + + private Long rectifyId; + + private Byte rectifyType; + + private Date rectifyTime; + + private Long liablePersonId; + + private Date checkAcceptTime; + + private Long checkAcceptPersonId; + + private String liablePerson; + + private String checkAcceptPerson; + + private String rectifyDepId; + + private String rectifyDesc; + + private String cost; + + private String rectifyApplyTime; + + private String timeOutDesc; + + private String rectifyInfo; + + + + public Long getManageId() { + return manageId; + } + + public void setManageId(Long manageId) { + this.manageId = manageId; + } + + public String getManageUuid() { + return manageUuid; + } + + public void setManageUuid(String manageUuid) { + this.manageUuid = manageUuid; + } + + public Date getRegisterTime() { + return registerTime; + } + + public void setRegisterTime(Date registerTime) { + this.registerTime = registerTime; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Long getRegistantId() { + return registantId; + } + + public void setRegistantId(Long registantId) { + this.registantId = registantId; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public String getRegistantName() { + return registantName; + } + + public void setRegistantName(String registantName) { + this.registantName = registantName; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public String getDangerCloseReason() { + return dangerCloseReason; + } + + public void setDangerCloseReason(String dangerCloseReason) { + this.dangerCloseReason = dangerCloseReason; + } + + + public Long getRectifyId() { + return rectifyId; + } + + public void setRectifyId(Long rectifyId) { + this.rectifyId = rectifyId; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(String rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public String getCost() { + return cost; + } + + public void setCost(String cost) { + this.cost = cost; + } + + public String getRectifyApplyTime() { + return rectifyApplyTime; + } + + public void setRectifyApplyTime(String rectifyApplyTime) { + this.rectifyApplyTime = rectifyApplyTime; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitListQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitListQueryRespDTO.java new file mode 100644 index 0000000..18c9a2f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitListQueryRespDTO.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventDangerCheckTaskUnitListQueryRespDTO { + + + /** + * 主键 + */ + private Long id; + /** + * 作业名称 + */ + private String taskUnitName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitQueryRespDTO.java new file mode 100644 index 0000000..75d6c9a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckTaskUnitQueryRespDTO.java @@ -0,0 +1,129 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; +import java.util.List; + +public class PreventDangerCheckTaskUnitQueryRespDTO { + + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 任务单元名称 + */ + private String taskUnitName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 备注或描述信息 + */ + private String note; + /** + * 措施list + */ + private List<PreventRiskControlMeasureDataRespDTO> measureList; + + public List<PreventRiskControlMeasureDataRespDTO> getMeasureList() { + return measureList; + } + + public void setMeasureList(List<PreventRiskControlMeasureDataRespDTO> measureList) { + this.measureList = measureList; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkListQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkListQueryRespDTO.java new file mode 100644 index 0000000..b8360c6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkListQueryRespDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventDangerCheckWorkListQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 作业名称 + */ + private String checkWorkName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkQueryRespDTO.java new file mode 100644 index 0000000..836635f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerCheckWorkQueryRespDTO.java @@ -0,0 +1,373 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventDangerCheckWorkQueryRespDTO { + + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + /** + * 排查作业类型:1-日常作业;2-周期作业 + */ + private Byte checkWorkType; + /** + * 排查作业状态:1-开启,2-关闭,3-过期 + */ + private Byte checkWorkStatus; + /** + * 排查周期-数值 + */ + private Integer checkCycle; + /** + * 时间单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte checkCycleUnit; + /** + * 有效时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte validTimeUnit; + /** + * 通知时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte noticeTimeUnit; + /** + * 提前通知时间 + */ + private Integer noticeTime; + /** + * 每次调度后,任务有效时间-数值 + */ + private Integer validTime; + /** + * 作业开启后首次排查任务开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date firstStartTime; + /** + * 最后一次排查开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date lastCheckTime; + /** + * 预期下次开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date nextCheckTime; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 作业名称 + */ + private String checkWorkName; + /** + * 执行人Name + */ + private String execUserName; + /** + * 执行部门ID + */ + private Long execDepId; + + + /** + * 任务单元id + */ + private Long taskUnitId; + /** + * 任务单元id + */ + private String taskUnitName; + /** + * 部门 + */ + private Long depId; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 执行部门 + */ + private String execDep; + + public String getExecDep() { + return execDep; + } + + public void setExecDep(String execDep) { + this.execDep = execDep; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getValidTimeUnit() { + return validTimeUnit; + } + + public void setValidTimeUnit(Byte validTimeUnit) { + this.validTimeUnit = validTimeUnit; + } + + public Byte getNoticeTimeUnit() { + return noticeTimeUnit; + } + + public void setNoticeTimeUnit(Byte noticeTimeUnit) { + this.noticeTimeUnit = noticeTimeUnit; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public Byte getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(Byte checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Integer getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Integer noticeTime) { + this.noticeTime = noticeTime; + } + + public Integer getValidTime() { + return validTime; + } + + public void setValidTime(Integer validTime) { + this.validTime = validTime; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getFirstStartTime() { + return firstStartTime; + } + + public void setFirstStartTime(Date firstStartTime) { + this.firstStartTime = firstStartTime; + } + + public Date getLastCheckTime() { + return lastCheckTime; + } + + public void setLastCheckTime(Date lastCheckTime) { + this.lastCheckTime = lastCheckTime; + } + + public Date getNextCheckTime() { + return nextCheckTime; + } + + public void setNextCheckTime(Date nextCheckTime) { + this.nextCheckTime = nextCheckTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } + + public String getExecUserName() { + return execUserName; + } + + public void setExecUserName(String execUserName) { + this.execUserName = execUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageImageRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageImageRespDTO.java new file mode 100644 index 0000000..f1e24c6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageImageRespDTO.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import java.io.Serializable; + +public class PreventDangerManageImageRespDTO implements Serializable { + + private Long id; + + private String imagePath; + + private Long parentId; + + private Byte type; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getImagePath() { + return imagePath; + } + + public void setImagePath(String imagePath) { + this.imagePath = imagePath; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageListQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageListQueryRespDTO.java new file mode 100644 index 0000000..390c24f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageListQueryRespDTO.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventDangerManageListQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 隐患编号 + */ + private String dangerCode; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageQueryRespDTO.java new file mode 100644 index 0000000..dedb9ce --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerManageQueryRespDTO.java @@ -0,0 +1,587 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public class PreventDangerManageQueryRespDTO { + + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + //隐患编码 + private String serialCode; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 隐患状态:1-整改中;2-待验收;3-已验收 + */ + private Byte dangerStatus; + /** + * 生产装置ID + */ + private Long produceDeviceId; + /** + * 生产装置名称 + */ + private String produceDeviceName; + /** + * 生产装置ID + */ + private Long riskUnitId; + /** + * 生产装置名称 + */ + private String riskUnitName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 隐患情况描述 + */ + private String dangerDesc; + /** + * 隐患产生原因分析 + */ + private String dangerReason; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 隐患是否确认 1-处理中,2-已关闭 + */ + private Byte dangerReview; + /** + * 部门id + */ + private Long depId; + /** + * 部门名称 + */ + private String depName; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 整改期限 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date rectifyTime; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改措施 + */ + private String rectifyDesc; + /** + * 整改责任人Id + */ + private Long liablePersonId; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 隐患造成的结果:1-无;2-轻伤;3-重伤;4-死亡;5-设备损坏;6-系统停车 + */ + private Byte dangerResult; + /** + * 隐患名称 + */ + private String dangerCode; + /** + * 延期状态 1-未延期,2-延期 + */ + private Byte timeoutStatus; + + public Byte getTimeoutStatus() { + return timeoutStatus; + } + + public void setTimeoutStatus(Byte timeoutStatus) { + this.timeoutStatus = timeoutStatus; + } + /** + * 验收人姓名 + */ + private Long checkAcceptPersonId; + + + + /** + * 主键 + */ + private Long rectifyId; + //整改表大部分信息 + /** + * 验收时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date checkAcceptTime; + /** + * 整改责任人 + */ + private String liablePerson; + /** + * 验收人姓名 + */ + private String checkAcceptPerson; + /** + * 整改部门ID + */ + private String rectifyDepName; + /** + * 验收情况说明 + */ + private String checkAcceptDesc; + /** + * 申请验收时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date applyTime; + /** + * 延期原因 + */ + private String timeOutDesc; + /** + * 整改说明 + */ + private String rectifyInfo; + + + private List<String> reportImages; + + private List<String> rectifyImages; + + private List<String> acceptImages; + + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Long getRectifyId() { + return rectifyId; + } + + public void setRectifyId(Long rectifyId) { + this.rectifyId = rectifyId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getRectifyDepName() { + return rectifyDepName; + } + + public void setRectifyDepName(String rectifyDepName) { + this.rectifyDepName = rectifyDepName; + } + + public String getCheckAcceptDesc() { + return checkAcceptDesc; + } + + public void setCheckAcceptDesc(String checkAcceptDesc) { + this.checkAcceptDesc = checkAcceptDesc; + } + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public List<String> getReportImages() { + return reportImages; + } + + public void setReportImages(List<String> reportImages) { + this.reportImages = reportImages; + } + + public List<String> getRectifyImages() { + return rectifyImages; + } + + public void setRectifyImages(List<String> rectifyImages) { + this.rectifyImages = rectifyImages; + } + + public List<String> getAcceptImages() { + return acceptImages; + } + + public void setAcceptImages(List<String> acceptImages) { + this.acceptImages = acceptImages; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerRectifyQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerRectifyQueryRespDTO.java new file mode 100644 index 0000000..3ced049 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventDangerRectifyQueryRespDTO.java @@ -0,0 +1,460 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +public class PreventDangerRectifyQueryRespDTO { + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改期限 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date rectifyTime; + /** + * 验收时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date checkAcceptTime; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 整改责任人 + */ + private String liablePerson; + /** + * 验收人姓名 + */ + private String checkAcceptPerson; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 整改部门ID + */ + private String rectifyDepName; + /** + * 整改说明 + */ + private String rectifyDesc; + /** + * 验收情况说明 + */ + private String checkAcceptDesc; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 申请验收时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date applyTime; + /** + * 延期原因 + */ + private String timeOutDesc; + /** + * 隐患管理ID + */ + private Long dangerManagerId; + /** + * 隐患是否确认 1-处理中,2-已关闭 + */ + private Byte dangerReview; + /** + * 隐患状态:0-整改中;1-待验收;2-延期整改;3-超期未整改;9-已验收 + */ + private Byte dangerStatus; + /** + * 整改责任人id + */ + private Long liablePersonId; + /** + * 验收人id + */ + private Long checkAcceptPersonId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 整改说明 + */ + private String rectifyInfo; + //隐患编码 + private String serialCode; + /** + * 延期状态 1-未延期,2-延期 + */ + private Byte timeoutStatus; + /** + * 隐患名称 + */ + private String dangerCode; + + private List<String> reportImages; + + private List<String> rectifyImages; + + private List<String> acceptImages; + + + public String getSerialCode() { + return serialCode; + } + + public void setSerialCode(String serialCode) { + this.serialCode = serialCode; + } + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Byte getTimeoutStatus() { + return timeoutStatus; + } + + public void setTimeoutStatus(Byte timeoutStatus) { + this.timeoutStatus = timeoutStatus; + } + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public String getRectifyDepName() { + return rectifyDepName; + } + + public void setRectifyDepName(String rectifyDepName) { + this.rectifyDepName = rectifyDepName; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public String getCheckAcceptDesc() { + return checkAcceptDesc; + } + + public void setCheckAcceptDesc(String checkAcceptDesc) { + this.checkAcceptDesc = checkAcceptDesc; + } + + public List<String> getReportImages() { + return reportImages; + } + + public void setReportImages(List<String> reportImages) { + this.reportImages = reportImages; + } + + public List<String> getRectifyImages() { + return rectifyImages; + } + + public void setRectifyImages(List<String> rectifyImages) { + this.rectifyImages = rectifyImages; + } + + public List<String> getAcceptImages() { + return acceptImages; + } + + public void setAcceptImages(List<String> acceptImages) { + this.acceptImages = acceptImages; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventGetAnaUnitByDeviceIdRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventGetAnaUnitByDeviceIdRespDTO.java new file mode 100644 index 0000000..b0b135a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventGetAnaUnitByDeviceIdRespDTO.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventGetAnaUnitByDeviceIdRespDTO { + /** + * 风险分析单元 + */ + private Long id; + /** + * 设备ID + */ + private Long produceDeviceId; + /** + * 设备名称 + */ + private String produceDeviceName; + /** + * 名称 + */ + private String riskUnitName; + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceListsQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceListsQueryRespDTO.java new file mode 100644 index 0000000..3eeb63c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceListsQueryRespDTO.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventProduceDeviceListsQueryRespDTO { + /** + * 主键 + * */ + private Long id; + /** + * 生产装置名称 + * */ + private String produceDeviceName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceQueryRespDTO.java new file mode 100644 index 0000000..ef5f224 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceQueryRespDTO.java @@ -0,0 +1,163 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventProduceDeviceQueryRespDTO { + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 所属部门名称 + */ + private String depName; + /** + * 所属部门id + */ + private Long depId; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceSaveRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceSaveRespDTO.java new file mode 100644 index 0000000..4bbfc0d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventProduceDeviceSaveRespDTO.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventProduceDeviceSaveRespDTO { + + /** + * id + */ + private Long id; + + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 所属部门名称 + */ + private String depName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigLogQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigLogQueryRespDTO.java new file mode 100644 index 0000000..50a3c78 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigLogQueryRespDTO.java @@ -0,0 +1,116 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +@TableName("prevent_report_config") +public class PreventReportConfigLogQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 上报数据名称 + */ + private String reportDataName; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 修改内容 + */ + private String updateInfo; + + private Integer pageIndex; + + private Integer pageSize; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public String getReportDataName() { + return reportDataName; + } + + public void setReportDataName(String reportDataName) { + this.reportDataName = reportDataName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getUpdateInfo() { + return updateInfo; + } + + public void setUpdateInfo(String updateInfo) { + this.updateInfo = updateInfo; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigQueryRespDTO.java new file mode 100644 index 0000000..f1241da --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventReportConfigQueryRespDTO.java @@ -0,0 +1,84 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +@TableName("prevent_report_config") +public class PreventReportConfigQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 上报数据名称 + */ + private String reportDataName; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public String getReportDataName() { + return reportDataName; + } + + public void setReportDataName(String reportDataName) { + this.reportDataName = reportDataName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskAnaUnitQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskAnaUnitQueryRespDTO.java new file mode 100644 index 0000000..b537b75 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskAnaUnitQueryRespDTO.java @@ -0,0 +1,249 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventRiskAnaUnitQueryRespDTO { + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 安全风险分析对象编码 + */ + private String riskCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 生产设备名称 + */ + private String produceDeviceName; + /** + * 生产设备Id + */ + private Long produceDeviceId; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 责任部门 + */ + private String liableDep; + /** + * 责任部门Id + */ + private Long liableDepId; + /** + * 责任人姓名 + */ + private String liablePerson; + /** + * 责任人Id + */ + private Long liablePersonId; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLiableDep() { + return liableDep; + } + + public void setLiableDep(String liableDep) { + this.liableDep = liableDep; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureDataRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureDataRespDTO.java new file mode 100644 index 0000000..286f5ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureDataRespDTO.java @@ -0,0 +1,277 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_risk_control_measure") +public class PreventRiskControlMeasureDataRespDTO { + /** + * 主键 + */ + private Long id; + + private String uuid; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 创建时间 + */ + private Date gmtCreate; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件ID + */ + private Long riskEventId; + /** + * 关联隐患排查任务单元id + */ + private Long checkTaskUnitId; + /** + * 隐患排查作业id + */ + private Long checkWorkId; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 关联隐患排查任务单元uuid + */ + private String checkTaskUnitUuid; + /** + * 关联风险事件uuid + */ + private String riskEventUuid; + /** + * 隐患排查作业uuid + */ + private String checkWorkUuid; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 隐患排查内容 + */ + private String checkContent; + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public Long getCheckTaskUnitId() { + return checkTaskUnitId; + } + + public void setCheckTaskUnitId(Long checkTaskUnitId) { + this.checkTaskUnitId = checkTaskUnitId; + } + + public Long getCheckWorkId() { + return checkWorkId; + } + + public void setCheckWorkId(Long checkWorkId) { + this.checkWorkId = checkWorkId; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getCheckTaskUnitUuid() { + return checkTaskUnitUuid; + } + + public void setCheckTaskUnitUuid(String checkTaskUnitUuid) { + this.checkTaskUnitUuid = checkTaskUnitUuid; + } + + public String getRiskEventUuid() { + return riskEventUuid; + } + + public void setRiskEventUuid(String riskEventUuid) { + this.riskEventUuid = riskEventUuid; + } + + public String getCheckWorkUuid() { + return checkWorkUuid; + } + + public void setCheckWorkUuid(String checkWorkUuid) { + this.checkWorkUuid = checkWorkUuid; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureListRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureListRespDTO.java new file mode 100644 index 0000000..cafb18a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureListRespDTO.java @@ -0,0 +1,106 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventRiskControlMeasureListRespDTO { + /** + * 主键 + */ + private Long id; + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 隐患排查内容 + */ + private String checkContent; + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureQueryRespDTO.java new file mode 100644 index 0000000..0e73d95 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskControlMeasureQueryRespDTO.java @@ -0,0 +1,268 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventRiskControlMeasureQueryRespDTO { + + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件id + */ + private Long riskEventId; + /** + * 风险事件名称 + */ + private String riskEventName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 创建人 + */ + private String createByUserName; + /** + * 风险管控措施描述 + */ + private String measureDesc; + + /** + * 隐患排查内容 + */ + private String checkContent; + /** + * 上报时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventListRiskUnitsRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventListRiskUnitsRespDTO.java new file mode 100644 index 0000000..a5db1fd --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventListRiskUnitsRespDTO.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventRiskEventListRiskUnitsRespDTO { + /** + * 主键 + */ + private Long id; + + /** + * 安全风险单元名称 + */ + private String riskUnitName; + /** + * 生产装置ID + * */ + private Long produceDeviceId; + /** + * 生产装置名称 + * */ + private String produceDeviceName; + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventQueryRespDTO.java new file mode 100644 index 0000000..942992c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventQueryRespDTO.java @@ -0,0 +1,200 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventRiskEventQueryRespDTO { + + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 安全风险单元Id + */ + private Long riskUnitId; + /** + * 安全风险单元名称 + */ + private String riskUnitName; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reportTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 可能照成的后果 + */ + private String eventResult; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventsListQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventsListQueryRespDTO.java new file mode 100644 index 0000000..745e9a5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskEventsListQueryRespDTO.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventRiskEventsListQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 可能照成的后果 + */ + private String eventResult; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMapQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMapQueryRespDTO.java new file mode 100644 index 0000000..cfba71d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMapQueryRespDTO.java @@ -0,0 +1,138 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class PreventRiskMapQueryRespDTO { + /** + * 主键 + */ + private Long id; + + private Integer pageIndex; + + private Integer pageSize; + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtCreate; + /** + * 最后修改时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date gmtModitify; + /** + * 企业id + */ + private Long enterpriseId; + /** + * 企业uuid + */ + private String enterpriseUuid; + /** + * 描述信息 + */ + private String descInfo; + /** + * 图片路径 + */ + private String img; + /** + * 创建人 + */ + private String createByUserName; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + this.pageIndex = pageIndex; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(Long enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public String getEnterpriseUuid() { + return enterpriseUuid; + } + + public void setEnterpriseUuid(String enterpriseUuid) { + this.enterpriseUuid = enterpriseUuid; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getImg() { + return img; + } + + public void setImg(String img) { + this.img = img; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMeasureTemplatesListQueryRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMeasureTemplatesListQueryRespDTO.java new file mode 100644 index 0000000..f8b913a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventRiskMeasureTemplatesListQueryRespDTO.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +public class PreventRiskMeasureTemplatesListQueryRespDTO { + + /** + * 主键 + */ + private Long id; + /** + * 排序字段 + */ + private Integer orderIndex; + /** + * 父级别措施id + */ + private Long parentId; + /** + * + 风控措施名称 : + 管控措施分类1:1-工程技术,2-维护保养,3-操作行为,4-应急设施; + 管控措施分类2 子级目录: + 1、工程技术:1-工艺控制,2-关键设备/部件,3-安全附件,4-安全仪表,5-其他; + 2、维护保养:1-动设备,2-静设备; + 3、操作行为:1-人员资质,2-操作记录,3-交接班; + 4、应急设施:1-应急设施,2-个体防护,3-消防设施,4-应急预案 + */ + private String riskMeasureName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getRiskMeasureName() { + return riskMeasureName; + } + + public void setRiskMeasureName(String riskMeasureName) { + this.riskMeasureName = riskMeasureName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventrCheckContentRespDTO.java b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventrCheckContentRespDTO.java new file mode 100644 index 0000000..17f7923 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/entity/dto/resp/PreventrCheckContentRespDTO.java @@ -0,0 +1,149 @@ +package com.gk.hotwork.doublePrevention.entity.dto.resp; + +import java.io.Serializable; + + +public class PreventrCheckContentRespDTO implements Serializable { + /** + * 主键id + * */ + private Long id; + /** + * 排查任务Id + * */ + private Long checkTaskId; + /** + * 管控措施Id + * */ + private Long controlMeasureId; + /** + * 管控措施对应的排查内容 + * */ + private String checkContent; + /** + * 单项检查内容结果 + * */ + private Byte checkResult; + + + //措施表信息 + /** + * 管控方式:1-自动化监控,2-隐患排查,3-其他 + */ + private Byte controlType; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getCheckResult() { + return checkResult; + } + + public void setCheckResult(Byte checkResult) { + this.checkResult = checkResult; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCheckTaskId() { + return checkTaskId; + } + + public void setCheckTaskId(Long checkTaskId) { + this.checkTaskId = checkTaskId; + } + + public Long getControlMeasureId() { + return controlMeasureId; + } + + public void setControlMeasureId(Long controlMeasureId) { + this.controlMeasureId = controlMeasureId; + } + + public String getCheckContent() { + return checkContent; + } + + public void setCheckContent(String checkContent) { + this.checkContent = checkContent; + } +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskResultEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskResultEnum.java new file mode 100644 index 0000000..4eeab91 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskResultEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.doublePrevention.enums; + +public enum CheckTaskResultEnum { + STATU_NOT_EXEC((byte)1,"未执行"), + STATU_FINESH_EXEC((byte)2,"已执行") + ; + + private Byte status; + private String desc; + + CheckTaskResultEnum(Byte status, String desc) { + this.status = status; + this.desc = desc; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskStatusEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskStatusEnum.java new file mode 100644 index 0000000..c03a47a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/CheckTaskStatusEnum.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.enums; + +public enum CheckTaskStatusEnum { + STATU_WAIT((byte)1,"待巡检"), + STATU_FINISH((byte)2,"已完成"), + STATU_OVERTIME((byte)3,"超时未巡检"), + STATU_EXEUTE((byte)4,"巡检中"), + ; + + private Byte status; + private String desc; + + CheckTaskStatusEnum(Byte status, String desc) { + this.status = status; + this.desc = desc; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/DataConvertEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/DataConvertEnum.java new file mode 100644 index 0000000..baf1e63 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/DataConvertEnum.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DataConvertEnum { + + DELETE_STATUS_USE((byte) 0, "正常"), + DELETE_STATUS_DISCARD((byte) 1, "删除"), + + + ; + byte code; + @JsonValue + String value; + + DataConvertEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/DeviceStatusEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/DeviceStatusEnum.java new file mode 100644 index 0000000..c7d2197 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/DeviceStatusEnum.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum DeviceStatusEnum { + + DEVICE_USE((byte) 1, "使用中"), + DEVICE_DISCARD((byte) 2, "已弃用"), + ; + byte code; + @JsonValue + String value; + + DeviceStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/ImageTypeEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/ImageTypeEnum.java new file mode 100644 index 0000000..027498e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/ImageTypeEnum.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ImageTypeEnum { + REPORT((byte) 0, "上报"), + RECTIFY((byte) 1, "整改"), + ACCEPT((byte) 2, "验收"), + + ; + byte code; + + String value; + + ImageTypeEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public void setCode(byte code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/RiskLevelEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/RiskLevelEnum.java new file mode 100644 index 0000000..d5a7c0f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/RiskLevelEnum.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RiskLevelEnum { + + RISK_LEVEL_1((byte) 1, "低风险"), + RISK_LEVEL_2((byte) 2, "一般风险"), + RISK_LEVEL_3((byte) 3, "较大风险"), + RISK_LEVEL_4((byte) 4, "重大风险"), + ; + byte code; + @JsonValue + String value; + + RiskLevelEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/StatusEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/StatusEnum.java new file mode 100644 index 0000000..4aa86b9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/StatusEnum.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusEnum { + + DELETE_STATUS_USE((byte) 0, "正常"), + DELETE_STATUS_DISCARD((byte) 1, "删除"), + + DANGER_RECTIFY_WAIT((byte) 1, "处理中"), + DANGER_RECTIFY_REVIEW((byte) 2, "已关闭"), + + DANGER_MANAGER_RECTIFY((byte) 0, "整改中"), + DANGER_MANAGER_WAIT_ACCEPT((byte) 1, "待验收"), + DANGER_MANAGER_TIMEOUT_RECTIFY((byte) 2, "延期整改"), + DANGER_MANAGER_NOT_ACCEPT((byte) 3, "超期未整改"), + DANGER_MANAGER_ACCEPT((byte) 9, "已验收"), + + DANGER_ON_TIME_RECTIFY((byte) 1 , "未延期"), + DANGER_TIMEOUT_RECTIFY((byte) 2, "延期整改"), + + ; + byte code; + @JsonValue + String value; + + StatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/SyncEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/SyncEnum.java new file mode 100644 index 0000000..ecbd9f2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/SyncEnum.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SyncEnum { + + SYNC_WAIT_EXEC((byte) 1, "待上报"), + SYNC_EXEC_SUCCESS((byte) 2, "已上报"), + SYNC_NOT_EXEC((byte) 3, "不上报"), + SYNC_EXEC_FAIL((byte) 8, "上报失败"), + + REPORT_ON((byte) 0, "开启"), + REPORT_OFF((byte) 1, "关闭"), + + CHOOSE_DATA_REPORT_ON((byte) 1, "上报"), + CHOOSE_DATA_REPORT_OFF((byte) 2, "不上报"), + + REPORT_AUTO_EXEC_CONFIG((byte) 0, "手动上报配置"), + REPORT_HAND_EXEC_CONFIG((byte) 1, "自动上报配置"), + + REPORT_CONFIG_RISK_ANA_UNIT((byte) 1, "风险分析单元"), + REPORT_CONFIG_RISK_EVENT((byte) 2, "安全风险分析事件"), + REPORT_CONFIG_RISK_MEASURE((byte) 3, "安全风险管控措施"), + REPORT_CONFIG_TASK_FROM_WORK((byte) 4, "隐患排查任务配置"), + REPORT_CONFIG__CHECK_RECORD((byte) 5, "隐患排查任务记录"), + REPORT_CONFIG_DANGER_INFO((byte) 6, "隐患信息"), + ; + byte code; + @JsonValue + String value; + + SyncEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/enums/WorkStatusEnum.java b/src/main/java/com/gk/hotwork/doublePrevention/enums/WorkStatusEnum.java new file mode 100644 index 0000000..293c09c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/enums/WorkStatusEnum.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.doublePrevention.enums; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum WorkStatusEnum { + + WORK_OPEN((byte) 1, "开启"), + WORK_CLOSE((byte) 2, "关闭"), + WORK_OVER((byte) 3, "过期"), + + TASK_WAIT((byte) 1, "待排查"), + + TASK_TYPE_AUTO((byte) 1, "周期作业"), + TASK_TYPE_USER_ADD((byte) 2, "日常作业"), + + TASK_EXEC_RESULT_NORMAL((byte) 1, "正常"), + TASK_EXEC_RESULT_ERROR((byte) 2, "异常"), + + TASK_EXEC_USED((byte) 2, "任务执行结束"), + ; + byte code; + @JsonValue + String value; + + WorkStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/CreateTaskConsumer.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/CreateTaskConsumer.java new file mode 100644 index 0000000..ffd9fb0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/CreateTaskConsumer.java @@ -0,0 +1,85 @@ +package com.gk.hotwork.doublePrevention.mq.consumer; + +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.mq.msg.PreventCreateTaskMsg; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.Date; + + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.preventCreateTaskTopic}",consumerGroup = "${rocketmq.consumers.CreateGroup}",consumeThreadNumber = 1) +public class CreateTaskConsumer implements RocketMQListener<MessageExt> { + + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.preventCreateTaskTopic}") + private String preventCreateTaskTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + @Autowired + private DangerService dangerService; + + @Override + public void onMessage(MessageExt messageExt) { + System.out.println("\n【##】CreateTaskConsumer接收到消息 MSG ID : " + messageExt.getMsgId() + "---->> 【##】接收时间" + new Date()); + + PreventCreateTaskMsg msg = JsonUtils.parse(new String(messageExt.getBody(), StandardCharsets.UTF_8), PreventCreateTaskMsg.class); + //Message message = MessageBuilder.withPayload(msgStr).build(); + if(msg!=null && msg.getWorkId()>0){ + //当前时间早于目标处理时间前0秒 + Long relaySeconds = (msg.getCreateTaskTime().getTime() - new Date().getTime())/1000; + + if(relaySeconds > 0){ + //重发消息,实现连续延时 + Message message = MessageBuilder.withPayload(msg).build(); + logger.info("【##】创建任务的消息延时"); //, 3000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds) + System.out.println("【##】创建任务的消息延时"); + if(rocketMQTemplate.syncSend(preventCreateTaskTopic, message,10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)).getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("重发创建任务消息失败" + msg.getWorkId()); + } + }else if(relaySeconds < -4 * 60 * 60L){ + logger.info("【##】任务消息过时,不执行任务创建"); + }else { + //创建task + logger.info("【##】开始创建任务" + new Date()); + System.out.println(msg); + if(dangerService.createAutoTask(msg.getWorkId()) != true){ + throw new RuntimeException("mq消息创建任务失败"); + } + } + } + } + +// @Override + public void prepareStart(DefaultMQPushConsumer consumer) { +// consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET); + consumer.setConsumeThreadMin(5); +// consumer.setConsumeTimestamp(UtilAll.timeMillisToHumanString3(System.currentTimeMillis())); + try { + consumer.subscribe(preventCreateTaskTopic,"*"); + } catch (MQClientException e) { + e.printStackTrace(); + } + } + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/NoticeTaskConsumer.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/NoticeTaskConsumer.java new file mode 100644 index 0000000..2097ce8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/NoticeTaskConsumer.java @@ -0,0 +1,81 @@ +package com.gk.hotwork.doublePrevention.mq.consumer; + +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.mq.msg.PreventNoticeExecTaskMsg; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.Date; + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.preventNoticeTaskTopic}",consumerGroup = "${rocketmq.consumers.NoticeGroup}") +public class NoticeTaskConsumer implements RocketMQListener<MessageExt>, RocketMQPushConsumerLifecycleListener { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.preventNoticeTaskTopic}") + private String preventNoticeTaskTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + @Override + public void onMessage(MessageExt messageExt) { + + logger.info("\n【##】NoticeTaskConsumer接收到消息\t MSG ID : "+ messageExt.getMsgId() + " "+ new Date()); + + PreventNoticeExecTaskMsg msg = JsonUtils.parse(new String(messageExt.getBody(), StandardCharsets.UTF_8), PreventNoticeExecTaskMsg.class); + + //logger.info("notice接收到消息内容" + msg.getTaskId() + msg.getNoticeTaskTime()); + + if(msg!=null && msg.getTaskId()>0){ + //当前时间早于处理时间时 + Long relaySeconds = (msg.getNoticeTaskTime().getTime() - new Date().getTime())/1000; + + if(relaySeconds > 0){ + //重发消息,实现连续延时 + System.out.println("【##】NoticeTaskConsumer消息延时"); + Message message = MessageBuilder.withPayload(msg).build(); + SendResult sendResult = rocketMQTemplate.syncSend(preventNoticeTaskTopic, message,10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("任务通知失败消息失败" + sendResult.getMsgId()); + } + logger.info("\n【##】NoticeTaskConsumer重发消息" + sendResult.getMsgId()); + }else if(relaySeconds < -60 * 60L){ + logger.info("【##】通知消息过时,不执行任务创建"); + }else { + //TODO 通知消息暂无炒作方法 + + logger.info("notice暂时无动作"); + } + } + } + + @Override + public void prepareStart(DefaultMQPushConsumer consumer) { +// consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET); + consumer.setConsumeThreadMin(4); +// consumer.setConsumeTimestamp(UtilAll.timeMillisToHumanString3(System.currentTimeMillis())); + try { + consumer.subscribe(preventNoticeTaskTopic,"*"); + } catch (MQClientException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/TimeOutTaskConsumer.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/TimeOutTaskConsumer.java new file mode 100644 index 0000000..ee2930d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/TimeOutTaskConsumer.java @@ -0,0 +1,99 @@ +package com.gk.hotwork.doublePrevention.mq.consumer; + +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.mq.msg.PreventTimeOutTaskMsg; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckWorkService; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.Date; + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.preventTimeOutTaskTopics}",consumerGroup = "${rocketmq.consumers.TimeOutGroup}") +public class TimeOutTaskConsumer implements RocketMQListener<MessageExt>, RocketMQPushConsumerLifecycleListener { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.preventTimeOutTaskTopic}") + private String preventTimeOutTaskTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + + @Override + public void onMessage(MessageExt messageExt) { + + logger.info("\n【##】TimeOutTaskConsumer接收到消息 \t MSG ID : " + messageExt.getMsgId() + new Date()); + + PreventTimeOutTaskMsg msg = JsonUtils.parse(new String(messageExt.getBody(), StandardCharsets.UTF_8), PreventTimeOutTaskMsg.class); + + //logger.info("TimeOutTaskConsumer接收到消息内容" + msg.getTaskId()+msg.getWorkId()+msg.getOutTaskTime()); + // 要对过期的消息做处理,可能要使用配置中心 + if(msg!=null && msg.getWorkId()>0){ + //当前时间早于处理时间时 + Long relaySeconds = (msg.getOutTaskTime().getTime() - new Date().getTime())/1000; + if(relaySeconds > 0){ + //重发消息,实现连续延时 + Message message = MessageBuilder.withPayload(msg).build(); + SendResult sendResult = rocketMQTemplate.syncSend(preventTimeOutTaskTopic, message, 10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + //logger.info("重发内容= "+ message + " " + message.getPayload() + " " +relaySeconds+ " " + CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("任务超时消息失败" + msg.getOutTaskTime()); + } + logger.info("\n【##】TimeOut重发消息" + sendResult.getMsgId() + new Date()); + System.out.println("【##】TimeOut重发消息" + new Date()); + }else { + PreventDangerCheckTask taskById = preventDangerCheckTaskService.getTaskById(msg.getTaskId()); + if (taskById.getResult() == 3){ + //设置任务超时 + logger.info("\n【##】TimeOut设置任务状态为超时..."); + System.out.println("\n【##】TimeOut设置任务状态为超时..."); + if (preventDangerCheckTaskService.resetTaskStatus(msg.getTaskId()) < 0){ + throw new RuntimeException("任务状态设置超时失败" + msg.getOutTaskTime()); + } + } + //设置作业为开启 + logger.info("\n【##】TimeOut重置作业状态开始..."); + System.out.println("\n【##】TimeOut重置作业状态开始..."); + if (preventDangerCheckWorkService.resetWorkStatus(msg.getWorkId()) < 0){ + throw new RuntimeException("作业状态重置失败" + msg.getOutTaskTime()); + } + } + } + } + + @Override + public void prepareStart(DefaultMQPushConsumer consumer) { +// consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET); + consumer.setConsumeThreadMin(5); +// consumer.setConsumeTimestamp(UtilAll.timeMillisToHumanString3(System.currentTimeMillis())); + try { + consumer.subscribe(preventTimeOutTaskTopic,"*"); + } catch (MQClientException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/WaitExecConsumer.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/WaitExecConsumer.java new file mode 100644 index 0000000..90a42bd --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/consumer/WaitExecConsumer.java @@ -0,0 +1,89 @@ +package com.gk.hotwork.doublePrevention.mq.consumer; + +import com.gk.hotwork.doublePrevention.mq.msg.PreventWaitExecTaskMsg; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQPushConsumerLifecycleListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.Date; + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.preventWaitWorkTopic}",consumerGroup = "${rocketmq.consumers.WaitWorkGroup}") +public class WaitExecConsumer implements RocketMQListener<MessageExt>, RocketMQPushConsumerLifecycleListener { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.preventWaitWorkTopic}") + private String preventWaitWorkTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + @Autowired + private DangerService dangerService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + + @Override + public void onMessage(MessageExt messageExt) { + System.out.println("\n【##】WaitExecConsumer接收到消息\t MSG ID : "+messageExt.getMsgId() + new Date()); + + PreventWaitExecTaskMsg msg = JsonUtils.parse(new String(messageExt.getBody(), StandardCharsets.UTF_8), PreventWaitExecTaskMsg.class); + + //logger.info("WaitExecConsumer接收到消息内容" + msg.getTaskId() + msg.getExecTaskTime()); + if(msg!=null && msg.getTaskId()>0){ + //当前时间早于处理时间时 + Long relaySeconds = (msg.getExecTaskTime().getTime() - new Date().getTime())/1000; + if(relaySeconds > 0){ + //重发消息,实现连续延时 + Message message = MessageBuilder.withPayload(msg).build(); + SendResult sendResult = rocketMQTemplate.syncSend(preventWaitWorkTopic, message,10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("任务通知失败消息失败" + msg.getExecTaskTime()); + } + logger.info("\n【##】WaitExecConsumer消息重发" + sendResult.getMsgId()); + System.out.println("【##】WaitExecConsumer消息重发"); + // logger.info("\nWaitExecConsumer消息重发" + message); + }else { + //设置任务为执行中 + logger.info("\n【##】wait设置任务状态为执行中"); + Byte taskStatus = 4; + if (preventDangerCheckTaskService.updateTaskStatus(msg.getTaskId(),taskStatus) <0){ + throw new RuntimeException("任务状态更新失败" + msg.getExecTaskTime()); + } + } + }else { + throw new RuntimeException("WaitExecConsumer消费失败" + msg.getExecTaskTime()); + } + //System.out.println("[MQ] 接收到消息:\t"+new String(messageExt.getBody())); + } + + @Override + public void prepareStart(DefaultMQPushConsumer consumer) { +// consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET); + consumer.setConsumeThreadMin(5); +// consumer.setConsumeTimestamp(UtilAll.timeMillisToHumanString3(System.currentTimeMillis())); + try { + consumer.subscribe(preventWaitWorkTopic,"*"); + } catch (MQClientException e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventCreateTaskMsg.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventCreateTaskMsg.java new file mode 100644 index 0000000..beca30b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventCreateTaskMsg.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.doublePrevention.mq.msg; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 创建任务单元消息 + */ +public class PreventCreateTaskMsg { + + //要生成任务单元的workId + private Long workId; + + //创建task目标动作时间 + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date createTaskTime; + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public Date getCreateTaskTime() { + return createTaskTime; + } + + public void setCreateTaskTime(Date createTaskTime) { + this.createTaskTime = createTaskTime; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventExecErrorNoticeMsg.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventExecErrorNoticeMsg.java new file mode 100644 index 0000000..f9d1f4d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventExecErrorNoticeMsg.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.doublePrevention.mq.msg; + +/** + * 提前提醒执行消息 + */ +public class PreventExecErrorNoticeMsg { + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventNoticeExecTaskMsg.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventNoticeExecTaskMsg.java new file mode 100644 index 0000000..ecf3f93 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventNoticeExecTaskMsg.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.mq.msg; + + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 提前提醒执行消息 + */ +public class PreventNoticeExecTaskMsg { + + private Long taskId; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date noticeTaskTime; + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public Date getNoticeTaskTime() { + return noticeTaskTime; + } + + public void setNoticeTaskTime(Date noticeTaskTime) { + this.noticeTaskTime = noticeTaskTime; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventTimeOutTaskMsg.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventTimeOutTaskMsg.java new file mode 100644 index 0000000..79098a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventTimeOutTaskMsg.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.doublePrevention.mq.msg; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 超时未巡检消息 + */ +public class PreventTimeOutTaskMsg { + + private Long taskId; + + private Long workId; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date outTaskTime; + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public Date getOutTaskTime() { + return outTaskTime; + } + + public void setOutTaskTime(Date outTaskTime) { + this.outTaskTime = outTaskTime; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventWaitExecTaskMsg.java b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventWaitExecTaskMsg.java new file mode 100644 index 0000000..e95a3dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/mq/msg/PreventWaitExecTaskMsg.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.doublePrevention.mq.msg; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 创建新的巡检任务单元消息 + */ +public class PreventWaitExecTaskMsg { + + private Long taskId; + + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date execTaskTime; + + public Long getTaskId() { + return taskId; + } + + public void setTaskId(Long taskId) { + this.taskId = taskId; + } + + public Date getExecTaskTime() { + return execTaskTime; + } + + public void setExecTaskTime(Date execTaskTime) { + this.execTaskTime = execTaskTime; + } + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckContentRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckContentRepository.java new file mode 100644 index 0000000..c5e5577 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckContentRepository.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventDangerCheckContentRepository extends BaseMapper<PreventDangerCheckContent> { + + /** + * 查询管控措施-通过关联的措施id + * */ + PreventDangerCheckContent getCheckContentByMeasureId(Long measureId); + + /** + * 修改隐患排查内容-通过关联的措施id + * */ + int updateDangerCheckContent(Long measureId, String checkContent); + + /** + * 查询任隐患排查内容-根据务关联的检查内容taskId + * */ + PreventDangerCheckContent getCheckContentByTaskId(Long taskId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskRepository.java new file mode 100644 index 0000000..6ce8e8c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskRepository.java @@ -0,0 +1,117 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskToUserParams; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Repository +public interface PreventDangerCheckTaskRepository extends BaseMapper<PreventDangerCheckTask> { + + /** + * 隐患排查任务-分页查询 + */ + IPage<PreventDangerCheckTask> getTaskPage(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-分页查询-手机端使用 + */ + IPage<PreventDangerCheckTask> getTaskPageForMobile(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-修改 + */ + int updateTask(PreventDangerCheckTaskUpdateParams updateParams); + /** + * 隐患排查任务-删除 + */ + int deleteTask(PreventDeleteParams deleteParams); + /** + * 隐患排查任务-通过id查询信息 + */ + PreventDangerCheckTask getTaskById(Long checkTaskId); + /** + * 隐患排查任务-通过taskCode查询信息 + */ + PreventDangerCheckTask getTaskByCode(Long taskCode); + /** + * 隐患排查任务-通过id修改任务状态 + */ + int updateTaskStatus(Long taskId, Byte taskStatus); + /** + * 设置任务为超时 + * */ + int resetTaskStatus(Long taskId); + /** + * 隐患排查任务-通过作业id查询 + */ + List<PreventDangerCheckTask> getTaskByCheckWorkId(Long checkWorkId); + /** + * 排查任务-手工上报-配置 + */ + int updateCheckTaskReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + + + + + + /** + * 排查任务-上报数据 + */ + List<PreventDangerCheckTask> listReportTask(); + /** + * 排查任务-上报数据状态变更 + */ + int updateTaskReportStatus(HandlerReportParam handlerReportParam); + /** + * 排查任务-认领任务 + */ + int taskToUser(PreventTaskToUserParams taskToUserParams); + + List<Map> selectInspectorsStatistics(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + List<Map> selectInspectionCompleted(Long depId, Byte status, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + /** + * 排查任务-检查是否已经创建 + */ + PreventDangerCheckTask getTaskByCheckWorkIdAndStartTime(Long workId, Date checkTime); + /** + * 排查任务-查询应该已经过期,但是还在执行中状态的任务 + */ + List<PreventDangerCheckTask> listOverTask(Date startTime, Date endTime); + /** + * 排查任务-查询应该已经开始,但是还在待执行状态的任务 + */ + List<PreventDangerCheckTask> listWaitExecTask(Date endTime); + /**查询应该已经结束,但是还在执行中状态的任务*/ + List<PreventDangerCheckTask> listTimeOutTask(Date endTime); + + List<Map> selectInspectionTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + List<Map> selectInspectionClaimedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + List<Map> selectInspectionCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + List<Map> selectInspectionUnCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + List<PreventDangerCheckTaskRectifyDO> selectPreventDangerPage(Page<PreventDangerCheckTaskRectifyDO> page, @Param("query") Map<String, Object> params); + + Map<String, Integer> selectRectifyNum(); + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskUnitRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskUnitRepository.java new file mode 100644 index 0000000..eed1d33 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckTaskUnitRepository.java @@ -0,0 +1,73 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitUpdateParams; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventDangerCheckTaskUnitRepository extends BaseMapper<PreventDangerCheckTaskUnit> { + + /** + * 隐患排查任务单元-分页查询 + */ + IPage<PreventDangerCheckTaskUnit> getTaskUnitPage(Page<Object> page, PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO); + /** + * 隐患排查任务单元-通过名称查询单元信息 + */ + PreventDangerCheckTaskUnit getTaskUnitByName(String taskUnitName); + /** + * 隐患排查任务单元-修改 + */ + int updateTaskUnit(PreventDangerCheckTaskUnitUpdateParams updateParams); + /** + * 隐患排查任务单元-删除 + */ + int deleteTaskUnit(PreventDangerCheckTaskUnitDeleteParams deleteParams); + /** + * 隐患排查任务单元- + * 根据名称修改关联作业id + */ + PreventDangerCheckTaskUnit updateWorkIdByUnitName(String taskUnitName, Long checkWorkId); + + /** + * 隐患排查任务单元- + * 根据名称 修改 taskId + */ + int updateTaskIdByUnitName(String taskUnitName, long taskId); + /** + * 隐患排查任务单元- + * 根据workId 查询 + */ + PreventDangerCheckTaskUnit getTaskUnitByWorkId(Long workId); + /** + * 隐患排查任务单元-重置关联任务单元workId + * 根据taskUnitName + */ + int deleteWorkIdByUnitName(String taskUnitName); + + /** + * 隐患排查任务单元-根据Id查询 + */ + PreventDangerCheckTaskUnit getTaskUnitById(Long id); + + /** + * 隐患排查任务单元- + * 根据unitId 修改 workId + */ + int updateWorkIdByUnitId(Long taskUnitId, long checkWorkId, String checkWorkUuid); + /** + * 隐患作业id,重置与任务单元的关联 + */ + int deleteByWorkId(Long workId); + /** + * 隐患排查任务单元-任务单元列表 + */ + List<PreventDangerCheckTaskUnit> listTaskUnit(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckWorkRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckWorkRepository.java new file mode 100644 index 0000000..d30dee0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerCheckWorkRepository.java @@ -0,0 +1,101 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckWorkQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.CheckWorkAutoUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkUpdateParams; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +@Repository +public interface PreventDangerCheckWorkRepository extends BaseMapper<PreventDangerCheckWork> { + + /** + * 隐患排查作业-分页查询 + */ + IPage<PreventDangerCheckWork> getCheckWorkPage(Page<Object> page, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO); + /** + * 隐患排查作业-修改 + */ + int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams); + /** + * 隐患排查作业-删除 + */ + int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams); + /** + * 隐患排查作业-根据作业名称查找 + */ + PreventDangerCheckWork getWorkByName(String checkWorkName); + /** + * 隐患排查作业-任务列表 + */ + List<PreventDangerCheckWork> listCheckWork(); + /** + * 隐患排查作业-根据任务单元查找 + */ + PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId); + + /** + * 隐患排查作业-根据Id查找 + */ + PreventDangerCheckWork getWorkById(Long workId); + /** + * 隐患排查作业 下次调度时间--上传调度时间 + * -根据Id + */ + int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateWorkParams); + /** + * 隐患排查作业 修改为调度中 + * -根据Id + */ + void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams); + + /** + * 隐患排查作业 重置作业状态 + */ + int resetWorkStatus(Long workId); + /** + * 隐患排查作业 可调度 + */ + List<PreventDangerCheckWork> listScheduleCheckWork(); + /** + * 排查作业-手工上报-配置 + */ + int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + /** + * 上报数据,任务配置检索 + */ + List<PreventDangerCheckWork> listReportWork(); + /** + * 上报数据,任务配置上报状态变更 + */ + int updateWorkReportStatus(HandlerReportParam handlerReportParam); + + + /** + * 排查作业-有问题的work + */ + List<PreventDangerCheckWork> listErrorCheckWork(Date date); + /** + * 排查作业-重置错误时间 + */ + int resetErrorWork(Date resetTime, Long id); + /** + * 排查作业-检查待执行列表 + */ + List<PreventDangerCheckWork> listExecCheckWork(Date startTime, Date endTime); + /** + * 排查作业-检查待执行列表 + */ + int resetCheckWorkStatus(Long Id); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerImageRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerImageRepository.java new file mode 100644 index 0000000..0d0064f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerImageRepository.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventDangerImage; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventDangerImageRepository extends BaseMapper<PreventDangerImage> { + + void updateStatusByParentId(Long parentId, byte type, byte status); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageRepository.java new file mode 100644 index 0000000..384ed16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageRepository.java @@ -0,0 +1,91 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManage; +import com.gk.hotwork.doublePrevention.entity.dto.query.db.OwnRectifyPageDBQuery; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerManageQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.*; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +@Repository +public interface PreventDangerManageRepository extends BaseMapper<PreventDangerManage> { + + /** + * 隐患治理清单-分页查询 + */ + IPage<PreventDangerManage> getDangerManagePage(Page<Object> page, PreventDangerManageQueryReqDTO manageQueryReqDTO); + /** + * 隐患治理清单-修改 + */ + int updateDangerManage(PreventDangerManageUpdateParams updateParams); + /** + * 隐患治理清单-删除 + */ + int deleteDangerManage(PreventDeleteParams deleteParams); + /** + * 隐患治理清单-根据dangerCode查询 + */ + PreventDangerManage getDangerManageByCode(String dangerCode); + /** + * 隐患治理清单-根据id查询 + */ + PreventDangerManage getDangerManageById(Long dangerManagerId); + /** + * 隐患治理清单-根据taskId查询 + */ + PreventDangerManage getDangerManageByTaskId(Long taskId); + /** + * 隐患治理清单-列表 + */ + List<PreventDangerManage> listDangerManage(); + /** + * 隐患管理-手工上报-配置 + */ + int updateDangerManagerReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 隐患管理-验收 + */ + int updateRectifyResult(UpdateRectifyResultParams updateParams); + /** + * 隐患管理-延期状态 + */ + int updateManagerStatus(Long dangerManagerId, byte code); + /** + * 隐患管理-关闭隐患单 + */ + int closeDanger(CloseDangerParams closeDangerParams); + /** + * 隐患-整改完成的 + */ + List<PreventDangerManage> listRectifyOver(PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + + + + + + /** + * 隐患-上报数据 + */ + List<PreventDangerManage> listReportDanger(); + /** + * 隐患-上报数据状态变更 + */ + int updateManageReportStatus(HandlerReportParam handlerReportParam); + + IPage<PreventDangerManage> getDangerManagePageTORectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + + Integer countByCreateTime(Date startTime, Date endTime); + + PreventDangerManage findByDangerSerialCode(String serialCode); + + List<PreventDangerCheckTaskRectifyDO> listOwnRectifyPage(Page<PreventDangerCheckTaskRectifyDO> page,@Param("query") OwnRectifyPageDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageTimeoutRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageTimeoutRepository.java new file mode 100644 index 0000000..2bd2879 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerManageTimeoutRepository.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManageTimeout; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventDangerManageTimeoutRepository extends BaseMapper<PreventDangerManageTimeout> { + /** + * 延期 + * */ + int manageTimeout(PreventDangerManageTimeout manageTimeout); + /** + * 延期状态-根据dangerManagerId查询 + * */ + PreventDangerManageTimeout getByManageId(Long dangerManagerId); + /** + * 延期状态-根据RectifyId查询 + * */ + PreventDangerManageTimeout getByRectifyId(Long rectifyId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerRectifyRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerRectifyRepository.java new file mode 100644 index 0000000..b7d9ed6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventDangerRectifyRepository.java @@ -0,0 +1,71 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerRectifyQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.*; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventDangerRectifyRepository extends BaseMapper<PreventDangerRectify> { + + + /** + * 隐患整改清单-分页查询 + */ + IPage<PreventDangerRectify> getDangerRectifyPage(Page<Object> page, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO); + /** + * 隐患整改清单-修改 + */ + int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams); + /** + * 隐患整改清单-删除 + */ + int deleteDangerRectify(PreventDeleteParams deleteParams); + /** + * 隐患整改清单-整改验收报告 + */ + int applyReport(PreventDangerReportRectifyUpdayeParams reportParams); + /** + * 隐患整改清单-根据隐患单Code查询 + */ + PreventDangerRectify getRectifyByCode(String dangerCode); + /** + * 隐患整改清单-延期 + */ + int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams); + /** + * 隐患整改清单-根据ID查询 + */ + PreventDangerRectify getRectifyById(Long id); + /** + * 隐患整改清单-验收 + */ + int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams); + /** + * 隐患整改清单-关闭整改单 + */ + int closeDanger(CloseDangerParams closeDangerParams); + /** + * 隐患整改清单-根据ManageID查询 + */ + PreventDangerRectify getRectifyByManageId(Long manageId); + /** + * 隐患整改清单-已整改-分页查询 + */ + IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + /** + * 隐患整改清单-根据ManageID查询-包含删除数据 + */ + PreventDangerRectify getRectifyByManageIdForReport(Long manageId); + /** + * 隐患整改清单-变更上报状态 + */ + int updateRectifyReportStatus(HandlerReportParam handlerReportParam); + + IPage<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventProduceDeviceRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventProduceDeviceRepository.java new file mode 100644 index 0000000..a18423e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventProduceDeviceRepository.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceUpdateParams; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * (PreventProduceDevice)表数据库访问层 + * + * @author qihs + * @since 2022-06-25 10:40:17 + */ +@Repository +public interface PreventProduceDeviceRepository extends BaseMapper<PreventProduceDevice> { + + /** + * 生产装置-分页查询 + * */ + IPage<PreventProduceDevice> getDevicePage(Page<Object> page, @Param("queryParams") PreventProduceDeviceQueryParams queryParams); + /** + * 生产装置-根绝风险等级查询 + * */ + PreventProduceDevice getByRiskLevel(Byte riskLevel); + + /** + * 生产装置-根绝设备名称和所在位置查询 + * */ + PreventProduceDevice getByNameAndLocation(String produceDeviceName, String location); + /** + * 生产装置-删除 + */ + int deleteOne(PreventProduceDeviceDeleteParams param); + /** + * 生产装置-查询-通过设备名称 + */ + PreventProduceDevice getByDeviceName(String produceDeviceName); + /** + * 生产装置-修改信息 + */ + int updateProduceDevice(PreventProduceDeviceUpdateParams updateParams); + /** + * 生产装置- 查询生产装置列表 + */ + List<PreventProduceDevice> getListDevices(); + /** + * 生产装置-查询-通过设备id + */ + PreventProduceDevice selectByDeviceId(Long id); + /** + * 生产装置- 查询生产装置-通过名称与部门 + */ + PreventProduceDevice getDeviceByNameAndDep(String name, String dep); + + /** + * @Description: 统计各生产装置等级的数量 + */ + Map countDeviceEveryLevel(); + +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportBatchRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportBatchRepository.java new file mode 100644 index 0000000..9bbc47e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportBatchRepository.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventReportBatch; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventReportBatchRepository extends BaseMapper<PreventReportBatch> { +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckRecordFromTaskRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckRecordFromTaskRepository.java new file mode 100644 index 0000000..4e8bc77 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckRecordFromTaskRepository.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckRecordFromTask; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckRecordFromTaskReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportCheckRecordFromTaskRepository extends BaseMapper<PreventReportCheckRecordFromTask> { + + /** + * 任务记录-分页查询 + * */ + IPage<PreventReportCheckRecordFromTask> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckRecordFromTaskReqDTO queryReqDTO); + /** + * 任务-查询待上报 + * */ + List<PreventReportCheckRecordFromTask> listReportTaskRecordDate(); + /** + * 任务-待上报状态变更 + * */ + int updateTaskReportStatus(HandlerReportParam handlerReportParam); + + PreventReportCheckRecordFromTask getTaskById(String id); + + int updateTaskById(PreventReportCheckRecordFromTask recordFromTasks); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckTaskFromWorkRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckTaskFromWorkRepository.java new file mode 100644 index 0000000..a460700 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportCheckTaskFromWorkRepository.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckTaskFromWork; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckTaskFromWorkReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportCheckTaskFromWorkRepository extends BaseMapper<PreventReportCheckTaskFromWork> { + + /** + * 批量插入数据 + * */ + int insertList(List<PreventReportCheckTaskFromWork> taskFromWorkLists); + /** + * 上报数据-任务配置-分页查询 + */ + IPage<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckTaskFromWorkReqDTO queryReqDTO); + /** + * 任务配置 -查询待上报 + * */ + List<PreventReportCheckTaskFromWork> listReportTaskFromWorkDate(); + /** + * 任务配置 -待上报状态变更 + * */ + int updateWorkReportStatus(HandlerReportParam handlerReportParam); + + PreventReportCheckTaskFromWork getWorkById(String id); + + int updateWorkById(PreventReportCheckTaskFromWork taskFromWorkList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigLogRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigLogRepository.java new file mode 100644 index 0000000..be10725 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigLogRepository.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfigLog; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventReportConfigLogRepository extends BaseMapper<PreventReportConfigLog> { + + /** + * 数据上报配置历史记录-查询 + */ + IPage<PreventReportConfigLog> getReportConfigLogPage(Page<Object> page, PreventReportConfigLogQueryReqDTO queryReqDTO); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigRepository.java new file mode 100644 index 0000000..5380e16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportConfigRepository.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfig; +import com.gk.hotwork.doublePrevention.repository.param.PreventReportConfigUpdateParams; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportConfigRepository extends BaseMapper<PreventReportConfig> { + + /** + * 数据上报配置-查询 + */ + List<PreventReportConfig> ListReportConfigs(); + + /** + * 数据上报配置-修改 + */ + int updateReportConfig(PreventReportConfigUpdateParams updateParams); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportDangerInfoRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportDangerInfoRepository.java new file mode 100644 index 0000000..74869b3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportDangerInfoRepository.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportDangerInfo; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportDangerInfoReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportDangerInfoRepository extends BaseMapper<PreventReportDangerInfo> { + + /** + * 上报数据-隐患信息-分页查询 + */ + IPage<PreventReportDangerInfo> getReportDangerInfoPage(Page<Object> objectPage, PreventReportDangerInfoReqDTO queryReqDTO); + /** + * 上报数据-待上报数据查询 + */ + List<PreventReportDangerInfo> listReportDangerDate(); + /** + * 上报数据-待上报状态变更 + */ + int updateTaskReportStatus(HandlerReportParam handlerReportParam); + + PreventReportDangerInfo getDangerById(String id); + + int updateDangerById(PreventReportDangerInfo danger); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskAnaUnitRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskAnaUnitRepository.java new file mode 100644 index 0000000..4cf8991 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskAnaUnitRepository.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportRiskAnaUnitRepository extends BaseMapper<PreventReportRiskAnaUnit> { + + /** + * 上报数据-风险分析单元-分页查询 + */ + IPage<PreventReportRiskAnaUnit> getReportRiskUnitPage(Page<Object> page, PreReportRiskUnitQueryReqDTO queryReqDTO); +// /** +// * 上报数据-风险分析单元-分页查询 +// */ +// List<PreventReportRiskAnaUnit> listRiskAnaUnit(); + /** + * 上报数据-风险分析单元-分页查询 + */ + int saveList(List<PreventReportRiskAnaUnit> unitLists); + /** + * 上报数据-查询待上报数据 + */ + List<PreventReportRiskAnaUnit> listReportUnitDate(); + /** + * 上报数据-修改待上报 + */ + int updateReportStatus(HandlerReportParam handlerReportParam); + /** + * 上报数据-更新数据 + */ + int updateUnitById(PreventReportRiskAnaUnit unitList); + /** + * 上报数据-更新数据 + */ + PreventReportRiskAnaUnit getUnitById(String id); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskControlMeasureRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskControlMeasureRepository.java new file mode 100644 index 0000000..73e0aae --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskControlMeasureRepository.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportRiskControlMeasureReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportRiskControlMeasureRepository extends BaseMapper<PreventReportRiskControlMeasure> { + + /** + * 批量插入 + * */ + int insertList(List<PreventReportRiskControlMeasure> measureLists); + /** + * 上报数据-管控措施-分页查询 + */ + IPage<PreventReportRiskControlMeasure> getReportMeasurePage(Page<Object> objectPage, PreventReportRiskControlMeasureReqDTO queryReqDTO); + /** + * 管控措施-上报数据 + * */ + List<PreventReportRiskControlMeasure> listReportMeasureDate(); + /** + * 管控措施-修改上报状态 + * */ + int updateMeasureReportStatus(HandlerReportParam handlerReportParam); + + PreventReportRiskControlMeasure getMeasureById(String id); + + int updateMeasureById(PreventReportRiskControlMeasure measureList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskEventRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskEventRepository.java new file mode 100644 index 0000000..f2417f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventReportRiskEventRepository.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventReportRiskEventRepository extends BaseMapper<PreventReportRiskEvent> { + + /** + * 批量插入 + * */ + int saveList(List<PreventReportRiskEvent> eventLists); + /** + * 分页查询 + * */ + IPage<PreventReportRiskEvent> getReportRiskEventPage(Page<Object> objectPage, PreReportRiskEventQueryReqDTO queryReqDTO); + /** + * 上报数据-查询待上报数据 + * */ + List<PreventReportRiskEvent> listReportEventDate(); + /** + * 修改上报状态 + * */ + int updateEventReportStatus(HandlerReportParam handlerReportParam); + + PreventReportRiskEvent getEventById(String id); + + int updateEventById(PreventReportRiskEvent eventList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskAnaUnitRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskAnaUnitRepository.java new file mode 100644 index 0000000..e79c8c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskAnaUnitRepository.java @@ -0,0 +1,68 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskAnaUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitUpdateParams; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventRiskAnaUnitRepository extends BaseMapper<PreventRiskAnaUnit> { + + /** + * 风险分析单元-分页查询 + */ + IPage<PreventRiskAnaUnit> getRiskUnitPage(Page<Object> objectPage, @Param("queryParams") PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO); + + /** + * 风险分析单元-根据名称获取单元信息 + */ + PreventRiskAnaUnit getRiskUnitByName(String riskUnitName); + /** + * 风险分析单元-新增 + */ + int updateRiskAnaUnitById(PreventRiskAnaUnitUpdateParams updateParams); + /** + * 风险分析单元-删除 + */ + int deleteRiskAnaUnitById(PreventRiskAnaUnitDeleteParams deleteParams); + /** + * 风险事件-分页查询 + */ + PreventRiskAnaUnit getRiskUnitById(Long riskUnitId); + /** + * 风险分析单元-根据produce_device_uuid查询 + */ + List<PreventRiskAnaUnit> getRiskUnitByDeviceId(Long deviceId); + /** + * 风险分析单元-根据风险编码查询 + */ + PreventRiskAnaUnit getRiskUnitByCode(String riskCode); + /** + * 风险事件-新增 - 单元list查询 + */ + List<PreventRiskAnaUnit> listRiskUnits(); + + /** + * 安全风险分析单元-手工上报-配置 + */ + int updateRiskAnaUnitReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + /** + * 安全风险分析单元-上报数据检索 + */ + List<PreventRiskAnaUnit> listRiskAnaUnit(); + /** + * 安全风险分析单元-修改上报状态 + */ + int updateReportStatus(HandlerReportParam handlerReportParam); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlMeasureRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlMeasureRepository.java new file mode 100644 index 0000000..72de696 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlMeasureRepository.java @@ -0,0 +1,125 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.PreventRiskControlMeasureListDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskControlMeasureListQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventrCheckContentRespDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureUpdateParams; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventRiskControlMeasureRepository extends BaseMapper<PreventRiskControlMeasure> { + + /** + * 管控措施-分页查询 + */ + IPage<PreventRiskControlMeasure> getRiskControlMeasurePage(@Param("page") Page<Object> page, @Param("queryParams") PreventRiskControlMeasureQueryParams queryParams); + + /** + * 管控措施-根据RiskEventId查询 + */ + List<PreventRiskControlMeasure> getRiskControlMeasureByRiskEventId(Long riskEventId); + /** + * 管控措施-根据riskEventId与编码查询 + */ + PreventRiskControlMeasure getRiskControlMeasureByCodeAndEventId(Long riskEventId, String controlMeasureCode); + /** + * 管控措施-修改 + */ + int updateRiskControlMeasure(PreventRiskControlMeasureUpdateParams updateParams); + /** + * 管控措施-删除 + */ + int deleteRiskControlMeasure(PreventRiskControlMeasureDeleteParams deleteParams); + /** + * 任务单元、任务关联修改 + * 管控措施-修改管控措施By measureCode UnitId + */ + int updateControlMeasureByCodeAndUnitId(String measureCode, Long taskUnitId); + /** + * 任务单元、任务关联修改 + * 管控措施-修改管控措施 UnitId + */ + int updateControlMeasureByUnitId(Long unitId); + /** + * 管控措施-根据measureCode查询 + */ + PreventRiskControlMeasure getControlMeasureByCode(String measureCode); + /** + * 管控措施-根据measureCode + * 修改关联checkWorkId + */ + PreventRiskControlMeasure updateWorkIdByMeasureCode(String controlMeasureCode, Long checkWorkId); + /** + * 管控措施-根据WorkId查询 + */ + List<PreventRiskControlMeasure> getControlMeasureByWorkId(Long workId); + /** + * 管控措施-根据单元id查找对应措施id列表 + */ + List<PreventRiskControlMeasure> getListByUnitId(Long taskUnitId); + /** + * 管控措施-根据measureCode修改关联的任务taskId + */ + void updateTaskIdByMeasureCode(Long measureId, Long taskId); + /** + * 管控措施-先重置关联管控措施的workId + */ + int deleteTaskIdByMeasureCode(String measureCode); + + /** + * 管控措施-根据measureId修改关联的任务taskId + */ + int updateControlMeasureByMeasureIdAndUnitId(Long measureId, Long taskUnitId); + /** + * 安全风险事件-手工上报-配置 + */ + int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 管控措施-根据id查询 + */ + PreventRiskControlMeasure selectByMeasureId(Long id); + + + /** + * 措施-手工上报-配置 + */ + List<PreventRiskControlMeasure> listReportMeasure(); + /** + * 管控措施- 管控措施列表 + */ + List<PreventRiskControlMeasure> listControlMeasure(); + + + /** + * 管控措施- 管控措施UUid + */ + PreventRiskControlMeasure getControlMeasureByUuid(String measureUuid); + /** + * 管控措施- 上报状态更新 + */ + int updateMeasureReportStatus(HandlerReportParam handlerReportParam); + /** + * 管控措施- 管控措施列表 - 分页 + */ + IPage<PreventRiskControlMeasureListDO> listControlMeasurePage(Page<Object> objectPage, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO); + + /** + * 管控措施+内容 批量查询 + */ + List<PreventRiskControlMeasure> getControlMeasureAndContent(List<Long> idLists); + /** + * 管控措施+内容 查询全部 + */ + List<PreventRiskControlMeasure> listAllControlMeasure(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlTemplateRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlTemplateRepository.java new file mode 100644 index 0000000..a5cc334 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskControlTemplateRepository.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlTemplate; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventRiskControlTemplateRepository extends BaseMapper<PreventRiskControlTemplate> { + + /** + * 获取控制措施模板 + * */ + List<PreventRiskControlTemplate> listMeasureTemplates(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskEventRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskEventRepository.java new file mode 100644 index 0000000..57620dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskEventRepository.java @@ -0,0 +1,65 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventUpdateParams; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventRiskEventRepository extends BaseMapper<PreventRiskEvent> { + + /** + * 风险事件-分页查询 + */ + // + IPage<PreventRiskEvent> getRiskEventPage(Page<Object> page, @Param("queryParams") PreventRiskEventQueryParams queryParams); + + /** + * 风险事件-根据事件名字查询 + */ + PreventRiskEvent getRiskEventByName(String riskEventName); + /** + * 风险事件-修改 + */ + int updateRiskEvent(PreventRiskEventUpdateParams updateParams); + /** + * 风险事件-删除 + */ + int deleteRiskEventById(PreventDeleteParams deleteParams); + + /** + * 风险事件-根据id获取名名称 + */ + PreventRiskEvent getRiskEventNameById(Long id); + + /** + * 风险事件-根据RiskUnitId获取 + */ + List<PreventRiskEvent> getRiskEventNameByRiskUnitId(Long riskUnitId); + + /** + * 风险事件-事件list + */ + List<PreventRiskEvent> getListEvents(); + /** + * 安全风险事件-手工上报-配置 + */ + int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 安全风险事件-上报数据 + */ + List<PreventRiskEvent> listReportEvent(); + /** + * 安全风险事件-更新上报状态 + */ + int updateEventReportStatus(HandlerReportParam handlerReportParam); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskMapRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskMapRepository.java new file mode 100644 index 0000000..39f0164 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventRiskMapRepository.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.doublePrevention.entity.PreventRiskMap; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskMapUpdateParams; +import org.springframework.stereotype.Repository; + +@Repository +public interface PreventRiskMapRepository extends BaseMapper<PreventRiskMap> { + + /** + * 风险分布图-分页查询详细信息 + */ + IPage<PreventRiskMap> getMapPage(Page<Object> mapPage); + /** + * 风险分布图-删除 + */ + int deleteRiskMap(Long id); + + /** + * 风险分布图-修改 + */ + int updateRiskMap(PreventRiskMapUpdateParams params); +} + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskAndMeasureRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskAndMeasureRepository.java new file mode 100644 index 0000000..d610c61 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskAndMeasureRepository.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventTaskAndMeasure; +import com.gk.hotwork.doublePrevention.repository.param.PreventCheckResultParams; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventTaskAndMeasureRepository extends BaseMapper<PreventTaskAndMeasure> { + + /** + * 以任务id为条件,重置管控措施与任务的关联 + * */ + void deleteTaskAndMeasureByTaskId(Long id); + /** + * 以任务id为条件,查询 + * */ + List<PreventTaskAndMeasure> getListByTaskId(Long taskId); + + /** + * 结果填报 + * */ + int updateCheckResult(PreventCheckResultParams checkResultParams); + /** + * 根绝任务id查找 + * */ + PreventTaskAndMeasure getTaskAndMeasureByTaskId(Long taskId); + /** + * 根绝任务id批量查找 + * */ + List<PreventTaskAndMeasure> getListByTaskIdByIdList(List<Long> taskIdLists); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskUnitAndMeasureRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskUnitAndMeasureRepository.java new file mode 100644 index 0000000..04f3aaf --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventTaskUnitAndMeasureRepository.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventTaskUnitAndMeasure; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskUnitAndMeasureParams; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventTaskUnitAndMeasureRepository extends BaseMapper<PreventTaskUnitAndMeasure> { + + /** + * 获取任务单元对应的管控措施 + * */ + List<PreventTaskUnitAndMeasure> getListByUnitId(Long taskUnitId); + /** + * 重置任务单元与管控措施的关系 + * */ + int deleteTaskUnitAndMeasure(PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams); + /** + * 获取任务单元对应的管控措施-by measureId + * */ + List<PreventTaskUnitAndMeasure> getListByMeasureId(Long measureId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventWorkAndMeasureRepository.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventWorkAndMeasureRepository.java new file mode 100644 index 0000000..bda45bb --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/PreventWorkAndMeasureRepository.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.doublePrevention.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.doublePrevention.entity.PreventWorkAndMeasure; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface PreventWorkAndMeasureRepository extends BaseMapper<PreventWorkAndMeasure> { + + /** + * 重置作业与措施的关联 + * */ + int updateWorkAndMeasure(String workUuid); + /** + * 查询作业与措施关联表 + * */ + PreventWorkAndMeasure getWorkAndMeasure(String workUuid, String measureUuid); + /** + * 查询作业与措施关联表 + * */ + List<PreventWorkAndMeasure> getWorkAndMeasureByWorkUuid(String workUuid); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CheckWorkAutoUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CheckWorkAutoUpdateParams.java new file mode 100644 index 0000000..fa4f205 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CheckWorkAutoUpdateParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + + +import java.util.Date; + +public class CheckWorkAutoUpdateParams { + /** + * 主键 + */ + private Long id; + /** + * 上一次排查开始时间 + */ + private Date lastCheckTime; + /** + * 预期下次开始时间 + */ + private Date nextCheckTime; + /** + * 排查作业状态:1-开启,2-关闭 + */ + private Byte checkWorkStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getLastCheckTime() { + return lastCheckTime; + } + + public void setLastCheckTime(Date lastCheckTime) { + this.lastCheckTime = lastCheckTime; + } + + public Date getNextCheckTime() { + return nextCheckTime; + } + + public void setNextCheckTime(Date nextCheckTime) { + this.nextCheckTime = nextCheckTime; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CloseDangerParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CloseDangerParams.java new file mode 100644 index 0000000..865782a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/CloseDangerParams.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class CloseDangerParams { + + /** + * 主键 + */ + private Long id; + /** + * 关闭隐患原因 + */ + private String dangerCloseReason; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 隐患是否确认 1-处理中,2-已关闭 + */ + private Byte dangerReview; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getDangerReview() { + return dangerReview; + } + + public void setDangerReview(Byte dangerReview) { + this.dangerReview = dangerReview; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDangerCloseReason() { + return dangerCloseReason; + } + + public void setDangerCloseReason(String dangerCloseReason) { + this.dangerCloseReason = dangerCloseReason; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/HandlerReportParam.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/HandlerReportParam.java new file mode 100644 index 0000000..c821a20 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/HandlerReportParam.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class HandlerReportParam { + /** + * 主键 + */ + private Long id; + /** + * 上报状态 1-待上报;2-已上报;3-不上报;4-变更需上传 + */ + private Byte reportStatus; + /** + * 上报时间 + */ + private Date reportTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventCheckResultParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventCheckResultParams.java new file mode 100644 index 0000000..33bb988 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventCheckResultParams.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +public class PreventCheckResultParams { + /** + * 主键id + * */ + private Long id; + /** + * 管控措施Id + * */ + private Long controlMeasureId; + /** + * 单项检查内容结果 + * */ + private Byte checkResult; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getControlMeasureId() { + return controlMeasureId; + } + + public void setControlMeasureId(Long controlMeasureId) { + this.controlMeasureId = controlMeasureId; + } + + public Byte getCheckResult() { + return checkResult; + } + + public void setCheckResult(Byte checkResult) { + this.checkResult = checkResult; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitDeleteParams.java new file mode 100644 index 0000000..ac446e1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitDeleteParams.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerCheckTaskUnitDeleteParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitUpdateParams.java new file mode 100644 index 0000000..35d1771 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUnitUpdateParams.java @@ -0,0 +1,67 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerCheckTaskUnitUpdateParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 任务单元名称 + */ + private String taskUnitName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 备注或描述信息 + */ + private String note; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getTaskUnitName() { + return taskUnitName; + } + + public void setTaskUnitName(String taskUnitName) { + this.taskUnitName = taskUnitName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUpdateParams.java new file mode 100644 index 0000000..98e9399 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckTaskUpdateParams.java @@ -0,0 +1,176 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerCheckTaskUpdateParams { + + /** + * 主键 + */ + private Long id; + + /** + * 排查结果:1-正常,2-存在隐患,3-未排查;4-其他 + */ + private Byte result; + /** + * 排查任务状态:1-待排查,2-排查中,3-已完成,4-超时未排查 + */ + private Byte taskStatus; + /** + * 本次排查开始时间 + */ + private Date startTime; + /** + * 任务有效时间 + */ + private Date validTime; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 关联隐患 任务单元 id + */ + private Long checkTaskUnitId; + /** + * 执行人ID + */ + private Long execUserId; + /** + * 关联隐患 任务单元 Uuid + */ + private String checkTaskUnitUuid; + /** + * 执行人Name + */ + private String execUserName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public Byte getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(Byte taskStatus) { + this.taskStatus = taskStatus; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getValidTime() { + return validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getCheckTaskUnitId() { + return checkTaskUnitId; + } + + public void setCheckTaskUnitId(Long checkTaskUnitId) { + this.checkTaskUnitId = checkTaskUnitId; + } + + public String getCheckTaskUnitUuid() { + return checkTaskUnitUuid; + } + + public void setCheckTaskUnitUuid(String checkTaskUnitUuid) { + this.checkTaskUnitUuid = checkTaskUnitUuid; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public String getExecUserName() { + return execUserName; + } + + public void setExecUserName(String execUserName) { + this.execUserName = execUserName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkDeleteParams.java new file mode 100644 index 0000000..80c5017 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkDeleteParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerCheckWorkDeleteParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkUpdateParams.java new file mode 100644 index 0000000..cab34a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerCheckWorkUpdateParams.java @@ -0,0 +1,258 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerCheckWorkUpdateParams { + + /** + * 主键 + */ + private Long id; + /** + * 排查作业类型:1-日常作业;2-周期作业 + */ + private Byte checkWorkType; + /** + * 排查作业状态:1-开启,2-关闭,3-过期 + */ + private Byte checkWorkStatus; + /** + * 排查周期-数值 + */ + private Integer checkCycle; + /** + * 时间单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte checkCycleUnit; + /** + * 有效时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte validTimeUnit; + /** + * 通知时间,单位:1-分钟,2-小时,3-日,4-月,5-年 + */ + private Byte noticeTimeUnit; + /** + * 提前通知时间-数值 + */ + private Integer noticeTime; + /** + * 每次调度后,任务有效时间 + */ + private Integer validTime; + /** + * 作业名称 + */ + private String checkWorkName; + /** + * 执行部门ID + */ + private Long execDepId; + /** + * 执行部门 + */ + private String execDep; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 任务单元UUID + */ + private String taskUnitUuid; + /** + * 任务单元Id + */ + private Long taskUnitId; + /** + * 作业开启后首次排查任务开始时间 + */ + private Date firstStartTime; + /** + * 预期下次开始时间 + */ + private Date nextCheckTime; + + public Date getNextCheckTime() { + return nextCheckTime; + } + + public void setNextCheckTime(Date nextCheckTime) { + this.nextCheckTime = nextCheckTime; + } + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public Date getFirstStartTime() { + return firstStartTime; + } + + public void setFirstStartTime(Date firstStartTime) { + this.firstStartTime = firstStartTime; + } + + public String getTaskUnitUuid() { + return taskUnitUuid; + } + + public Long getExecDepId() { + return execDepId; + } + + public void setExecDepId(Long execDepId) { + this.execDepId = execDepId; + } + + public String getExecDep() { + return execDep; + } + + public void setExecDep(String execDep) { + this.execDep = execDep; + } + + public void setTaskUnitUuid(String taskUnitUuid) { + this.taskUnitUuid = taskUnitUuid; + } + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getCheckWorkType() { + return checkWorkType; + } + + public void setCheckWorkType(Byte checkWorkType) { + this.checkWorkType = checkWorkType; + } + + public Byte getCheckWorkStatus() { + return checkWorkStatus; + } + + public void setCheckWorkStatus(Byte checkWorkStatus) { + this.checkWorkStatus = checkWorkStatus; + } + + public Integer getCheckCycle() { + return checkCycle; + } + + public void setCheckCycle(Integer checkCycle) { + this.checkCycle = checkCycle; + } + + public Byte getCheckCycleUnit() { + return checkCycleUnit; + } + + public void setCheckCycleUnit(Byte checkCycleUnit) { + this.checkCycleUnit = checkCycleUnit; + } + + public Integer getNoticeTime() { + return noticeTime; + } + + public void setNoticeTime(Integer noticeTime) { + this.noticeTime = noticeTime; + } + + public Integer getValidTime() { + return validTime; + } + + public void setValidTime(Integer validTime) { + this.validTime = validTime; + } + + public Byte getValidTimeUnit() { + return validTimeUnit; + } + + public void setValidTimeUnit(Byte validTimeUnit) { + this.validTimeUnit = validTimeUnit; + } + + public Byte getNoticeTimeUnit() { + return noticeTimeUnit; + } + + public void setNoticeTimeUnit(Byte noticeTimeUnit) { + this.noticeTimeUnit = noticeTimeUnit; + } + + public String getCheckWorkName() { + return checkWorkName; + } + + public void setCheckWorkName(String checkWorkName) { + this.checkWorkName = checkWorkName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerManageUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerManageUpdateParams.java new file mode 100644 index 0000000..da5f647 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerManageUpdateParams.java @@ -0,0 +1,201 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerManageUpdateParams { + + /** + * 主键 + */ + private Long id; + + /** + * 隐患等级:1-一般隐患,2-重大隐患 + */ + private Byte dangerLevel; + /** + * 隐患类型:1-安全;2-工艺,3-电气;4-仪表,5-消防;6-总图,7-设备;8-其他 + */ + private Byte dangerType; + /** + * 隐患来源:1-日常排查,2-综合性排查,3-专业性排查,4-季节性排查,5-重点时段及节假日前排查, + 6-事故类比排查,7-复产复工前排查,8-外聘专家诊断式排查,9-管控措施失效,10-其他 + */ + private Byte dangerSource; + /** + * 生产装置Id + */ + private Long produceDeviceId; + /** + * 隐患情况描述 + */ + private String dangerDesc; + /** + * 隐患产生原因分析 + */ + private String dangerReason; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 隐患所属部门id + */ + private Long depId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 隐患可能后果:1-无;2-轻伤;3-重伤;4-死亡;5-设备损坏;6-系统停车 + */ + private Byte dangerResult; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 隐患名称 + */ + private String dangerCode; + + public String getDangerCode() { + return dangerCode; + } + + public void setDangerCode(String dangerCode) { + this.dangerCode = dangerCode; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public Byte getDangerResult() { + return dangerResult; + } + + public void setDangerResult(Byte dangerResult) { + this.dangerResult = dangerResult; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getDangerLevel() { + return dangerLevel; + } + + public void setDangerLevel(Byte dangerLevel) { + this.dangerLevel = dangerLevel; + } + + public Byte getDangerType() { + return dangerType; + } + + public void setDangerType(Byte dangerType) { + this.dangerType = dangerType; + } + + public Byte getDangerSource() { + return dangerSource; + } + + public void setDangerSource(Byte dangerSource) { + this.dangerSource = dangerSource; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public String getDangerDesc() { + return dangerDesc; + } + + public void setDangerDesc(String dangerDesc) { + this.dangerDesc = dangerDesc; + } + + public String getDangerReason() { + return dangerReason; + } + + public void setDangerReason(String dangerReason) { + this.dangerReason = dangerReason; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerRectifyUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerRectifyUpdateParams.java new file mode 100644 index 0000000..5914335 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerRectifyUpdateParams.java @@ -0,0 +1,201 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.math.BigDecimal; +import java.util.Date; + +public class PreventDangerRectifyUpdateParams { + /** + * 主键 + */ + private Long id; + /** + * 整改类型:1-即查即改,2-限期整改 + */ + private Byte rectifyType; + /** + * 整改期限 + */ + private Date rectifyTime; + /** + * 整改责任人 + */ + private Long liablePersonId; + /** + * 整改责任人 + */ + private String liablePerson; + /** + * 整改措施 + */ + private String rectifyDesc; + /** + * 隐患Id + */ + private Long dangerManagerId; + /** + * 隐患uuId + */ + private String dangerManagerUuid; + /** + * 整改资金 + */ + private BigDecimal cost; + /** + * 申请验收时间 + */ + private Date applyTime; + /** + * 整改部门 + */ + private Long rectifyDepId; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 延期原因 + */ + private String timeOutDesc; + + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + + public Long getRectifyDepId() { + return rectifyDepId; + } + + public void setRectifyDepId(Long rectifyDepId) { + this.rectifyDepId = rectifyDepId; + } + + public String getTimeOutDesc() { + return timeOutDesc; + } + + public void setTimeOutDesc(String timeOutDesc) { + this.timeOutDesc = timeOutDesc; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public BigDecimal getCost() { + return cost; + } + + public void setCost(BigDecimal cost) { + this.cost = cost; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getRectifyType() { + return rectifyType; + } + + public void setRectifyType(Byte rectifyType) { + this.rectifyType = rectifyType; + } + + public Date getRectifyTime() { + return rectifyTime; + } + + public void setRectifyTime(Date rectifyTime) { + this.rectifyTime = rectifyTime; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getRectifyDesc() { + return rectifyDesc; + } + + public void setRectifyDesc(String rectifyDesc) { + this.rectifyDesc = rectifyDesc; + } + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public String getDangerManagerUuid() { + return dangerManagerUuid; + } + + public void setDangerManagerUuid(String dangerManagerUuid) { + this.dangerManagerUuid = dangerManagerUuid; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerReportRectifyUpdayeParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerReportRectifyUpdayeParams.java new file mode 100644 index 0000000..fde1f42 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDangerReportRectifyUpdayeParams.java @@ -0,0 +1,150 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDangerReportRectifyUpdayeParams { + /** + * 主键 + */ + private Long id; + /** + * 验收时间 + */ + private Date checkAcceptTime; + /** + * 验收人姓名Id + */ + private Long checkAcceptPersonId; + /** + * 验收人姓名 + */ + private String checkAcceptPerson; + /** + * 施工单位 + */ + private String constructionUnit; + /** + * 验收情况说明 + */ + private String checkAcceptDesc; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 整改时间 + */ + private Date applyTime; + /** + * 整改说明 + */ + private String rectifyInfo; + + public String getRectifyInfo() { + return rectifyInfo; + } + + public void setRectifyInfo(String rectifyInfo) { + this.rectifyInfo = rectifyInfo; + } + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCheckAcceptPersonId() { + return checkAcceptPersonId; + } + + public void setCheckAcceptPersonId(Long checkAcceptPersonId) { + this.checkAcceptPersonId = checkAcceptPersonId; + } + + public Date getCheckAcceptTime() { + return checkAcceptTime; + } + + public void setCheckAcceptTime(Date checkAcceptTime) { + this.checkAcceptTime = checkAcceptTime; + } + + public String getCheckAcceptPerson() { + return checkAcceptPerson; + } + + public void setCheckAcceptPerson(String checkAcceptPerson) { + this.checkAcceptPerson = checkAcceptPerson; + } + + public String getConstructionUnit() { + return constructionUnit; + } + + public void setConstructionUnit(String constructionUnit) { + this.constructionUnit = constructionUnit; + } + + public String getCheckAcceptDesc() { + return checkAcceptDesc; + } + + public void setCheckAcceptDesc(String checkAcceptDesc) { + this.checkAcceptDesc = checkAcceptDesc; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDeleteParams.java new file mode 100644 index 0000000..a743bd7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventDeleteParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventDeleteParams { + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceDeleteParams.java new file mode 100644 index 0000000..31c68c4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceDeleteParams.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventProduceDeviceDeleteParams { + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceQueryParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceQueryParams.java new file mode 100644 index 0000000..fee8ec4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceQueryParams.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +public class PreventProduceDeviceQueryParams { + + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; +// /** +// * 所属部门名称 +// */ +// private String depName; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 风险源所在区域 + */ + private String location; + /** + * 所属部门名称 + */ + private Long depId; + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceUpdateParams.java new file mode 100644 index 0000000..59f460b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventProduceDeviceUpdateParams.java @@ -0,0 +1,126 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventProduceDeviceUpdateParams { + /** + * 主键 + */ + private Long id; + /** + * 风险等级:1-低风险,2-一般风险,3-较大风险,4-重大风险 + */ + private Byte riskLevel; + /** + * 风险源状态:1-使用中,2-已弃用 + */ + private Byte status; + /** + * 所属部门名称 + */ + private String depName; + /** + * 所属部门Id + */ + private Long depId; + /** + * 所属部门uuid + */ + private String depUuid; + /** + * 风险源/管控对象 + */ + private String produceDeviceName; + /** + * 所在区域 + */ + private String location; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepUuid() { + return depUuid; + } + + public void setDepUuid(String depUuid) { + this.depUuid = depUuid; + } + + public String getProduceDeviceName() { + return produceDeviceName; + } + + public void setProduceDeviceName(String produceDeviceName) { + this.produceDeviceName = produceDeviceName; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventReportConfigUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventReportConfigUpdateParams.java new file mode 100644 index 0000000..42ecb44 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventReportConfigUpdateParams.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.util.Date; + +@TableName("prevent_report_config") +public class PreventReportConfigUpdateParams { + + /** + * 主键 + */ + private Integer id; + /** + * 上报开关:0-开启;1-关闭 + */ + private Byte reportState; + /** + * 上报方式:0-手动;1-自动 + */ + private Byte reportType; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Byte getReportState() { + return reportState; + } + + public void setReportState(Byte reportState) { + this.reportState = reportState; + } + + public Byte getReportType() { + return reportType; + } + + public void setReportType(Byte reportType) { + this.reportType = reportType; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitDeleteParams.java new file mode 100644 index 0000000..522515b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitDeleteParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskAnaUnitDeleteParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitUpdateParams.java new file mode 100644 index 0000000..5504994 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskAnaUnitUpdateParams.java @@ -0,0 +1,198 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskAnaUnitUpdateParams { + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 所属生产装置id + */ + private Long produceDeviceId; + /** + * 责任部门id + */ + private Long liableDepId; + /** + * 责任人id + */ + private Long liablePersonId; + /** + * 责任部门uuid + */ + private String liableDepUuid; + /** + * 责任人uuid + */ + private String liablePersonUuid; + /** + * 所属生产装置uuid + */ + private String produceDeviceUuid; + /** + * 安全风险分析对象编码 + */ + private String riskCode; + /** + * 安全风险分析单元名称 + */ + private String riskUnitName; + /** + * 责任部门 + */ + private String liableDep; + /** + * 责任人姓名 + */ + private String liablePerson; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Long getProduceDeviceId() { + return produceDeviceId; + } + + public void setProduceDeviceId(Long produceDeviceId) { + this.produceDeviceId = produceDeviceId; + } + + public Long getLiableDepId() { + return liableDepId; + } + + public void setLiableDepId(Long liableDepId) { + this.liableDepId = liableDepId; + } + + public Long getLiablePersonId() { + return liablePersonId; + } + + public void setLiablePersonId(Long liablePersonId) { + this.liablePersonId = liablePersonId; + } + + public String getLiableDepUuid() { + return liableDepUuid; + } + + public void setLiableDepUuid(String liableDepUuid) { + this.liableDepUuid = liableDepUuid; + } + + public String getLiablePersonUuid() { + return liablePersonUuid; + } + + public void setLiablePersonUuid(String liablePersonUuid) { + this.liablePersonUuid = liablePersonUuid; + } + + public String getProduceDeviceUuid() { + return produceDeviceUuid; + } + + public void setProduceDeviceUuid(String produceDeviceUuid) { + this.produceDeviceUuid = produceDeviceUuid; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskUnitName() { + return riskUnitName; + } + + public void setRiskUnitName(String riskUnitName) { + this.riskUnitName = riskUnitName; + } + + public String getLiableDep() { + return liableDep; + } + + public void setLiableDep(String liableDep) { + this.liableDep = liableDep; + } + + public String getLiablePerson() { + return liablePerson; + } + + public void setLiablePerson(String liablePerson) { + this.liablePerson = liablePerson; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureDeleteParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureDeleteParams.java new file mode 100644 index 0000000..93e6176 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureDeleteParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskControlMeasureDeleteParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureQueryParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureQueryParams.java new file mode 100644 index 0000000..637570a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureQueryParams.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +public class PreventRiskControlMeasureQueryParams { + + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 风险事件id + */ + private Long riskEventId; + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureUpdateParams.java new file mode 100644 index 0000000..66288e1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskControlMeasureUpdateParams.java @@ -0,0 +1,182 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskControlMeasureUpdateParams { + + /** + * 主键 + */ + private Long id; + /** + * 风险管控措施编号 + */ + private String controlMeasureCode; + /** + * 管控方式:1-自动化监控,2-隐患排查 + */ + private Byte controlType; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 管控措施分类1 + * 1-工程技术,2-维护保养,3-操作行为,4-应急设施 + */ + private Byte classify1; + /** + * 管控措施分类2 + * 1工程技术-工艺控制,关键设备/部件,安全附件,安全仪表,其他; + * 2维护保养-动设备,静设备;3 + * 操作行为-人员资质,操作记录,交接班; + * 4应急设施-应急设施,个体防护,消防设施,应急预案 + */ + private Byte classify2; + /** + * 管控措施分类3 + * 自定义 + */ + private String classify3; + /** + * 风险事件ID + */ + private Long riskEventId; + /** + * 关联风险事件uuid + */ + private String riskEventUuid; + /** + * 修改人 + */ + private String lastEditUserName; + + /** + * 风险管控措施描述 + */ + private String measureDesc; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 同步状态 + */ + private Byte reportStatus; + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControlMeasureCode() { + return controlMeasureCode; + } + + public void setControlMeasureCode(String controlMeasureCode) { + this.controlMeasureCode = controlMeasureCode; + } + + public Byte getControlType() { + return controlType; + } + + public void setControlType(Byte controlType) { + this.controlType = controlType; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public Byte getClassify1() { + return classify1; + } + + public void setClassify1(Byte classify1) { + this.classify1 = classify1; + } + + public Byte getClassify2() { + return classify2; + } + + public void setClassify2(Byte classify2) { + this.classify2 = classify2; + } + + public String getClassify3() { + return classify3; + } + + public void setClassify3(String classify3) { + this.classify3 = classify3; + } + + public Long getRiskEventId() { + return riskEventId; + } + + public void setRiskEventId(Long riskEventId) { + this.riskEventId = riskEventId; + } + + public String getRiskEventUuid() { + return riskEventUuid; + } + + public void setRiskEventUuid(String riskEventUuid) { + this.riskEventUuid = riskEventUuid; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public String getMeasureDesc() { + return measureDesc; + } + + public void setMeasureDesc(String measureDesc) { + this.measureDesc = measureDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventQueryParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventQueryParams.java new file mode 100644 index 0000000..c58cf3b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventQueryParams.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +public class PreventRiskEventQueryParams { + /** + * 所属安全风险分析单元id + */ + private Long riskUnitId; + /** + * 安全风险事件名称 + */ + private String riskEventName; + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventUpdateParams.java new file mode 100644 index 0000000..66de0a2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskEventUpdateParams.java @@ -0,0 +1,127 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskEventUpdateParams { + + /** + * 主键 + */ + private Long id; + /** + * 所属安全风险分析单元id + */ + private Long riskUnitId; + /** + * 所属安全风险分析单元uuid + */ + private String riskUnitUuid; + /** + * 安全风险事件名称 + */ + private String riskEventName; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + /** + * 同步状态 + */ + private Byte reportStatus; + /** + * 安全风险结果 + */ + private String eventResult; + + public String getEventResult() { + return eventResult; + } + + public void setEventResult(String eventResult) { + this.eventResult = eventResult; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } + + public String getRiskUnitUuid() { + return riskUnitUuid; + } + + public void setRiskUnitUuid(String riskUnitUuid) { + this.riskUnitUuid = riskUnitUuid; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getRiskEventName() { + return riskEventName; + } + + public void setRiskEventName(String riskEventName) { + this.riskEventName = riskEventName; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskMapUpdateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskMapUpdateParams.java new file mode 100644 index 0000000..ec2606c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventRiskMapUpdateParams.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventRiskMapUpdateParams { + /** + * 主键 + */ + private Long id; + + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 描述信息 + */ + private String descInfo; + /** + * 修改人 + */ + private String lastEditUserName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskToUserParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskToUserParams.java new file mode 100644 index 0000000..91c03d7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskToUserParams.java @@ -0,0 +1,91 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class PreventTaskToUserParams { + + /** + * 主键 + */ + private Long id; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 执行人ID + */ + private Long execUserId; + /** + * 执行人Name + */ + private String execUserName; + /** + * 认领状态 + */ + private Byte taskBelong; + /** + * 执行人Name + */ + private Date belongTime; + + public Date getBelongTime() { + return belongTime; + } + + public void setBelongTime(Date belongTime) { + this.belongTime = belongTime; + } + + public Byte getTaskBelong() { + return taskBelong; + } + + public void setTaskBelong(Byte taskBelong) { + this.taskBelong = taskBelong; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Long getExecUserId() { + return execUserId; + } + + public void setExecUserId(Long execUserId) { + this.execUserId = execUserId; + } + + public String getExecUserName() { + return execUserName; + } + + public void setExecUserName(String execUserName) { + this.execUserName = execUserName; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskUnitAndMeasureParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskUnitAndMeasureParams.java new file mode 100644 index 0000000..16ef4fa --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/PreventTaskUnitAndMeasureParams.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.doublePrevention.repository.param; + + +import java.util.Date; + +public class PreventTaskUnitAndMeasureParams { + + /** + * 排查任务Id + * */ + private Long taskUnitId; + /** + * 最后修改时间 + */ + private Date gmtModitify; + /** + * 修改人 + */ + private String lastEditUserName; + /** + * 删除标志:0-有效,1-删除 + */ + private Byte deleteStatus; + + public Long getTaskUnitId() { + return taskUnitId; + } + + public void setTaskUnitId(Long taskUnitId) { + this.taskUnitId = taskUnitId; + } + + public Date getGmtModitify() { + return gmtModitify; + } + + public void setGmtModitify(Date gmtModitify) { + this.gmtModitify = gmtModitify; + } + + public String getLastEditUserName() { + return lastEditUserName; + } + + public void setLastEditUserName(String lastEditUserName) { + this.lastEditUserName = lastEditUserName; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/SearchReportDateParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/SearchReportDateParams.java new file mode 100644 index 0000000..b9b3a61 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/SearchReportDateParams.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class SearchReportDateParams { + + /** + * 同步时间 + */ + private Date reportTime; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 上报状态 1-待上报;2-已上报;3-不上报 + */ + private Byte reportStatus; + /** + * 上报开关 1-上报;2-不上报 + */ + private Byte reportSwitch; + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getReportStatus() { + return reportStatus; + } + + public void setReportStatus(Byte reportStatus) { + this.reportStatus = reportStatus; + } + + public Byte getReportSwitch() { + return reportSwitch; + } + + public void setReportSwitch(Byte reportSwitch) { + this.reportSwitch = reportSwitch; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/repository/param/UpdateRectifyResultParams.java b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/UpdateRectifyResultParams.java new file mode 100644 index 0000000..bda7e57 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/repository/param/UpdateRectifyResultParams.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.doublePrevention.repository.param; + +import java.util.Date; + +public class UpdateRectifyResultParams { + /** + * 隐患Id + */ + private Long dangerManagerId; + /** + * 同步数据修改时间 + */ + private Date updateReportDataTime; + /** + * 隐患状态 + */ + private Byte dangerStatus; + + public Long getDangerManagerId() { + return dangerManagerId; + } + + public void setDangerManagerId(Long dangerManagerId) { + this.dangerManagerId = dangerManagerId; + } + + public Date getUpdateReportDataTime() { + return updateReportDataTime; + } + + public void setUpdateReportDataTime(Date updateReportDataTime) { + this.updateReportDataTime = updateReportDataTime; + } + + public Byte getDangerStatus() { + return dangerStatus; + } + + public void setDangerStatus(Byte dangerStatus) { + this.dangerStatus = dangerStatus; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/ExecReportDateSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/ExecReportDateSchedule.java new file mode 100644 index 0000000..e4f325a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/ExecReportDateSchedule.java @@ -0,0 +1,663 @@ +package com.gk.hotwork.doublePrevention.scheduls; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Log.HiddenDangerLogAspect; +import com.gk.hotwork.doublePrevention.entity.dto.report.ReportResultDTO; +import com.gk.hotwork.doublePrevention.utils.BeanCopyUtils; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.report.HandlerDO.*; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import com.gk.hotwork.doublePrevention.utils.AesGcm256Util; +import org.apache.commons.lang3.ObjectUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.*; + +@Component +public class ExecReportDateSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(ExecReportDateSchedule.class); + + @Autowired + private ReportService reportService; + + @Autowired + private PreventReportRiskAnaUnitService riskAnaUnitService; + @Autowired + private PreventReportRiskEventService eventService; + @Autowired + private PreventReportRiskControlMeasureService measureService; + @Autowired + private PreventReportCheckTaskFromWorkService taskFromWorkService; + @Autowired + private PreventReportCheckRecordFromTaskService taskRecordService; + @Autowired + private PreventReportDangerInfoService dangerInfoService; + + @Autowired + private PreventRiskAnaUnitService preventRiskUnitService; + @Autowired + private PreventRiskEventService preventRiskEventService; + @Autowired + private PreventRiskControlMeasureService preventRiskControlMeasureService; + @Autowired + private PreventDangerCheckContentService preventDangerCheckContentService; + @Autowired + private PreventRiskControlTemplateService preventRiskControlTemplateService; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventDangerManageService preventDangerManageService; + @Autowired + private PreventDangerRectifyService preventDangerRectifyService; + @Autowired + private PreventWorkAndMeasureService preventWorkAndMeasureService; + @Autowired + private PreventTaskAndMeasureService preventTaskAndMeasureService; + @Autowired + private PreventReportBatchService preventReportBatchService; + + @Transactional + @Scheduled(cron = "0 0 0/2 * * ? ") +// @Scheduled(cron = "0/10 * * * * ?") + public void execReportDateSchedule(){ + logger.info("【¥¥】上报数据开始..."); + System.out.println("【¥¥】上报数据开始..."); + Date date = new Date(); + HttpURLConnection con = null; + BufferedReader buffer = null; + int responseCode = 200; + //格式化时间,作为token的时间戳 + SimpleDateFormat tokenDate= new SimpleDateFormat("yyyyMMddHHMMssSSS"); + String formatDate = tokenDate.format(date); + + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss"); + + String token = "4348187236"; + String key = "84702E415A73CE27077B5F726E7BDBB0"; + String iv = "1C7AA98593AA69F4AAE119BD5C01D9ED"; + + /**1、处理安全风险分析单元数据*/ + logger.info("【【##】】处理安全风险分析单元数据"); + System.out.println("【【##】】1、处理安全风险分析单元数据..."); + List<PreventReportRiskAnaUnit> riskAnaUnits = riskAnaUnitService.listReportUnitDate(); + if (ObjectUtils.isNotEmpty(riskAnaUnits)){ + //封装上报数据 + List<ReportRiskAnaUnitDTO> reportRiskAnaUnitList = new ArrayList<>(); + for (PreventReportRiskAnaUnit riskAnaUnit : riskAnaUnits) { + ReportRiskAnaUnitDTO unit = BeanCopyUtils.copyBean(riskAnaUnit, ReportRiskAnaUnitDTO.class); + unit.setCreateDate(dateFormat.format(riskAnaUnit.getCreateDate())); + unit.setUpdateDate(dateFormat.format(riskAnaUnit.getUpdateDate())); + reportRiskAnaUnitList.add(unit); + } + //加密数据 + String reportUnitDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRiskAnaUnitList).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + StringBuffer unitResultBuffer = null; + System.out.println("安全风险分析单元数据加密完成"); + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveUnitList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token + formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportUnitDate); /**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + System.out.println("获取响应流"); + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + unitResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + unitResultBuffer.append(line); + } + logger.info("【【##】】riskUnitResult:" + date + "\n" + unitResultBuffer.toString()); + System.out.println("分析单元上报结果:" + date + unitResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + //遍历数据,更改原始表、上报表状态 + + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + for (PreventReportRiskAnaUnit riskAnaUnit : riskAnaUnits) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(riskAnaUnit.getRiskUnitId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + riskAnaUnitService.updateReportStatus(handlerReportParam); + preventRiskUnitService.updateReportStatus(handlerReportParam); + + idTextBuffer.append(riskAnaUnit.getId() + ";"); + } + ReportResultDTO unitResult = JSONObject.parseObject(unitResultBuffer.toString(), ReportResultDTO.class); + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(unitResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setReportTime(date); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + preventReportBatchService.insertBatchId(reportBatch); + + System.out.println("安全风险分析单元数据处理完成。"); + }else { + System.out.println("***安全风险分析单元数据处理完成。"); + } + + + /**2、处理安全风险事件数据*/ + logger.info("【【##】】处理安全风险事件数据"); + System.out.println("【【##】】2、处理安全风险事件数据..."); + List<PreventReportRiskEvent> events = eventService.listReportEventDate(); + if (ObjectUtils.isNotEmpty(events)){ + //封装上报数据 + List<ReportRiskEventDTO> reportRiskEventList = new ArrayList<>(); + for (PreventReportRiskEvent event : events) { + ReportRiskEventDTO riskEvent = BeanCopyUtils.copyBean(event, ReportRiskEventDTO.class); + riskEvent.setCreateDate(dateFormat.format(event.getCreateDate())); + riskEvent.setUpdateDate(dateFormat.format(event.getUpdateDate())); + reportRiskEventList.add(riskEvent); + } + //加密数据 + String reportEventDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRiskEventList).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + + StringBuffer eventResultBuffer = null; + + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveEventList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token+formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportEventDate); /**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //得到响应码 + responseCode = con.getResponseCode(); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + eventResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + eventResultBuffer.append(line); + } + logger.info("【【##】】eventResult:" + date + "\n" + eventResultBuffer.toString()); + System.out.println("风险事件上报结果:" + date + "\n" + eventResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + //遍历数据,更改原始表、上报表状态 + for (PreventReportRiskEvent event : events) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(event.getRiskEventId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + eventService.updateEventReportStatus(handlerReportParam); + preventRiskEventService.updateEventReportStatus(handlerReportParam); + + idTextBuffer.append(event.getId() + ";"); + } + ReportResultDTO eventResult = JSONObject.parseObject(eventResultBuffer.toString(), ReportResultDTO.class); + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(eventResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setReportTime(date); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + preventReportBatchService.insertBatchId(reportBatch); + + System.out.println("安全风险分析事件数据处理完成。"); + }else { + System.out.println("***安全风险分析事件数据处理完成。"); + } + + + + /**3、处理风险管控措施数据*/ + logger.info("【【##】】处理风险管控措施数据"); + System.out.println("【【##】3、处理风险管控措施数据..."); + List<PreventReportRiskControlMeasure> measures = measureService.listReportMeasureDate(); + if (ObjectUtils.isNotEmpty(measures)){ + //封装上报数据 + List<ReportRiskControlMeasureDTO> reportMeasureList = new ArrayList<>(); + for (PreventReportRiskControlMeasure measure : measures) { + ReportRiskControlMeasureDTO controlMeasure = BeanCopyUtils.copyBean(measure, ReportRiskControlMeasureDTO.class); + controlMeasure.setCreateDate(dateFormat.format(measure.getCreateDate())); + controlMeasure.setUpdateDate(dateFormat.format(measure.getUpdateDate())); + reportMeasureList.add(controlMeasure); + } + + //数据上报 + String reportMeasureDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportMeasureList).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + StringBuffer measureResultBuffer = null; + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveControlMeasuresList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token + formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportMeasureDate); /**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //得到响应码 + responseCode = con.getResponseCode(); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + measureResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + measureResultBuffer.append(line); + } + logger.info("【【##】】measureResult:" + date + "\n" + measureResultBuffer.toString()); + System.out.println("管控措施数据上报结果:" + date + "\n" + measureResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + //遍历数据,更改原始表、上报表状态 + for (PreventReportRiskControlMeasure measure : measures) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(measure.getRiskMeasureId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + measureService.updateMeasureReportStatus(handlerReportParam); + preventRiskControlMeasureService.updateMeasureReportStatus(handlerReportParam); + + idTextBuffer.append(measure.getId() + ";"); + } + ReportResultDTO measureResult = JSONObject.parseObject(measureResultBuffer.toString(), ReportResultDTO.class); + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(measureResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setReportTime(date); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + preventReportBatchService.insertBatchId(reportBatch); + + + System.out.println("管控措施数据处理完成。"); + }else { + System.out.println("***管控措施数据处理完成。"); + } + + + /**4、处理 任务-配置 数据*/ + logger.info("【【##】】处理任务配置 数据"); + System.out.println("【【##】4、处理任务配置数据..."); + List<PreventReportCheckTaskFromWork> taskFromWorks = taskFromWorkService.listReportTaskFromWorkDate(); + if (ObjectUtils.isNotEmpty(taskFromWorks)){ + //封装上报数据 + List<ReportCheckTaskFromWorkDTO> reportCheckTaskFromWorkList = new ArrayList<>(); + for (PreventReportCheckTaskFromWork taskFromWork : taskFromWorks) { + ReportCheckTaskFromWorkDTO checkWork = BeanCopyUtils.copyBean(taskFromWork, ReportCheckTaskFromWorkDTO.class); + checkWork.setCreateDate(dateFormat.format(taskFromWork.getCreateDate())); + checkWork.setUpdateDate(dateFormat.format(taskFromWork.getUpdateDate())); + reportCheckTaskFromWorkList.add(checkWork); + } + + //数据上报 + String reportTaskFromWorkDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportCheckTaskFromWorkList).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + StringBuffer taskFromWorkResultBuffer = null; + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveMeasuresTaskList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token+formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportTaskFromWorkDate); /**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //得到响应码 + responseCode = con.getResponseCode(); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + taskFromWorkResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + taskFromWorkResultBuffer.append(line); + } + logger.info("【【##】】workResult:" + date + "\n" + taskFromWorkResultBuffer.toString()); + System.out.println("任务配置上报结果:" + date + "\n" + taskFromWorkResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + //遍历数据,更改原始表、上报表状态 + for (PreventReportCheckTaskFromWork taskFromWork : taskFromWorks) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(taskFromWork.getWorkId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + taskFromWorkService.updateWorkReportStatus(handlerReportParam); + preventDangerCheckWorkService.updateWorkReportStatus(handlerReportParam); + + idTextBuffer.append(taskFromWork.getId() + ";"); + } + ReportResultDTO taskFromWorkResult = JSONObject.parseObject(taskFromWorkResultBuffer.toString(), ReportResultDTO.class); + + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(taskFromWorkResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setReportTime(date); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + preventReportBatchService.insertBatchId(reportBatch); + + System.out.println("任务配置数据处理完成。"); + }else { + System.out.println("***任务配置数据处理完成。"); + } + + + /**5、处理 任务-记录 数据*/ + logger.info("【【##】】处理任务记录数据"); + System.out.println("【【##】】5、处理任务记录数据..."); + List<PreventReportCheckRecordFromTask> recordFromTasks = taskRecordService.listReportTaskRecordDate(); + if (ObjectUtils.isNotEmpty(recordFromTasks)){ + //封装上报数据 + List<ReportCheckRecordFromTaskDTO> reportRecordFromTaskList = new ArrayList<>(); + for (PreventReportCheckRecordFromTask recordFromTask : recordFromTasks) { + ReportCheckRecordFromTaskDTO checkTask = BeanCopyUtils.copyBean(recordFromTask, ReportCheckRecordFromTaskDTO.class); + checkTask.setCreateDate(dateFormat.format(recordFromTask.getCreateDate())); + checkTask.setUpdateDate(dateFormat.format(recordFromTask.getUpdateDate())); + checkTask.setCheckTime(dateFormat.format(recordFromTask.getCheckTime())); + reportRecordFromTaskList.add(checkTask); + } + + //数据上报 + String reportRecordFromTaskDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportRecordFromTaskList).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + StringBuffer recordFromTaskResultBuffer = null; + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveMeasuresTaskRecordList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token+formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportRecordFromTaskDate);/**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //得到响应码 + responseCode = con.getResponseCode(); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + recordFromTaskResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + recordFromTaskResultBuffer.append(line); + } + logger.info("【【##】】taskResult:" + date + "\n" + recordFromTaskResultBuffer.toString()); + System.out.println("任务记录上报结果:" + date + "\n" + recordFromTaskResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + //遍历数据,更改原始表、上报表状态 + for (PreventReportCheckRecordFromTask recordFromTask : recordFromTasks) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(recordFromTask.getTaskId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + taskRecordService.updateTaskReportStatus(handlerReportParam); + preventDangerCheckTaskService.updateTaskReportStatus(handlerReportParam); + + idTextBuffer.append(recordFromTask.getId() + ";"); + } + ReportResultDTO recordFromTaskResult = JSONObject.parseObject(recordFromTaskResultBuffer.toString(), ReportResultDTO.class); + + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(recordFromTaskResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setReportTime(date); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + preventReportBatchService.insertBatchId(reportBatch); + + System.out.println("任务记录数据处理完成。"); + }else { + System.out.println("***任务记录数据处理完成。"); + } + + + /**6、处理隐患信息数据*/ + logger.info("【【##】】处理隐患信息数据"); + System.out.println("【【##】】6、处理隐患信息数据..."); + List<PreventReportDangerInfo> dangerInfos = dangerInfoService.listReportDangerDate(); + if (ObjectUtils.isNotEmpty(dangerInfos)){ + //封装上报数据 + List<ReportDangerInfoDTO> reportDangerInfoLists = new ArrayList<>(); + for (PreventReportDangerInfo dangerInfo : dangerInfos) { + ReportDangerInfoDTO danger = BeanCopyUtils.copyBean(dangerInfo, ReportDangerInfoDTO.class); + danger.setCreateDate(dateFormat.format(dangerInfo.getCreateDate())); + danger.setUpdateDate(dateFormat.format(dangerInfo.getUpdateDate())); + danger.setRegistTime(dateFormat.format(dangerInfo.getRegistTime())); + danger.setDangerManageDeadline(dateFormat.format(dangerInfo.getDangerManageDeadline())); + if (ObjectUtils.isNotEmpty(dangerInfo.getCheckAcceptTime())){ + danger.setCheckAcceptTime(dateFormat.format(dangerInfo.getCheckAcceptTime())); + }else { + danger.setCheckAcceptTime(null); + } + reportDangerInfoLists.add(danger); + } + + //数据上报 + String reportDangerInfoDate = AesGcm256Util.encrypt(JSONArray.toJSON(reportDangerInfoLists).toString(), + AesGcm256Util.hexToByte("84702E415A73CE27077B5F726E7BDBB0"), + AesGcm256Util.hexToByte("1C7AA98593AA69F4AAE119BD5C01D9ED")); + StringBuffer dangerInfoResultBuffer = null; + //上报数据 + try { + URL url = new URL("http://220.171.99.118:6022/v2/data/receive/receiveDangerInvestigationList"); + //得到连接对象 + con = (HttpURLConnection) url.openConnection(); + //设置请求类型 + con.setRequestMethod("POST"); + //设置Content-Type,此处根据实际情况确定 + con.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); + //允许写出 + con.setDoOutput(true); + //允许读入 + con.setDoInput(true); + //不使用缓存 + con.setUseCaches(false); + //设置请求头 + con.setRequestProperty("Authorization",token + formatDate.toString()); + OutputStream os = con.getOutputStream(); + Map paraMap = new HashMap(); + paraMap.put("data", reportDangerInfoDate);/**封装数据*/ + //组装入参,设置请求体 + os.write(JSON.toJSONString(paraMap).getBytes()); + //得到响应码 + responseCode = con.getResponseCode(); + //本段日志,测试成功后,可注释掉 + if (responseCode == HttpURLConnection.HTTP_OK) { + //得到响应流 + InputStream inputStream = con.getInputStream(); + //将响应流转换成字符串 + dangerInfoResultBuffer = new StringBuffer(); + String line; + buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + while ((line = buffer.readLine()) != null) { + dangerInfoResultBuffer.append(line); + } + logger.info("【【##】】dangerResult:" + date + "\n" + dangerInfoResultBuffer.toString()); + System.out.println("隐患信息上传结果:" + date + "\n" + dangerInfoResultBuffer.toString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + //拼接上报数据的uuid + StringBuffer idTextBuffer = new StringBuffer(); + + //遍历数据,更改原始表、上报表状态 + for (PreventReportDangerInfo dangerInfo : dangerInfos) { + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //封装数据 + handlerReportParam.setId(dangerInfo.getDangerManagerId()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_EXEC_SUCCESS.getCode()); + handlerReportParam.setReportTime(date); + dangerInfoService.updateTaskReportStatus(handlerReportParam); + preventDangerManageService.updateManageReportStatus(handlerReportParam); + preventDangerRectifyService.updateRectifyReportStatus(handlerReportParam); + + idTextBuffer.append(dangerInfo.getId() + ";"); + + } + ReportResultDTO dangerInfoResult = JSONObject.parseObject(dangerInfoResultBuffer.toString(), ReportResultDTO.class); + + //获取返回值封装对象 + PreventReportBatch reportBatch = new PreventReportBatch(); + reportBatch.setBatchId(dangerInfoResult.getObj().getBatchId()); + reportBatch.setDataSource(idTextBuffer.toString()); + reportBatch.setDataType(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + reportBatch.setReportTime(date); + preventReportBatchService.insertBatchId(reportBatch); + + System.out.println("隐患信息数据处理完成。"); + }else { + System.out.println("***隐患信息数据处理完成。"); + } + + + logger.info("【【##】】本批次上报数据完成..."); + + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventDangerCheckWorkSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventDangerCheckWorkSchedule.java new file mode 100644 index 0000000..95a7874 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventDangerCheckWorkSchedule.java @@ -0,0 +1,147 @@ +package com.gk.hotwork.doublePrevention.scheduls; + + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.enums.WorkStatusEnum; +import com.gk.hotwork.doublePrevention.mq.msg.PreventCreateTaskMsg; +import com.gk.hotwork.doublePrevention.repository.param.CheckWorkAutoUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckWorkService; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + + +@Component +public class PreventDangerCheckWorkSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(PreventDangerCheckWorkSchedule.class); + + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + + @Value("${rocketmq.topic.preventCreateTaskTopic}") + private String preventCreateTaskTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + public PreventDangerCheckWorkSchedule() { + } + + @Transactional + @Scheduled(cron = "0 0/10 * * * ?") + public void createNewWorkTask() throws Exception { + logger.info("【双重预防-排查任务检索】开始执行......"); + //System.out.println("【11】定时任务开始执行......"); + + List<PreventDangerCheckWork> checkWorkLists = preventDangerCheckWorkService.listScheduleCheckWork(); + + //当前存在开启状态的作业 + if (checkWorkLists != null && checkWorkLists.size() > 0 ) { + //遍历work集合 + for (PreventDangerCheckWork checkWork : checkWorkLists) { + Date date = new Date(); + Date nextCheckTime = null; + Date noticeTime = null; + Byte ExecTaskTag; + //TODO 排班改为在此处判断 暂无 + //解析任务通知时间毫秒数 + if (ObjectUtils.isNotEmpty(checkWork.getNextCheckTime())){ + if (checkWork.getNoticeTimeUnit() == 1) { + //如果时间单位是分钟 + noticeTime = new Date(checkWork.getNextCheckTime().getTime() - checkWork.getNoticeTime() * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 2) { + //如果时间单位是小时 + noticeTime = new Date(checkWork.getNextCheckTime().getTime() - checkWork.getNoticeTime() * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 3) { + //如果时间单位是日 + noticeTime = new Date(checkWork.getNextCheckTime().getTime() - checkWork.getNoticeTime() * 24 * 60 * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(checkWork.getNextCheckTime());//设置起时间 + calendar.add(Calendar.MONTH, -checkWork.getNoticeTime());//增加N个月 + noticeTime = calendar.getTime(); + } + nextCheckTime = checkWork.getNextCheckTime(); + }else { + //如果是第一次调度 + if (checkWork.getNoticeTimeUnit() == 1) { + //如果时间单位是分钟 + noticeTime = new Date(checkWork.getFirstStartTime().getTime() - checkWork.getNoticeTime() * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 2) { + //如果时间单位是小时 + noticeTime = new Date(checkWork.getFirstStartTime().getTime() - checkWork.getNoticeTime() * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 3) { + //如果时间单位是日 + noticeTime = new Date(checkWork.getFirstStartTime().getTime() - checkWork.getNoticeTime() * 24 * 60 * 60 * 1000); + }else if (checkWork.getNoticeTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(checkWork.getFirstStartTime());//设置起时间 + calendar.add(Calendar.MONTH, -checkWork.getNoticeTime());//增加N个月 + noticeTime = calendar.getTime(); + } + nextCheckTime = checkWork.getFirstStartTime(); + } + + //检查当前作业产生的任务列表,如果存在待执行,执行中的任务,不生成下一条任务 + List<PreventDangerCheckTask> taskByCheckWorkId = preventDangerCheckTaskService.getTaskByCheckWorkId(checkWork.getId()); + //判断作业配置的开始时间,是否处于发送成任务消息的时间区间--在通知前20分钟,把创建任务消息,发送给mq + //添加判断,下次执行时间大于当前时间,作业状态为开启中 + //TODO 根据任务判断,现在已经临时删除 + if (checkWork.getCheckWorkStatus() == WorkStatusEnum.WORK_OPEN.getCode() && nextCheckTime.getTime() > date.getTime() - 10 * 60 * 1000L + && date.getTime() > noticeTime.getTime() - 30 * 60 * 1000 ) { + //设置任务创建时间,在通知之前30分钟,创建任务 + Date createTime = date; +// //如果 当前时间 - 通知时间 < 5分钟,任务立即创建。否则在通知前五分钟创建 +// if (date.getTime() - noticeTime.getTime() < 5 * 60 * 1000){ +// createTime = new Date(noticeTime.getTime() - 5 * 60 * 1000); +// }else { +// createTime = date; +// } + //获取mq消息体 + PreventCreateTaskMsg preventCreateTaskMsg = new PreventCreateTaskMsg(); + preventCreateTaskMsg.setWorkId(checkWork.getId()); + preventCreateTaskMsg.setCreateTaskTime(createTime); + + SendResult sendResult = rocketMQTemplate.syncSend(preventCreateTaskTopic, preventCreateTaskMsg); + if (sendResult.getSendStatus() != SendStatus.SEND_OK) { + throw new BusinessException(ResultCodes.BUSINESS_ERROR); + } + logger.info("\n【##】创建巡检任务消息 " + " 已发送--->>" + " MSGID: " + sendResult.getMsgId() + " 创建时间: " + createTime); +// System.out.println("\n【##】创建巡检任务消息 " + " 已发送--->>" + " MSGID: " + sendResult.getMsgId() + " 创建时间: " + createTime); + //将作业状态设置为已调度 + CheckWorkAutoUpdateParams updateWorkParams = new CheckWorkAutoUpdateParams(); + updateWorkParams.setCheckWorkStatus((byte) 5); + updateWorkParams.setId(checkWork.getId()); + preventDangerCheckWorkService.updateCheckWorkStatus(updateWorkParams); + }else if(nextCheckTime.getTime() - date.getTime() < 0){ + logger.info("【##】当前存在作业开始时间不合理,此作业无法调度" + checkWork.getCheckWorkName()); + }else{ + logger.info("【##】当前存在作业未到调度时间"); + } + } + }else { + logger.info("\n【##】当前---无可调度作业"); + } + + System.out.println("【11】定时任务执行结束......"); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetTaskSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetTaskSchedule.java new file mode 100644 index 0000000..6c78ada --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetTaskSchedule.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.doublePrevention.scheduls; + +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.enums.CheckTaskStatusEnum; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.util.Date; +import java.util.List; + +@Component +public class PreventResetTaskSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(PreventDangerCheckWorkSchedule.class); + + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + + @Transactional + @Scheduled(cron = "0 0/30 * * * ?") +// @PostConstruct + public void resetTask(){ + + //确定检查时间为8小时内的任务 + Date endTime = new Date(); + Date startTime = new Date(endTime.getTime() - 8 * 60 * 60 * 1000L); + /**查询应该已经过期,但是还在执行中状态的任务*/ + List<PreventDangerCheckTask> overTaskList = preventDangerCheckTaskService.listOverTask(startTime, endTime); + if (ObjectUtils.isNotEmpty(overTaskList)){ + for (PreventDangerCheckTask overTask : overTaskList) { + preventDangerCheckTaskService.updateTaskStatus(overTask.getId(), CheckTaskStatusEnum.STATU_OVERTIME.getStatus()); + } + } + + /**查询应该已经开始,但是还在待执行状态的任务*/ + //查询开始时间小于当前时间,有效期大于当前时间的任务 + List<PreventDangerCheckTask> waitExecTaskList = preventDangerCheckTaskService.listWaitExecTask(endTime); + if (ObjectUtils.isNotEmpty(waitExecTaskList)){ + for (PreventDangerCheckTask waitExecTask : waitExecTaskList) { + preventDangerCheckTaskService.updateTaskStatus(waitExecTask.getId(), CheckTaskStatusEnum.STATU_EXEUTE.getStatus()); + + } + } + + /**查询应该已经结束,但是还在执行中状态的任务*/ + //查询开始时间小于当前时间,有效期大于当前时间的任务 + List<PreventDangerCheckTask> timeOutTaskList = preventDangerCheckTaskService.listTimeOutTask(endTime); + if (ObjectUtils.isNotEmpty(timeOutTaskList)){ + for (PreventDangerCheckTask timeOutTask : timeOutTaskList) { + preventDangerCheckTaskService.updateTaskStatus(timeOutTask.getId(), CheckTaskStatusEnum.STATU_OVERTIME.getStatus()); + + } + } + + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetWorkTimeSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetWorkTimeSchedule.java new file mode 100644 index 0000000..de14f48 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventResetWorkTimeSchedule.java @@ -0,0 +1,149 @@ +package com.gk.hotwork.doublePrevention.scheduls; + +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckWorkService; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +@Component +public class PreventResetWorkTimeSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(PreventResetWorkTimeSchedule.class); + + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private DangerService dangerService; + + + @Transactional + @Scheduled(cron = "0 0/20 * * * ?") +// @Scheduled(cron = "0 0/1 * * * ?") +// @Scheduled(cron = "0/20 * * * * ?") + + public void resetWork(){ + + logger.info("【】检索时间异常作业"); + System.out.println("【】检索时间异常作业"); + + Date date= new Date(); + Date errorTime = new Date(date.getTime() - 10 * 60 * 1000L); + + List<PreventDangerCheckWork> errorWorkList = preventDangerCheckWorkService.listErrorCheckWork(errorTime); + if (ObjectUtils.isNotEmpty(errorWorkList)){ + + System.out.println("处理异常作业"); + + for (PreventDangerCheckWork workById : errorWorkList) { + + Long validTimeSecond = null; + Long cycleSecond = null; + Date resetTime = null; + Date startTime = null; +// Date validTime = null; + + //如果是第一次调度,以firstTime为标准;否则以nextTime为标准 + if (workById.getValidTimeUnit() == 1) { + //如果时间单位是分钟 + validTimeSecond = workById.getValidTime() * 60 * 1000L; + }else if (workById.getValidTimeUnit() == 2) { + //如果时间单位是小时 + validTimeSecond = workById.getValidTime() * 60 * 60 * 1000L; + }else if (workById.getValidTimeUnit() == 3) { + //如果时间单位是日 + validTimeSecond = workById.getValidTime() * 24 * 60 * 60 * 1000L; + }else if (workById.getValidTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getNextCheckTime());//设置起时间 + calendar.add(Calendar.MONTH, workById.getValidTime());//增加N个月 + Date validTime = calendar.getTime(); + if (ObjectUtils.isNotEmpty(workById.getLastCheckTime())){ + validTimeSecond =validTime.getTime() - workById.getLastCheckTime() .getTime(); + } + validTimeSecond =validTime.getTime() - workById.getFirstStartTime() .getTime(); + } + + //解析调度周期时间间隔,work的下次执行时间 + if (workById.getCheckCycleUnit() == 1) { + //如果时间单位是分钟 + cycleSecond = workById.getCheckCycle() * 60 * 1000L; + }else if (workById.getCheckCycleUnit() == 2) { + //如果时间单位是小时 + cycleSecond = workById.getCheckCycle() * 60 * 60 * 1000L; + }else if (workById.getCheckCycleUnit() == 3) { + //如果时间单位是日 + cycleSecond = workById.getCheckCycle() * 24 * 60 * 60 * 1000L; + }else if (workById.getCheckCycleUnit() == 4) { + +// cycleSecond = workById.getCheckCycle() * 30 * 24 * 60 * 60 * 1000L; + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getNextCheckTime());//设置起时间 + calendar.add(Calendar.MONTH, workById.getCheckCycle());//增加N个月 + cycleSecond = calendar.getTime().getTime(); + } + //任务周期 毫秒数 + Long workCycle = cycleSecond + validTimeSecond; + + //定位重置任务周期的初始时间 + resetTime = workById.getFirstStartTime(); + + // System.out.println("周期解析完成,设置上次执行时间"); + + //循环定位任务周期,时间定位到当前时间之后,最近的一个周期点 + while (resetTime.getTime() < date.getTime()){ + resetTime = new Date(resetTime.getTime() + workCycle); + } + //重置时间回滚一个周期,定位为当前任务创建时间 + startTime =new Date(resetTime.getTime() - workCycle); + + + //如果距离下个周期还有一小时以上,重置为上一个周期,立即调度任务;否则只重置时间到下一个周期 + if (resetTime.getTime() - date.getTime() > 60 * 60 * 1000L ){ + //System.out.println("定位任务下一周期完成"); + //重置作业 + int step = 1; + int result = preventDangerCheckWorkService.resetErrorWork(startTime, workById.getId()); + if (result == 1){ + step ++; + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID ,"重置异常作业时间失败"); + } + // 立即生成一次任务 + if (step == 2){ + dangerService.createAutoTask(workById.getId()); + logger.info("异常任务已重置,立即生成一条可执行任务"); + System.out.println("异常任务已重置,立即生成一条可执行任务"); + } +// System.out.println("异常作业已重置"); + }else { + //重置作业时间 + int result = preventDangerCheckWorkService.resetErrorWork(resetTime, workById.getId()); + if (result < 1){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID ,"重置异常作业时间失败"); + } + } + System.out.println("重置异常作业完成"); + } + + }else { + logger.info("【】无异常需要处理"); + System.out.println("【】无异常需要处理"); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventSearchWorkStatusSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventSearchWorkStatusSchedule.java new file mode 100644 index 0000000..0ba9e74 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/PreventSearchWorkStatusSchedule.java @@ -0,0 +1,50 @@ +package com.gk.hotwork.doublePrevention.scheduls; + +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckWorkService; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Date; +import java.util.List; + +@Component +public class PreventSearchWorkStatusSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(PreventSearchWorkStatusSchedule.class); + + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + + @Scheduled(cron = "0 0/20 * * * ?") + //@PostConstruct + public void searchTask(){ + logger.info("【】重置任务状态开始执行...."); + Date date = new Date(); + Date startTime = null; + Date endTime = null; + + startTime = date; + endTime = new Date(date.getTime() + 60 * 60 * 1000L); + //检查后面30分钟内的所有work,看是否有未关闭,且未生成任务的,如果 + //检索所有即将到时间的任务 ,nextExecTime + List<PreventDangerCheckWork> checkWorkList = preventDangerCheckWorkService.listExecCheckWork(startTime, endTime); + + for (PreventDangerCheckWork checkWork : checkWorkList) { + PreventDangerCheckTask task = preventDangerCheckTaskService.getTaskByCheckWorkIdAndStartTime(checkWork.getId(), checkWork.getNextCheckTime()); + if (ObjectUtils.isEmpty(task)){ + preventDangerCheckWorkService.resetCheckWorkStatus(checkWork.getId()); + } + } + logger.info("【】重置任务状态执行结束"); + + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/scheduls/SearchReportDateSchedule.java b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/SearchReportDateSchedule.java new file mode 100644 index 0000000..db9e9ad --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/scheduls/SearchReportDateSchedule.java @@ -0,0 +1,641 @@ +package com.gk.hotwork.doublePrevention.scheduls; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Service.RiskControlClassifyService; +import com.gk.hotwork.Service.UserService; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import org.apache.commons.lang3.ObjectUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +@Component +public class SearchReportDateSchedule { + + private static final org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SearchReportDateSchedule.class); + + @Autowired + private AccountAuthService accountAuthService; + @Autowired + private UserService userService; + @Autowired + private RiskControlClassifyService riskControlClassifyService; + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private PreventReportConfigLogService preventReportConfigLogService; + + @Autowired + private PreventReportRiskAnaUnitService riskAnaUnitService; + @Autowired + private PreventReportRiskEventService eventService; + @Autowired + private PreventReportRiskControlMeasureService measureService; + @Autowired + private PreventReportCheckTaskFromWorkService taskFromWorkService; + @Autowired + private PreventReportCheckRecordFromTaskService taskRecordService; + @Autowired + private PreventReportDangerInfoService dangerInfoService; + + @Autowired + private PreventRiskAnaUnitService preventRiskUnitService; + @Autowired + private PreventRiskEventService preventRiskEventService; + @Autowired + private PreventRiskControlMeasureService preventRiskControlMeasureService; + @Autowired + private PreventDangerCheckContentService preventDangerCheckContentService; + @Autowired + private PreventRiskControlTemplateService preventRiskControlTemplateService; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventDangerManageService preventDangerManageService; + @Autowired + private PreventDangerRectifyService preventDangerRectifyService; + @Autowired + private PreventWorkAndMeasureService preventWorkAndMeasureService; + @Autowired + private PreventTaskAndMeasureService preventTaskAndMeasureService; + + + @Transactional + @Scheduled(cron = "* * 3 * * ? ") +// @Scheduled(cron = "0/10 * * * * ? ") +// @PostConstruct + public void searchReportDate(){ + + logger.info("【***】定时检索需要上报数据..."); +// System.out.println("【***】定时检索需要上报数据..."); + int step = 1; + + String companyCode = "652910016"; + + /** + * 1、检索风险分析单元 + * */ + //读取风险分析单元数据上报主配置信息 + PreventReportConfig unitReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //如果主配置开启上报,开始 + if (unitReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + + logger.info("【***】1.检索风险分析单元..."); +// System.out.println("【***】1.检索风险分析单元..."); + + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventRiskAnaUnit> riskAnaUnitList = preventRiskUnitService.listRiskAnaUnit(); + //获取上报数据list + List<PreventReportRiskAnaUnit> unitLists = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(riskAnaUnitList)){ + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //遍历,封装数据 + for (PreventRiskAnaUnit riskAnaUnit : riskAnaUnitList) { + + //获取上报数据对象 + PreventReportRiskAnaUnit reportRiskAnaUnit = new PreventReportRiskAnaUnit(); + + //封装风险分析单元数据 + reportRiskAnaUnit.setId(riskAnaUnit.getUuid()); + reportRiskAnaUnit.setCompanyCode(companyCode); + reportRiskAnaUnit.setRiskUnitName(riskAnaUnit.getRiskUnitName()); + reportRiskAnaUnit.setHazardCode(riskAnaUnit.getRiskCode()); + reportRiskAnaUnit.setHazardDep(riskAnaUnit.getLiableDep()); + reportRiskAnaUnit.setHazardLiablePerson(riskAnaUnit.getLiablePerson()); + reportRiskAnaUnit.setDeleted(riskAnaUnit.getDeleteStatus().toString()); + reportRiskAnaUnit.setCreateBy(riskAnaUnit.getCreateByUserName()); + reportRiskAnaUnit.setCreateDate(riskAnaUnit.getGmtCreate()); + reportRiskAnaUnit.setUpdateBy(riskAnaUnit.getLastEditUserName()); + reportRiskAnaUnit.setUpdateDate(riskAnaUnit.getGmtModitify()); + reportRiskAnaUnit.setDataSource(null); + reportRiskAnaUnit.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + reportRiskAnaUnit.setReportTime(null); + reportRiskAnaUnit.setRiskUnitId(riskAnaUnit.getId()); + //封装数据 + unitLists.add(reportRiskAnaUnit); + + //修改原始数据状态为待上传 + handlerReportParam.setId(riskAnaUnit.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventRiskUnitService.updateReportStatus(handlerReportParam); + } + }else { + logger.info("【***】当前无数据需要处理"); + } + for (PreventReportRiskAnaUnit unitList : unitLists) { + PreventReportRiskAnaUnit unitById = riskAnaUnitService.getUnitById(unitList.getId()); + if (ObjectUtils.isEmpty(unitById)){ + riskAnaUnitService.insertUnitList(unitList); + }else { + riskAnaUnitService.updateUnitById(unitList); + } +// logger.info("【***】1.风险分析单元:数据处理..."); +// System.out.println("【***】1.风险分析单元:数据处理..."); + } + step = 2; + }else { + step = 2; + logger.info("【***】风险分析单元数据上报已关闭"); + } + + + /** + * 2、检索安全风险事件数据 + * */ + //读取风险分析单元数据上报主配置信息 + PreventReportConfig eventReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + //如果风险事件主配置开启上报 + if (eventReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + + logger.info("【##】2.检索安全风险事件..."); +// System.out.println("【***】2.检索安全风险事件..."); + + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventRiskEvent> riskEvents = preventRiskEventService.listReportEvent(); + //获取上报数据对象与list + List<PreventReportRiskEvent> eventLists = new ArrayList<>(); + + if (ObjectUtils.isNotEmpty(riskEvents)){ + //遍历,封装数据 + for (PreventRiskEvent riskEvent : riskEvents) { + + HandlerReportParam handlerReportParam = new HandlerReportParam(); + PreventReportRiskEvent reportRiskEvent = new PreventReportRiskEvent(); + + //封装风险事件数据 + reportRiskEvent.setId(riskEvent.getUuid()); + reportRiskEvent.setCompanyCode(companyCode); + reportRiskEvent.setDeleted(riskEvent.getDeleteStatus().toString()); + reportRiskEvent.setCreateBy(riskEvent.getCreateByUserName()); + reportRiskEvent.setCreateDate(riskEvent.getGmtCreate()); + reportRiskEvent.setUpdateBy(riskEvent.getCreateByUserName()); + reportRiskEvent.setUpdateDate(riskEvent.getGmtModitify()); + reportRiskEvent.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + reportRiskEvent.setReportTime(null); + reportRiskEvent.setDataSource((byte) 1); + reportRiskEvent.setRiskUnitId(riskEvent.getRiskUnitUuid()); + reportRiskEvent.setRiskEventName(riskEvent.getRiskEventName()); + reportRiskEvent.setRiskEventId(riskEvent.getId()); + //封装数据 + eventLists.add(reportRiskEvent); + //设置原始数据上报状态 + handlerReportParam.setId(riskEvent.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventRiskEventService.updateEventReportStatus(handlerReportParam); + } + }else { +// System.out.println("【***】当前无安全风险事件数据需要处理"); + logger.info("【***】当前无安全风险事件数据需要处理"); + } +// System.out.println("【***】安全风险事件封装完成"); + for (PreventReportRiskEvent eventList : eventLists) { + PreventReportRiskEvent eventById = eventService.getEventById(eventList.getId()); + if (ObjectUtils.isEmpty(eventById)){ + int result = eventService.insertEventLists(eventList); + if (result < 0){ + throw new BusinessException(E.ADD_FAIL.getCode(), "风险分析事件插入失败"); + } + }else { + eventService.updateEventById(eventList); + } +// System.out.println("【***】2.风险分析事件:数据处理..."); + } + step = 3; + }else { + step = 3; + logger.info("【***】安全风险事件数据上报已关闭"); + } + + /** + * 3、检索安全风险管控措施数据 + * */ + //读取安全风险管控措施数据上报主配置信息 + PreventReportConfig measureReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //如果安全风险管控措施主配置开启上报 + if (measureReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + logger.info("{【##】3.检索安全风险管控措施..."); +// System.out.println("【***】3.检索安全风险管控措施..."); + + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventRiskControlMeasure> measures = preventRiskControlMeasureService.listReportMeasure(); + //获取上报数据list + List<PreventReportRiskControlMeasure> measureLists = new ArrayList<>(); + HandlerReportParam handlerReportParam = new HandlerReportParam(); + + if (ObjectUtils.isNotEmpty(measures)){ + //遍历,封装数据 + for (PreventRiskControlMeasure measure : measures) { + String classify2 = null; + + //获取上报数据对象 + PreventReportRiskControlMeasure reportMeasure = new PreventReportRiskControlMeasure(); + + if (measure.getClassify2() < 9 || measure.getClassify2() == 18){ + RiskControlClassify ControlById = riskControlClassifyService.getByControlId(measure.getClassify2()); + classify2 = measure.getClassify1() + "-" + ControlById.getOrderIndex(); + } + if ((measure.getClassify2() > 8 && measure.getClassify2() < 11) || measure.getClassify2() == 19){ + RiskControlClassify ControlById = riskControlClassifyService.getByControlId(measure.getClassify2()); + classify2 = measure.getClassify1() + "-" + ControlById.getOrderIndex(); + } + if ((measure.getClassify2() > 10 && measure.getClassify2() < 14) || measure.getClassify2() == 20){ + RiskControlClassify ControlById = riskControlClassifyService.getByControlId(measure.getClassify2()); + classify2 = measure.getClassify1() + "-" + ControlById.getOrderIndex(); + } + if ((measure.getClassify2() > 13 && measure.getClassify2() < 18) || measure.getClassify2() == 27){ + RiskControlClassify ControlById = riskControlClassifyService.getByControlId(measure.getClassify2()); + classify2 = measure.getClassify1() + "-" + ControlById.getOrderIndex(); + } + + //封装风险事件数据 + reportMeasure.setId(measure.getUuid()); + reportMeasure.setCompanyCode(companyCode); + reportMeasure.setDeleted(measure.getDeleteStatus().toString()); + reportMeasure.setCreateBy(measure.getCreateByUserName()); + reportMeasure.setCreateDate(measure.getGmtCreate()); + reportMeasure.setUpdateBy(measure.getCreateByUserName()); + reportMeasure.setUpdateDate(measure.getGmtModitify()); + reportMeasure.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + reportMeasure.setReportTime(null); + reportMeasure.setDataSource((byte) 1); + reportMeasure.setRiskEventId(measure.getRiskEventUuid()); + reportMeasure.setRiskMeasureDesc(measure.getMeasureDesc()); + //管控方式,措施分类 + reportMeasure.setDataSrc(measure.getControlType().toString()); + reportMeasure.setClassify1(measure.getClassify1().toString()); + reportMeasure.setClassify2(classify2); + reportMeasure.setClassify3(measure.getClassify3()); + reportMeasure.setRiskMeasureId(measure.getId()); + PreventDangerCheckContent contentByMeasureId = preventDangerCheckContentService.getCheckContentByMeasureId(measure.getId()); + reportMeasure.setTroubleshootContent(contentByMeasureId.getCheckContent()); + //封装数据 + measureLists.add(reportMeasure); + //设置原始数据上报状态 + handlerReportParam.setId(measure.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventRiskControlMeasureService.updateMeasureReportStatus(handlerReportParam); + } + }else { + logger.info("【***】当前无安全风险管控措施数据需要处理"); + } +// System.out.println("【***】安全风险管控措施数据封装完成..."); + step = 4; + for (PreventReportRiskControlMeasure measureList : measureLists) { + PreventReportRiskControlMeasure measureById = measureService.getMeasureById(measureList.getId()); + if (ObjectUtils.isEmpty(measureById)){ + int result = measureService.insertMeasureList(measureList); + if (result < 0){ + throw new BusinessException(E.ADD_FAIL.getCode(), "安全风险管控措施插入失败"); + } + }else { + String id = measureList.getId(); + measureService.updateMeasureById(measureList); + } +// System.out.println("【***】3.安全风险管控措施:数据处理..."); + } + }else { + step = 4; + logger.info("【***】安全风险管控措施数据上报已关闭"); + } + + /** + * 4、检索 任务配置 数据 prevent_report_check_record_from_task + * 本数据以 + * */ + //读取任务配置数据上报主配置信息 + PreventReportConfig workReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + //如果任务配置主配置开启上报 + if (workReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + logger.info("【##】4.检索任务配置..."); +// System.out.println("【***】4.检索任务配置..."); + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventDangerCheckWork> works = preventDangerCheckWorkService.listReportWork(); + //获取上报数据对象与list + List<PreventReportCheckTaskFromWork> taskFromWorkLists = new ArrayList<>(); + HandlerReportParam handlerReportParam = new HandlerReportParam(); + + if (ObjectUtils.isNotEmpty(works)){ + //遍历,封装数据 + for (PreventDangerCheckWork work : works) { + //获取work与措施关联信息 + List<PreventWorkAndMeasure> workAndMeasureLists = preventWorkAndMeasureService.getWorkAndMeasureByWorkUuid(work.getUuid()); + for (PreventWorkAndMeasure workAndMeasure : workAndMeasureLists) { +// System.out.println("封装数据..."); + PreventReportCheckTaskFromWork taskFromWork = new PreventReportCheckTaskFromWork(); + //查询措施 + PreventRiskControlMeasure controlMeasure = preventRiskControlMeasureService.getControlMeasureByUuid(workAndMeasure.getMeasureUuid()); + PreventDangerCheckContent checkContent = preventDangerCheckContentService.getCheckContentByMeasureId(controlMeasure.getId()); + String timeUnit = null; + //转成汉字 + if (work.getCheckCycleUnit().equals(2)){ + timeUnit = "小时"; + }else if (work.getCheckCycleUnit().equals(3)){ + timeUnit = "日"; + }else if (work.getCheckCycleUnit().equals(4)){ + timeUnit = "月"; + }else if (work.getCheckCycleUnit().equals(5)){ + timeUnit = "年"; + } + //巡检周期 = 任务时间 + 间隔 + int workTime; + workTime = work.getCheckCycle() + work.getValidTime(); + //封装风险事件数据 + taskFromWork.setId(workAndMeasure.getId()); + taskFromWork.setCompanyCode(companyCode); + taskFromWork.setDeleted(work.getDeleteStatus().toString()); + taskFromWork.setCreateBy(work.getCreateByUserName()); + taskFromWork.setCreateDate(work.getGmtCreate()); + taskFromWork.setUpdateBy(work.getCreateByUserName()); + taskFromWork.setUpdateDate(work.getGmtModitify()); + taskFromWork.setCheckCycle(workTime); + taskFromWork.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + taskFromWork.setReportTime(null); + taskFromWork.setDataSource((byte) 1); + taskFromWork.setCheckCycleUnit(timeUnit); + taskFromWork.setRiskMeasureId(workAndMeasure.getMeasureUuid()); + taskFromWork.setTroubleshootContent(checkContent.getCheckContent()); + taskFromWork.setWorkId(work.getId()); + //设置原始数据上报状态 + handlerReportParam.setId(work.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventDangerCheckWorkService.updateWorkReportStatus(handlerReportParam); + + //以措施为单位,封装数据 + taskFromWorkLists.add(taskFromWork); + } + } + }else { + logger.info("【***】当前无任务配置数据需要处理"); + } +// System.out.println("【***】任务配置数据封装完成"); + for (PreventReportCheckTaskFromWork taskFromWorks : taskFromWorkLists) { + PreventReportCheckTaskFromWork workById = taskFromWorkService.getWorkById(taskFromWorks.getId()); + if (ObjectUtils.isEmpty(workById)){ + int result = taskFromWorkService.insertTaskFromWorkList(taskFromWorks); + if (result < 0){ + System.out.println(JSONObject.toJSON(taskFromWorks)); + throw new BusinessException(E.ADD_FAIL.getCode(), "任务配置插入失败"); + } + }else { + taskFromWorkService.updateWorkById(taskFromWorks); + } +// System.out.println("【***】任务配置:数据处理..."); + } + }else { + step = 5; + logger.info("【***】任务配置数据上报已关闭"); + } + + + /** + * 5、排查任务记录数据 PreventReportCheckRecordFromTask + * */ + //读取安全风险管控措施数据上报主配置信息 + PreventReportConfig recordReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + //如果安全风险管控措施主配置开启上报 + if (recordReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + + logger.info("【##】5.检索排查任务记录数据..."); +// System.out.println("【***】5.检索排查任务记录数据..."); + + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventDangerCheckTask> tasks = preventDangerCheckTaskService.listReportTask(); + //获取上报数据对象 + List<PreventReportCheckRecordFromTask> recordFromTaskList = new ArrayList<>(); + HandlerReportParam handlerReportParam = new HandlerReportParam(); + if (ObjectUtils.isNotEmpty(tasks)){ + //遍历,封装数据 + for (PreventDangerCheckTask task : tasks) { + PreventReportCheckRecordFromTask recordFromTask = new PreventReportCheckRecordFromTask(); + PreventDangerCheckWork workById = preventDangerCheckWorkService.getWorkById(task.getCheckWorkId()); + if (ObjectUtils.isNotEmpty(workById)){ + UserInfo userByRealName = userService.getByUserId(workById.getCreateByUserId()); + if (ObjectUtils.isEmpty(userByRealName.getUsername())){ + recordFromTask.setCreateByMobile(null); + }else { + recordFromTask.setCreateByMobile(userByRealName.getUsername()); + } + }else { + UserInfo userByRealName = userService.getUserByRealName(task.getCreateUserName()); + if (ObjectUtils.isEmpty(userByRealName.getUsername())){ + recordFromTask.setCreateByMobile(null); + }else { + recordFromTask.setCreateByMobile(userByRealName.getUsername()); + } + } + + //修改人-执行人 +// ResultVO<UserRPCRespDTO> rpcExecUserResult = accountAuthService.getUserById(task.getExecUserId()); +// UserRPCRespDTO execUser = (UserRPCRespDTO)rpcExecUserResult.getData(); + UserInfo execUser = userService.getById(task.getExecUserId()); + //获取上报数据对象 + + //转换检查结果 + String checkStatus = null; + if (ObjectUtils.isEmpty(task.getResult() )){ + checkStatus = "2"; + }else if (task.getResult() == 2){ + checkStatus = "1"; + }else if (task.getResult() == 1){ + checkStatus = "0"; + } + //封装风险事件数据 + recordFromTask.setId(task.getUuid()); + recordFromTask.setCompanyCode(companyCode); + recordFromTask.setDeleted(task.getDeleteStatus().toString()); + recordFromTask.setCreateBy(task.getCreateUserName()); + recordFromTask.setCreateDate(task.getGmtCreate()); + recordFromTask.setUpdateBy(task.getExecUserName()); + recordFromTask.setUpdateDate(task.getGmtModitify()); + recordFromTask.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + recordFromTask.setReportTime(null); + recordFromTask.setDataSource((byte) 1); + recordFromTask.setCheckTaskId(task.getCheckWorkUuid()); + recordFromTask.setCheckStatus(checkStatus); + recordFromTask.setCheckTime(task.getStartTime()); + //TODO + if (ObjectUtils.isEmpty(execUser.getUsername())){ + recordFromTask.setUpdateByMobile(null); + }else { + recordFromTask.setUpdateByMobile(execUser.getUsername()); + } + + //封装数据 + recordFromTaskList.add(recordFromTask); + recordFromTask.setTaskId(task.getId()); + //设置原始数据上报状态 + handlerReportParam.setId(task.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventDangerCheckTaskService.updateTaskReportStatus(handlerReportParam); + } + }else { + logger.info("【***】当前无排查任务记录需要处理"); + } +// System.out.println("【***】任务记录数据封装完成"); + //批量插入 + for (PreventReportCheckRecordFromTask recordFromTasks : recordFromTaskList) { + PreventReportCheckRecordFromTask taskById = taskRecordService.getTaskById(recordFromTasks.getId()); + if (ObjectUtils.isEmpty(taskById)){ + int result = taskRecordService.insert(recordFromTasks); + if (result < 0){ +// System.out.println("排查任务记录插入失败"); + throw new BusinessException(E.ADD_FAIL.getCode(), "排查任务记录插入失败"); + } + }else { + taskRecordService.updateTaskById(recordFromTasks); + } + +// System.out.println("【***】任务记录处理"); + } + step = 6; + }else { + step = 6; + logger.info("排查任务记录数据上报已关闭"); + } + + /** + * 6、隐患信息数据 + * */ + //读取安全风险管控措施数据上报主配置信息 + PreventReportConfig dangerReportConfig = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //如果安全风险管控措施主配置开启上报 + if (dangerReportConfig.getReportState().equals(SyncEnum.REPORT_ON.getCode())){ + + logger.info("【##】4.检索隐患信息数据..."); +// System.out.println("【***】6.检索隐患信息数据..."); + + //查询所有 选择上报的数据 && (reportTime == null 或者 reportTime < updateReportDataTime) + List<PreventDangerManage> dangerManages = preventDangerManageService.listReportDanger(); + //获取上报数据list + + List<PreventReportDangerInfo> dangerInfoLists = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(dangerManages)){ + HandlerReportParam handlerReportParam = new HandlerReportParam(); + //遍历,封装数据 + for (PreventDangerManage dangerManage : dangerManages) { +// System.out.println("封装隐患信息数据..."); + //获取上报数据对象 + PreventReportDangerInfo dangerInfo = new PreventReportDangerInfo(); + PreventDangerRectify rectify = preventDangerRectifyService.getRectifyByManageIdForReport(dangerManage.getId()); + + //DangerLevel转换,减一 + Integer level = dangerManage.getDangerLevel() - 1; + //DangerManageType转换,减一 + Integer manageType = dangerManage.getDangerType() - 1; + //TODO 部门编码,暂时没有 + //封装风险事件数据 + dangerInfo.setId(dangerManage.getUuid()); + dangerInfo.setCompanyCode(companyCode); + dangerInfo.setDeleted(dangerManage.getDeleteStatus().toString()); + dangerInfo.setCreateBy(dangerManage.getCreateByUserName()); + dangerInfo.setCreateDate(dangerManage.getGmtCreate()); + dangerInfo.setUpdateBy(dangerManage.getLastEditUserName()); + dangerInfo.setUpdateDate(dangerManage.getGmtModitify()); + dangerInfo.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + dangerInfo.setReportTime(null); + dangerInfo.setDataSource((byte) 1); + + PreventRiskAnaUnit riskUnit = preventRiskUnitService.getRiskUnitById(dangerManage.getRiskUnitId()); + if (ObjectUtils.isNotEmpty(riskUnit)){ + + dangerInfo.setHazardCode(riskUnit.getRiskCode());//风险分析对象编码 + }else { + dangerInfo.setHazardCode(null);//风险分析对象编码 + } + + PreventDangerCheckTask task = preventDangerCheckTaskService.getTaskById(dangerManage.getTaskId()); + if (ObjectUtils.isNotEmpty(task)){ + dangerInfo.setCheckRecordId(task.getUuid());//隐患排查任务记录uuid + PreventTaskAndMeasure taskAndMeasureByTaskId = preventTaskAndMeasureService.getTaskAndMeasureByTaskId(task.getId()); + PreventRiskControlMeasure controlMeasure = preventRiskControlMeasureService.getControlMeasureById(taskAndMeasureByTaskId.getControlMeasureId()); + dangerInfo.setRiskMeasureId(controlMeasure.getUuid());//管控措施uuid + }else { + dangerInfo.setCheckRecordId(null);//隐患排查任务记录uuid + dangerInfo.setRiskMeasureId(null);//管控措施uuid + } + dangerInfo.setDangerName(dangerManage.getDangerCode());//隐患名称--DangerCode + dangerInfo.setDangerLevel(level.toString());// + dangerInfo.setDangerSrc(dangerManage.getDangerSource().toString());//隐患来源 + dangerInfo.setDangerManageType(rectify.getRectifyType().toString());//隐患治理类型 + dangerInfo.setDangerDesc(dangerManage.getDangerDesc());//隐患描述 + dangerInfo.setDangerReason(dangerManage.getDangerReason());//隐患产生原因 + dangerInfo.setControlMeasures(rectify.getRectifyDesc());//控制措施 ,整改措施 + + dangerInfo.setCost(rectify.getCost().toString());//资金 + dangerInfo.setDangerManageDeadline(rectify.getRectifyTime());//治理期限 + dangerInfo.setDangerState(dangerManage.getDangerStatus().toString());//隐患状态 + dangerInfo.setHazardDangerType(dangerManage.getDangerType().toString());//隐患类型 + dangerInfo.setRegistrant(dangerManage.getCreateByUserName());//登记人 + dangerInfo.setRegistTime(dangerManage.getGmtCreate());//登记时间 + dangerInfo.setLiablePerson(rectify.getLiablePerson());//整改责任人 + dangerInfo.setCheckAcceptPerson(rectify.getCheckAcceptPerson());//验收人 + dangerInfo.setCheckAcceptComment(rectify.getCheckAcceptDesc());//验收情况 + dangerInfo.setCheckAcceptTime(rectify.getCheckAcceptTime());//验收时间 + + dangerInfo.setDangerManagerId(dangerManage.getId()); + + //封装数据 + dangerInfoLists.add(dangerInfo); + //设置原始数据上报状态 + handlerReportParam.setId(dangerManage.getId()); + handlerReportParam.setReportTime(new Date()); + handlerReportParam.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + preventDangerManageService.updateManageReportStatus(handlerReportParam); + preventDangerRectifyService.updateRectifyReportStatus(handlerReportParam); + } + }else { + logger.info("【***】当前无隐患信息需要处理"); +// System.out.println("【***】当前无隐患信息需要处理"); + } + //插入 + for (PreventReportDangerInfo danger : dangerInfoLists) { + PreventReportDangerInfo dangerById = dangerInfoService.getDangerById(danger.getId()); + if (ObjectUtils.isEmpty(dangerById)){ + int result = dangerInfoService.insert(danger); + if (result < 0){ + throw new BusinessException(E.ADD_FAIL.getCode(), "隐患信息插入失败"); + } + }else { + dangerInfoService.updateDangerById(danger); + } + + logger.info("【***】隐患信息:数据处理..."); +// System.out.println("【***】隐患信息:数据处理..."); + } + }else { + logger.info("隐患信息数据上报已关闭"); + } + +// System.out.println("【***】检索需要上报数据完成..."); + logger.info("检索需要上报数据完成..."); + + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/DangerService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/DangerService.java new file mode 100644 index 0000000..9021379 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/DangerService.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; + +public interface DangerService { + + /** + * 隐患排查任务单元-分页查询 + */ + ResultVO<PreventDangerCheckTaskUnit> getTaskUnitPage(Long userId, PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO); + + /** + * 隐患排查任务单元-新增 + */ + ResultVO<PreventDangerCheckTaskUnit> saveTaskUnit(Long userId, PreventDangerCheckTaskUnitSaveReqDTO taskUnitSaveReqDTO); + /** + * 隐患排查任务单元-修改 + */ + ResultVO<PreventDangerCheckTaskUnit> updateTaskUnit(Long userId, PreventDangerCheckTaskUnitUpdateReqDTO taskUnitUpdateReqDTO); + /** + * 隐患排查任务单元-删除 + */ + ResultVO<PreventDangerCheckTaskUnit> deleteTaskUnit(Long userId, PreventDangerCheckTaskUnitDeleteReqDTO taskUnitDeleteReqDTO); + + /** + * 隐患排查任务单元-任务单元列表 + */ + ResultVO<PreventDangerCheckTaskUnit> listTaskUnit(Long valueOf); + //隐患排查作业 + /** + * 隐患排查作业-分页查询 + */ + ResultVO<PreventDangerCheckWork> getCheckWorkPage(Long userId, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO); + /** + * 隐患排查作业-任务列表 + */ + ResultVO<PreventDangerCheckWork> listCheckWork(Long userId); + /** + * 隐患排查作业-查看检查内容 + */ + ResultVO<PreventDangerCheckWork> getCheckWorkContent(Long userId, PreventDangerCheckWorkContentQueryReqDTO contentReqDTO); + /** + * 隐患排查作业-新增 + */ + ResultVO<PreventDangerCheckWork> saveCheckWork(Long userId, PreventDangerCheckWorkSaveReqDTO workSaveReqDTO); + /** + * 隐患排查作业-修改 + */ + ResultVO<PreventDangerCheckWork> updateCheckWork(Long userId, PreventDangerCheckWorkUpdateReqDTO workUpdateReqDTO); + /** + * 隐患排查作业-删除 + */ + ResultVO<PreventDangerCheckWork> deleteCheckWork(Long userId, PreventDangerCheckWorkDeleteReqDTO workDeleteReqDTO); + + //隐患排查任务 + /** + * 隐患排查任务-分页查询 + */ + ResultVO<PreventDangerCheckTask> getTaskPage(Long userId, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-分页查询-手机端使用 + */ + ResultVO<PreventDangerCheckTask> getTaskPageForMobile(Long uid, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-分页查询-手机端使用-测试 + */ + ResultVO<PreventDangerCheckTask> getTaskPageForMobileTest(Long uid, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-手动新增 + */ + ResultVO<PreventDangerCheckTask> saveTask(Long userId, PreventDangerCheckTaskSaveReqDTO taskSaveReqDTO); + /** + * 隐患排查任务-调度 + */ + boolean createAutoTask(Long workId); + /** + * 隐患排查任务-修改 + */ + ResultVO<PreventDangerCheckTask> updateTask(Long userId, PreventDangerCheckTaskUpdateReqDTO taskUpdateReqDTO); + /** + * 隐患排查任务-删除 + */ + ResultVO<PreventDangerCheckTask> deleteTask(Long userId, PreventDangerCheckTaskDeleteReqDTO taskDeleteReqDTO); + /** + * 排查作业-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateCheckWorkReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 排查任务-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateCheckTaskReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 排查任务-认领任务 + */ + ResultVO<PreventDangerCheckTask> taskToUser(ContextCacheUser currentUser, PreventDangerCheckTaskDeleteReqDTO taskToUserDTO); + /** + * 隐患排查任务单元-批量删除 + */ + ResultVO<PreventDangerCheckTaskUnit> deleteBatchTaskUnit(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/FileHandlerService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/FileHandlerService.java new file mode 100644 index 0000000..7fd4b80 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/FileHandlerService.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.doublePrevention.service;//package com.gk.hotwork.doublePrevention.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import org.springframework.web.multipart.MultipartFile; + +public interface FileHandlerService { + /** + * 生产装置-导入 + */ + ResultVO<PreventProduceDevice> deviceImport(ContextCacheUser currentUser, MultipartFile file); + /** + * 风险分析单元-导入 + */ + ResultVO<PreventRiskAnaUnit> riskUnitImport(ContextCacheUser currentUser, MultipartFile file); + /** + * 安全风险事件-导入 + */ + ResultVO<PreventRiskEvent> eventImport(ContextCacheUser currentUser, MultipartFile file); + /** + * 管控措施-导入 + */ + ResultVO<PreventRiskEvent> measureImport(ContextCacheUser currentUser, MultipartFile file); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/RectifyService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/RectifyService.java new file mode 100644 index 0000000..ecb40e9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/RectifyService.java @@ -0,0 +1,107 @@ +package com.gk.hotwork.doublePrevention.service; + +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManage; +import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.query.OwnRectifyPageQuery; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventDangerCheckTaskRectifyRespDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventDangerManageQueryRespDTO; + +import java.time.LocalDate; +import java.util.List; + +public interface RectifyService { + + //隐患治理 + /** + * 隐患治理清单-分页查询 + */ + ResultVO<PreventDangerManage> getDangerManagePage(Long userId, PreventDangerManageQueryReqDTO manageQueryReqDTO); + /** + * 隐患治理清单-新增 + */ + ResultVO<PreventDangerManage> saveDangerManage(Long userId, PreventDangerManageSaveReqDTO manageSaveReqDTO); + /** + * 隐患治理清单-修改 + */ + ResultVO<PreventDangerManage> updateDangerManage(Long userId, PreventDangerManageUpdateReqDTO manageSaveReqDTO); + /** + * 隐患治理清单-删除 + */ + ResultVO<PreventDangerManage> deleteDangerManage(Long userId, PreventDangerManageDeleteReqDTO manageDeleteReqDTO); + + + //隐患整改 + /** + * 隐患整改清单-分页查询 + */ + ResultVO<PreventDangerRectify> getDangerRectifyPage(Long userId, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO); + /** + * 隐患整改清单-新增 + */ + ResultVO<PreventDangerRectify> saveDangerRectify(Long userId, PreventDangerRectifySaveReqDTO rectifySaveReqDTO); + /** + * 隐患整改清单-修改 + */ + ResultVO<PreventDangerRectify> updateDangerRectify(Long userId, PreventDangerRectifyUpdateReqDTO rectifyUpdateReqDTO); + /** + * 隐患整改清单-删除 + */ + ResultVO<PreventDangerRectify> deleteDangerRectify(Long userId, PreventDangerRectifyDeleteReqDTO rectifyDeleteReqDTO); + /** + * 隐患整改清单-申请验收 + */ + ResultVO<PreventDangerRectify> applyReport(Long valueOf, PreventDangerReportRectifyReqDTO reportRectiity); + /** + * 隐患治理清单-列表 + */ + ResultVO<PreventDangerManage> listDangerManage(Long valueOf); + /** + * 隐患管理-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateDangerManagerReport(Long valueOf, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 隐患整改--延期 + */ + ResultVO<PreventDangerRectify> timeOutRectify(Long valueOf, PreventDangerRectifyUpdateReqDTO updateReqDTO); + /** + * 隐患整改清单--验收 + */ + ResultVO<PreventDangerRectify> reportRectify(Long valueOf, PreventDangerReportRectifyReqDTO reportRectiity); + + /** + * 隐患整改清单-查询:待验收与已验收 + */ + ResultVO<PreventDangerRectify> getRectifyOverPage(Long uid, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + /** + * 隐患管理-关闭隐患单 + */ + ResultVO<PreventRiskAnaUnit> closeDanger(Long uid, PreventCloseDangerReqDTO closeDangerReqDTO); + + + /** + * 统计指定日期创建的隐患数量 + * @param date + * @return + */ + ResultVO countDangerByDate(LocalDate date); + + /** + * 用隐患编号查询隐患信息 + * @param serialCode + * @return + */ + ResultVO<PreventDangerManageQueryRespDTO> findByDangerSerialCode(String serialCode); + + /** + * @Description: 获取当前用户需要他整改的即将超期的隐患单子 + */ + SearchResultVO<List<PreventDangerCheckTaskRectifyRespDTO>> listOwnRectifyPage(ContextCacheUser currentUser, PageQuery<OwnRectifyPageQuery> pageQuery); + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/ReportService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/ReportService.java new file mode 100644 index 0000000..1637059 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/ReportService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.doublePrevention.service; + +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigUpdateReqDTO; + +public interface ReportService { + + /** + * 数据上报配置-查询 + */ + ResultVO<PreventReportConfig> getReportConfig(Long userId); + /** + * 数据上报配置-修改 + */ + ResultVO<PreventReportConfig> updateReportConfig(Long userId, PreventReportConfigUpdateReqDTO updateReqDTO); + + /** + * 数据上报配置历史记录-查询 + */ + ResultVO<PreventReportConfigLog> getReportConfigLogPage(Long userId, PreventReportConfigLogQueryReqDTO queryReqDTO); + + + /** + * 上报数据-风险分析单元-分页查询 + */ + ResultVO<PreventReportRiskAnaUnit> getReportRiskUnitPage(ContextCacheUser currentUser, PreReportRiskUnitQueryReqDTO queryReqDTO); + + /** + * 上报数据-事件-分页查询 + */ + ResultVO<PreventReportRiskEvent> getReportEventPage(ContextCacheUser currentUser, PreReportRiskEventQueryReqDTO queryReqDTO); + /** + * 上报数据-管控措施-分页查询 + */ + ResultVO<PreventReportRiskControlMeasure> getReportMeasurePage(ContextCacheUser currentUser, PreventReportRiskControlMeasureReqDTO queryReqDTO); + /** + * 上报数据-任务配置-分页查询 + */ + ResultVO<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(ContextCacheUser currentUser, PreventReportCheckTaskFromWorkReqDTO queryReqDTO); + /** + * 上报数据-任务记录-分页查询 + */ + ResultVO<PreventReportCheckRecordFromTask> getRecordFromTaskPage(ContextCacheUser currentUser, PreventReportCheckRecordFromTaskReqDTO queryReqDTO); + /** + * 上报数据-隐患信息-分页查询 + */ + ResultVO<PreventReportDangerInfo> getReportDangerInfoPage(ContextCacheUser currentUser, PreventReportDangerInfoReqDTO queryReqDTO); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/RiskService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/RiskService.java new file mode 100644 index 0000000..37213e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/RiskService.java @@ -0,0 +1,162 @@ +package com.gk.hotwork.doublePrevention.service; + + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; + +public interface RiskService { + + //生产装置 + /** + * 生产装置-分页查询 + * */ + ResultVO<PreventProduceDevice> getDevicePage(PreventProduceDeviceQueryReqDTO deviceReqDto); + /** + * 生产装置-根绝风险等级查询 + * */ + ResultVO<PreventProduceDevice> getByLevel(PreventProduceDeviceQueryReqDTO deviceReqDto); + /** + * 生产装置-新增 + * */ + ResultVO<PreventProduceDevice> saveDevice(Long userId, PreventProduceDeviceSaveReqDTO deviceSaveReqDto); + /** + * 生产装置-删除 + */ + ResultVO<PreventProduceDevice> deleteOne(Long userId, PreventProduceDeviceDeleteReqDTO deviceDeleteReqDTO); + /** + * 生产装置-修改 + */ + ResultVO<PreventProduceDevice> updateOneById(Long userId, PreventProduceDeviceUpdateReqDTO deviceUpdateReqDTO); + /** + * 生产装置- 查询生产装置列表 + */ + ResultVO<PreventProduceDevice> getListDevices(Long valueOf); + //风险分布地图 + /** + * 风险分布图-分页查询详细信息 + */ + ResultVO<PreventRiskMap> getMapPage(PreventRiskMapQueryReqDTO riskMapQueryReqDTO); + /** + * 风险分布图-新增 + */ + ResultVO<PreventRiskMap> saveRiskMap(Long userId, PreventRiskMapSaveReqDTO riskMapSaveReqDTO); + /** + * 风险分布图-删除 + */ + ResultVO<PreventRiskMap> deleteRiskMap(Long userId, PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO); + /** + * 风险分布图-修改 + */ + ResultVO<PreventRiskMap> updateRiskMap(Long userId, PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO); + + //风险分析单元 + /** + * 风险分析单元-分页查询 + */ + ResultVO<PreventRiskAnaUnit> getRiskUnitPage(Long userId, PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO); + /** + * 风险分析单元-新增 + */ + ResultVO<PreventRiskAnaUnit> saveRiskAnaUnit(Long userId, PreventRiskAnaUnitSaveReqDTO riskAnaUnitSaveReqDTO); + /** + * 风险分析单元-修改 + */ + ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitById(Long userId, PreventRiskAnaUnitUpdateReqDTO riskAnaUnitUpdateReqDTO); + /** + * 风险分析单元-删除 + */ + ResultVO<PreventRiskAnaUnit> deleteRiskAnaUnitById(Long userId, PreventRiskAnaUnitDeleteReqDTO riskAnaUnitDeleteReqDTO); + + //风险事件 + /** + * 风险事件-分页查询 + */ + ResultVO<PreventRiskEvent> getRiskEventPage(Long userId, PreventRiskEventQueryReqDTO riskEventQueryReqDTO); + /** + * 风险事件-新增 + */ + ResultVO<PreventRiskEvent> saveRiskEvent(Long userId, PreventRiskEventSaveReqDTO riskEventSaveReqDTO); + /** + * 风险事件-修改 + */ + ResultVO<PreventRiskEvent> updateRiskEvent(Long userId, PreventRiskEventUpdateReqDTO riskEventUpdateReqDTO); + /** + * 风险事件-删除 + */ + ResultVO<PreventRiskEvent> deleteRiskEvent(Long userId, PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO); + /** + * 风险事件-新增 - 单元list查询 + */ + ResultVO<PreventRiskEvent> listRiskUnits(Long valueOf); + /** + * 风险事件-事件list + */ + ResultVO<PreventRiskEvent> getListEvents(Long valueOf); + + //管控措施 + /** + * 管控措施-分页查询 + */ + ResultVO<PreventRiskControlMeasure> getRiskControlMeasurePage(Long userId, PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO); + /** + * 管控措施-新增 + */ + ResultVO<PreventRiskControlMeasure> saveRiskControlMeasure(Long userId, PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO); + /** + * 管控措施-修改 + */ + ResultVO<PreventRiskControlMeasure> updateRiskControlMeasure(Long userId, PreventRiskControlMeasureUpdateReqDTO measureUpdateReqDTO); + /** + * 管控措施-删除 + */ + ResultVO<PreventRiskControlMeasure> deleteRiskControlMeasure(Long userId, PreventRiskControlMeasureDeleteReqDTO measureDeleteReqDTO); + /** + * 管控措施- 管控措施模板 + */ + ResultVO<PreventRiskControlMeasure> listMeasures(Long userId); + /** + * 管控措施- 管控措施列表 + */ + ResultVO<PreventRiskControlMeasure> listControlMeasure(ContextCacheUser currentUser, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO); + + + /** + * 风险分布图-图 + */ + ResultVO<PreventRiskMap> getMapImage(Long id); + /** + * 安全风险分析单元-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 安全风险事件-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateRiskEventReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 安全风险事件-手工上报-配置 + */ + ResultVO<PreventRiskAnaUnit> updateMeasuresReport(Long valueOf, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 生产装置ID- 查询单元 + */ + ResultVO<PreventRiskAnaUnit> getRiskAnaUnitByDeviceId(Long uid, Long deviceId); + + /** + * 生产装置-批量删除 + */ + ResultVO<PreventProduceDevice> deleteBatchDevice(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO); + /** + * 风险分析单元-批量删除 + */ + ResultVO<PreventRiskAnaUnit> deleteBatchRiskAnaUnit(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO); + /** + * 风险事件-批量删除 + */ + ResultVO<PreventRiskEvent> deleteBatchRiskEvent(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO); + /** + * 管控措施-批量删除 + */ + ResultVO<PreventRiskControlMeasure> deleteBatchRiskControlMeasure(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/StatisticsService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/StatisticsService.java new file mode 100644 index 0000000..ef5d6f1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/StatisticsService.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.doublePrevention.service; + +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionCompletedReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionTaskReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectorReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsPreventDangerPageReqDTO; + +import java.util.List; +import java.util.Map; + +public interface StatisticsService { + + + List<Map> selectInspectorsStatistics(StatisticsInspectorReqDTO reqDTO); + + List<Map> selectInspectionCompleted(StatisticsInspectionCompletedReqDTO reqDTO); + + Map<String,List<Map>> selectInspectionTask(StatisticsInspectionTaskReqDTO reqDTO); + + PageInfoExtension<Map> selectPreventDangerPage(StatisticsPreventDangerPageReqDTO reqDTO); + + Map countDeviceEveryLevel(); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckContentService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckContentService.java new file mode 100644 index 0000000..9fa667d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckContentService.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent; + +public interface PreventDangerCheckContentService extends IService<PreventDangerCheckContent> { + /** + * 插入管控措施,同时插入措施对应的隐患排查内容 + * */ + int saveDangerCheckContent(PreventDangerCheckContent checkContent); + + /** + * 查询隐患排查内容-通过关联的措施id + * */ + PreventDangerCheckContent getCheckContentByMeasureId(Long measureId); + + /** + * 修改隐患排查内容-通过关联的措施id + * */ + void updateDangerCheckContent(Long measureId, String checkContent); + + /** + * 查询任隐患排查内容-根据务关联的检查内容taskId + * */ + PreventDangerCheckContent getCheckContentByTaskId(Long taskId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskService.java new file mode 100644 index 0000000..8b0f15a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskService.java @@ -0,0 +1,145 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskToUserParams; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface PreventDangerCheckTaskService extends IService<PreventDangerCheckTask> { + + /** + * 隐患排查任务-分页查询 + */ + IPage<PreventDangerCheckTask> getTaskPage(Page<Object> objectPage, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-分页查询-手机端使用 + */ + IPage<PreventDangerCheckTask> getTaskPageForMobile(Page<Object> objectPage, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO); + /** + * 隐患排查任务-手动新增 + * ----应存在任务调度新增方式 + */ + int saveTask(PreventDangerCheckTask checkTask); + /** + * 隐患排查任务-修改 + */ + int updateTask(PreventDangerCheckTaskUpdateParams updateParams); + /** + * 隐患排查任务-删除 + */ + int deleteTask(PreventDeleteParams deleteParams); + /** + * 隐患排查任务-通过id查询信息 + */ + PreventDangerCheckTask getTaskById(Long checkTaskId); + /** + * 隐患排查任务-通过taskCode查询信息 + */ + PreventDangerCheckTask getTaskByCode(Long taskCode); + /** + * 隐患排查任务-通过id修改任务状态 + */ + int updateTaskStatus(Long taskId, Byte taskStatus); + /** + * 隐患排查任务-设置任务超时 + */ + int resetTaskStatus(Long taskId); + /** + * 隐患排查任务-通过作业id查询 + */ + List<PreventDangerCheckTask> getTaskByCheckWorkId(Long checkWorkId); + + + /** + * 排查任务-手工上报-配置 + */ + int updateCheckTaskReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + + /** + * 排查任务-上报数据 + */ + List<PreventDangerCheckTask> listReportTask(); + + /** + * 排查任务-上报数据状态变更 + */ + void updateTaskReportStatus(HandlerReportParam handlerReportParam); + /** + * 排查任务-认领任务 + */ + int taskToUser(PreventTaskToUserParams taskToUserParams); + + + /** + * @Description: 获取巡检人员统计 + */ + + List<Map> selectInspectorsStatistics(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + + /** + * @Description: 获取巡检完成数量 + */ + + List<Map> selectInspectionCompleted(Long depId, Byte status, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + /** + * 排查任务-检查是否已经创建 + */ + PreventDangerCheckTask getTaskByCheckWorkIdAndStartTime(Long workId, Date checkTime); + /** + * 排查任务-查询应该已经过期,但是还在执行中状态的任务 + */ + List<PreventDangerCheckTask> listOverTask(Date startTime, Date endTime); + /** + * 排查任务-查询应该已经开始,但是还在待执行状态的任务 + */ + List<PreventDangerCheckTask> listWaitExecTask(Date endTime); + + /** + * @Description: 巡检任务统计 + */ + List<Map> selectInspectionTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + /** + * @Description: 每日已认领巡检任务统计 + */ + List<Map> selectInspectionClaimedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + /** + * @Description: 每日已完成巡检任务统计 + */ + List<Map> selectInspectionCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + /** + * @Description: 每日未完成巡检任务统计 + */ + List<Map> selectInspectionUnCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime); + + /** + * @Description: 隐患统计 + */ + List<PreventDangerCheckTaskRectifyDO> selectPreventDangerPage(Page<PreventDangerCheckTaskRectifyDO> page, Map<String, Object> params); + + /** + * @Description: 各个整改数量 + */ + Map<String, Integer> selectRectifyNum(); + /**查询应该已经结束,但是还在执行中状态的任务*/ + List<PreventDangerCheckTask> listTimeOutTask(Date endTime); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskUnitService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskUnitService.java new file mode 100644 index 0000000..ba73b8a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckTaskUnitService.java @@ -0,0 +1,70 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitUpdateParams; + +import java.util.List; + +public interface PreventDangerCheckTaskUnitService extends IService<PreventDangerCheckTaskUnit> { + + /** + * 隐患排查任务单元-分页查询 + */ + IPage<PreventDangerCheckTaskUnit> getTaskUnitPage(Page<Object> objectPage, PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO); + /** + * 隐患排查任务单元-通过名称查询单元信息 + */ + PreventDangerCheckTaskUnit getTaskUnitByName(String taskUnitName); + /** + * 隐患排查任务单元-新增 + */ + int saveTaskUnit(PreventDangerCheckTaskUnit taskUnit); + + /** + * 隐患排查任务单元-修改 + */ + int updateTaskUnit(PreventDangerCheckTaskUnitUpdateParams updateParams); + /** + * 隐患排查任务单元-删除 + */ + int deleteTaskUnit(PreventDangerCheckTaskUnitDeleteParams deleteParams); + /** + * 隐患排查任务单元- + * 根据名称修改关联作业id + */ + PreventDangerCheckTaskUnit updateWorkIdByUnitName(String taskUnitName, Long checkWorkId); + /** + * 隐患排查任务单元- + * 根据workId 查询 + */ + PreventDangerCheckTaskUnit getTaskUnitByWorkId(Long workId); + + /** + * 隐患排查任务单元-重置关联任务单元workId + * 根据taskUnitName + */ + void deleteWorkIdByUnitName(String taskUnitName); + + /** + * 隐患排查任务单元-根据Id查询 + */ + PreventDangerCheckTaskUnit getTaskUnitById(Long id); + /** + * 隐患排查任务单元- + * 根据unitId 修改 workId + */ + void updateWorkIdByUnitId(Long taskUnitId, Long checkWorkId, String checkWorkUuid); + /** + * 隐患作业id,重置与任务单元的关联 + */ + void deleteByWorkId(Long workId); + /** + * 隐患排查任务单元-任务单元列表 + */ + List<PreventDangerCheckTaskUnit> listTaskUnit(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckWorkService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckWorkService.java new file mode 100644 index 0000000..18b0713 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerCheckWorkService.java @@ -0,0 +1,104 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckWorkQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.CheckWorkAutoUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkUpdateParams; + +import java.util.Date; +import java.util.List; + + +public interface PreventDangerCheckWorkService extends IService<PreventDangerCheckWork> { + + /** + * 隐患排查作业-分页查询 + */ + IPage<PreventDangerCheckWork> getCheckWorkPage(Page<Object> objectPage, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO); + /** + * 隐患排查作业-新增 + */ + int saveCheckWork(PreventDangerCheckWork checkWorkParams); + /** + * 隐患排查作业-修改 + */ + int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams); + /** + * 隐患排查作业-删除 + */ + int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams); + /** + * 隐患排查作业-根据作业名称查找 + */ + PreventDangerCheckWork getWorkByName(String checkWorkName); + /** + * 隐患排查作业-任务列表 + */ + List<PreventDangerCheckWork> listCheckWork(); + /** + * 隐患排查作业-根据任务单元查找 + */ + PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId); + /** + * 隐患排查作业-根据Id查找 + */ + PreventDangerCheckWork getWorkById(Long workId); + /** + * 隐患排查作业 下次调度时间--上传调度时间 + * -根据Id + */ + int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateWorkParams); + /** + * 隐患排查作业 修改为调度中 + * -根据Id + */ + void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams); + /** + * 隐患排查作业 重置作业状态 + */ + int resetWorkStatus(Long workId); + /** + * 隐患排查作业 查询可调度的列表 + */ + List<PreventDangerCheckWork> listScheduleCheckWork(); + /** + * 排查作业-手工上报-配置 + */ + int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + + /** + * 上报数据,任务配置检索 + */ + List<PreventDangerCheckWork> listReportWork(); + + /** + * 上报数据,任务配置上报状态变更 + */ + void updateWorkReportStatus(HandlerReportParam handlerReportParam); + + + /** + * 排查作业-有问题的work + */ + List<PreventDangerCheckWork> listErrorCheckWork(Date date); + /** + * 排查作业-重置错误时间 + */ + int resetErrorWork(Date resetTime, Long id); + /** + * 排查作业-检查待执行列表 + */ + List<PreventDangerCheckWork> listExecCheckWork(Date startTime, Date endTime); + /** + * 排查作业-检查待执行列表 + */ + int resetCheckWorkStatus(Long Id); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerImageService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerImageService.java new file mode 100644 index 0000000..806e4df --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerImageService.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerImage; +import com.gk.hotwork.doublePrevention.enums.ImageTypeEnum; +import java.util.List; + +public interface PreventDangerImageService extends IService<PreventDangerImage> { + + + List<PreventDangerImage> listImagesByParentId(Long parentId, ImageTypeEnum typeEnum); + + void deleteImageByParentId(Long parentId, ImageTypeEnum typeEnum); + + List<PreventDangerImage> listImagesByParentId(Long dangerManagerId); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageService.java new file mode 100644 index 0000000..cc353dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageService.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManage; +import com.gk.hotwork.doublePrevention.entity.dto.query.db.OwnRectifyPageDBQuery; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerManageQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.*; + +import java.util.Date; +import java.util.List; + +public interface PreventDangerManageService extends IService<PreventDangerManage> { + + + + /** + * 隐患治理清单-分页查询 + */ + IPage<PreventDangerManage> getDangerManagePage(Page<Object> objectPage, PreventDangerManageQueryReqDTO manageQueryReqDTO); + /** + * 隐患治理清单-新增 + */ + int saveDangerManage(PreventDangerManage dangerManage); + /** + * 隐患治理清单-修改 + */ + int updateDangerManage(PreventDangerManageUpdateParams updateParams); + /** + * 隐患治理清单-删除 + */ + int deleteDangerManage(PreventDeleteParams deleteParams); + /** + * 隐患治理清单-根据dangerCode查询 + */ + PreventDangerManage getDangerManageByCode(String dangerCode); + /** + * 隐患治理清单-根据id查询 + */ + PreventDangerManage getDangerManageById(Long dangerManagerId); + /** + * 隐患治理清单-根据taskId查询 + */ + PreventDangerManage getDangerManageByTaskId(Long taskId); + /** + * 隐患治理清单-列表 + */ + List<PreventDangerManage> listDangerManage(); + /** + * 隐患管理-手工上报-配置 + */ + int updateDangerManagerReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + /** + * 隐患管理-验收 + */ + int updateRectifyResult(UpdateRectifyResultParams updateParams); + /** + * 隐患管理-延期状态 + */ + int updateManagerStatus(Long dangerManagerId, byte code); + /** + * 隐患管理-关闭隐患单 + */ + int closeDanger(CloseDangerParams closeDangerParams); + /** + * 隐患-整改完成的 + */ + List<PreventDangerManage> listRectifyOver(PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + + IPage<PreventDangerManage> getDangerManagePageTORectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + + /** + * 隐患-上报数据 + */ + List<PreventDangerManage> listReportDanger(); + + /** + * 隐患-上报数据状态变更 + */ + void updateManageReportStatus(HandlerReportParam handlerReportParam); + + + /** + * 统计指定时间区间内创建的数量 + * @param startTime + * @param endTime + * @return + */ + int countByCreateTime(Date startTime, Date endTime); + + /** + * 根据隐患编号查询隐患信息 + * @param serialCode + * @return + */ + PreventDangerManage findByDangerSerialCode(String serialCode); + + List<PreventDangerCheckTaskRectifyDO> listOwnRectifyPage(Page<PreventDangerCheckTaskRectifyDO> page, OwnRectifyPageDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageTimeoutService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageTimeoutService.java new file mode 100644 index 0000000..4fc890b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerManageTimeoutService.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManageTimeout; + +public interface PreventDangerManageTimeoutService extends IService<PreventDangerManageTimeout> { + +/** + * 是否延期状态设置 + * */ + int insert(PreventDangerManageTimeout manageTimeout); + /** + * 延期 + * */ + int updateTimeout(PreventDangerManageTimeout manageTimeout); + /** + * 延期状态-根据dangerManagerId查询 + * */ + PreventDangerManageTimeout getByManageId(Long dangerManagerId); + /** + * 延期状态-根据RectifyId查询 + * */ + PreventDangerManageTimeout getByRectifyId(Long rectifyId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerRectifyService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerRectifyService.java new file mode 100644 index 0000000..46c4f4c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventDangerRectifyService.java @@ -0,0 +1,73 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerRectifyQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.*; + +public interface PreventDangerRectifyService extends IService<PreventDangerRectify> { + + /** + * 隐患整改清单-分页查询 + */ + IPage<PreventDangerRectify> getDangerRectifyPage(Page<Object> objectPage, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO); + /** + * 隐患整改清单-新增 + */ + int saveDangerRectify(PreventDangerRectify dangerRectify); + /** + * 隐患整改清单-修改 + */ + int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams); + /** + * 隐患整改清单-删除 + */ + int deleteDangerRectify(PreventDeleteParams deleteParams); + /** + * 隐患整改清单-根据隐患单Code查询 + */ + PreventDangerRectify getRectifyByCode(String dangerCode); + /** + * 隐患整改清单-延期 + */ + int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams); + /** + * 隐患整改清单-根据ID查询 + */ + PreventDangerRectify getRectifyById(Long id); + /** + * 隐患整改清单-验收申请 + */ + int applyReport(PreventDangerReportRectifyUpdayeParams reportParams); + /** + * 隐患整改清单-验收 + */ + int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams); + /** + * 隐患整改清单-关闭整改单 + */ + int closeDanger(CloseDangerParams closeDangerParams); + /** + * 隐患整改清单-关闭整改单 + */ + IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + + + IPage<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO); + /** + * 隐患整改清单-根据ManageID查询 + */ + PreventDangerRectify getRectifyByManageId(Long manageId); + /** + * 隐患整改清单-根据ManageID查询-包含删除数据 + */ + PreventDangerRectify getRectifyByManageIdForReport(Long manageId); + + /** + * 隐患整改清单-变更上报状态 + */ + void updateRectifyReportStatus(HandlerReportParam handlerReportParam); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventProduceDeviceService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventProduceDeviceService.java new file mode 100644 index 0000000..58b7f16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventProduceDeviceService.java @@ -0,0 +1,67 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceUpdateParams; + +import java.util.List; +import java.util.Map; + +/** + * (PreventProduceDevice)表服务接口 + * + * @author makejava + * @since 2022-06-25 10:40:17 + */ +public interface PreventProduceDeviceService extends IService<PreventProduceDevice> { + + /** + * 生产装置-分页查询 + * */ + IPage<PreventProduceDevice> getDevicePage(Page<Object> page, PreventProduceDeviceQueryParams queryParams); + /** + * 生产装置-根绝风险等级查询 + * */ + PreventProduceDevice getByLevel(Byte riskLevel); + + /** + * 生产装置-根绝设备名称和所在位置查询 + * */ + PreventProduceDevice selectByNameAndLocation(String produceDeviceName, String location); + /** + * 生产装置-新增 + * */ + int saveDevice(PreventProduceDevice device); + /** + * 生产装置-删除 + */ + int deleteById(PreventProduceDeviceDeleteParams param); + /** + * 生产装置-修改信息 + */ + int updateProduceDevice(PreventProduceDeviceUpdateParams updateParams); + /** + * 生产装置-查询-通过设备名称 + */ + PreventProduceDevice getDeviceByName(String produceDeviceName); + /** + * 生产装置-查询-通过id + */ + PreventProduceDevice getDeviceById(Long id); + /** + * 生产装置- 查询生产装置列表 + */ + List<PreventProduceDevice> getListDevices(); + /** + * 生产装置- 查询生产装置-通过名称与部门 + */ + PreventProduceDevice getDeviceByNameAndDep(String trim, String trim1); + + Map countDeviceEveryLevel(); + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportBatchService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportBatchService.java new file mode 100644 index 0000000..74071c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportBatchService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportBatch; + +public interface PreventReportBatchService extends IService<PreventReportBatch> { + /** + * 批次Id插入 + * */ + int insertBatchId(PreventReportBatch reportBatch); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckRecordFromTaskService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckRecordFromTaskService.java new file mode 100644 index 0000000..e65a7c2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckRecordFromTaskService.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckRecordFromTask; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckRecordFromTaskReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportCheckRecordFromTaskService extends IService<PreventReportCheckRecordFromTask> { + /** + * 插入任务记录 + * */ + int insert(PreventReportCheckRecordFromTask recordFromTasks); + /** + * 任务记录-分页查询 + * */ + IPage<PreventReportCheckRecordFromTask> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckRecordFromTaskReqDTO queryReqDTO); + /** + * 任务-查询待上报 + * */ + List<PreventReportCheckRecordFromTask> listReportTaskRecordDate(); + /** + * 任务-待上报状态变更 + * */ + void updateTaskReportStatus(HandlerReportParam handlerReportParam); + + PreventReportCheckRecordFromTask getTaskById(String id); + + int updateTaskById(PreventReportCheckRecordFromTask recordFromTasks); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckTaskFromWorkService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckTaskFromWorkService.java new file mode 100644 index 0000000..aa3267f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportCheckTaskFromWorkService.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckTaskFromWork; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckTaskFromWorkReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportCheckTaskFromWorkService extends IService<PreventReportCheckTaskFromWork> { + + /** + * 批量插入数据 + * */ + int insert(List<PreventReportCheckTaskFromWork> taskFromWorkList); + /** + * 上报数据-任务配置-分页查询 + */ + IPage<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckTaskFromWorkReqDTO queryReqDTO); + /** + * 插入数据 + * */ + int insertTaskFromWorkList(PreventReportCheckTaskFromWork taskFromWorkList); + /** + * 任务配置 -查询待上报 + * */ + List<PreventReportCheckTaskFromWork> listReportTaskFromWorkDate(); + /** + * 任务配置 -待上报状态变更 + * */ + void updateWorkReportStatus(HandlerReportParam handlerReportParam); + + PreventReportCheckTaskFromWork getWorkById(String id); + + int updateWorkById(PreventReportCheckTaskFromWork taskFromWorkList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigLogService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigLogService.java new file mode 100644 index 0000000..7acb845 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigLogService.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfigLog; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; + +public interface PreventReportConfigLogService extends IService<PreventReportConfigLog> { + /** + * 保存修改记录 + * */ + int insertOldReportConfig(PreventReportConfigLog preventReportConfigLog); + + /** + * 数据上报配置历史记录-查询 + */ + IPage<PreventReportConfigLog> getReportConfigLogPage(Page<Object> objectPage, PreventReportConfigLogQueryReqDTO queryReqDTO); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigService.java new file mode 100644 index 0000000..f83ed90 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportConfigService.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfig; +import com.gk.hotwork.doublePrevention.repository.param.PreventReportConfigUpdateParams; + +import java.util.List; + +public interface PreventReportConfigService extends IService<PreventReportConfig> { + + /** + * 数据上报配置-查询 + */ + List<PreventReportConfig> ListReportConfigs(); + /** + * 数据上报配置-修改 + */ + int updateReportConfig(PreventReportConfigUpdateParams updateParams); + /** + * 数据上报配置-按照id查询 + */ + PreventReportConfig getReportConfigById(int Id); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportDangerInfoService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportDangerInfoService.java new file mode 100644 index 0000000..0179609 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportDangerInfoService.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportDangerInfo; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportDangerInfoReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportDangerInfoService extends IService<PreventReportDangerInfo> { + /** + * 插入隐患信息 + * */ + int insert(PreventReportDangerInfo danger); + /** + * 上报数据-隐患信息-分页查询 + */ + IPage<PreventReportDangerInfo> getReportDangerInfoPage(Page<Object> objectPage, PreventReportDangerInfoReqDTO queryReqDTO); + /** + * 上报数据-待上报数据查询 + */ + List<PreventReportDangerInfo> listReportDangerDate(); + /** + * 上报数据-待上报状态变更 + */ + void updateTaskReportStatus(HandlerReportParam handlerReportParam); + + PreventReportDangerInfo getDangerById(String id); + + int updateDangerById(PreventReportDangerInfo danger); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskAnaUnitService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskAnaUnitService.java new file mode 100644 index 0000000..8ac0069 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskAnaUnitService.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportRiskAnaUnitService extends IService<PreventReportRiskAnaUnit> { + + /** + * 上报数据-风险分析单元-分页查询 + */ + IPage<PreventReportRiskAnaUnit> getReportRiskUnitPage(Page<Object> objectPage, PreReportRiskUnitQueryReqDTO queryReqDTO); + /** + * 上报数据- + */ + int insert(List<PreventReportRiskAnaUnit> unitLists); + /** + * 上报数据-插入 + */ + int insertUnitList(PreventReportRiskAnaUnit unitList); + /** + * 上报数据-查询待上报数据 + */ + List<PreventReportRiskAnaUnit> listReportUnitDate(); + /** + * 上报数据-修改待上报 + */ + void updateReportStatus(HandlerReportParam handlerReportParam); + /** + * 上报数据-更新数据 + */ + int updateUnitById(PreventReportRiskAnaUnit unitList); + /** + * 上报数据-更新数据 + */ + PreventReportRiskAnaUnit getUnitById(String id); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskControlMeasureService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskControlMeasureService.java new file mode 100644 index 0000000..f09d8de --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskControlMeasureService.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportRiskControlMeasureReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportRiskControlMeasureService extends IService<PreventReportRiskControlMeasure> { + + /** + * 批量插入 + * */ + int insert(List<PreventReportRiskControlMeasure> measureLists); + /** + * 上报数据-管控措施-分页查询 + */ + IPage<PreventReportRiskControlMeasure> getReportMeasurePage(Page<Object> objectPage, PreventReportRiskControlMeasureReqDTO queryReqDTO); + /** + * 插入 + * */ + int insertMeasureList(PreventReportRiskControlMeasure measureList); + /** + * 管控措施-上报数据 + * */ + List<PreventReportRiskControlMeasure> listReportMeasureDate(); + /** + * 管控措施-修改上报状态 + * */ + void updateMeasureReportStatus(HandlerReportParam handlerReportParam); + + PreventReportRiskControlMeasure getMeasureById(String id); + + int updateMeasureById(PreventReportRiskControlMeasure measureList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskEventService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskEventService.java new file mode 100644 index 0000000..56bf46c --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventReportRiskEventService.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; + +import java.util.List; + +public interface PreventReportRiskEventService extends IService<PreventReportRiskEvent> { + + /** + * 批量插入 + * */ + int insert(List<PreventReportRiskEvent> eventLists); + /** + * 分页查询 + * */ + IPage<PreventReportRiskEvent> getReportRiskEventPage(Page<Object> objectPage, PreReportRiskEventQueryReqDTO queryReqDTO); + /** + * 插入 + * */ + int insertEventLists(PreventReportRiskEvent eventList); + /** + * 上报数据-查询待上报数据 + * */ + List<PreventReportRiskEvent> listReportEventDate(); + /** + * 修改上报状态 + * */ + int updateEventReportStatus(HandlerReportParam handlerReportParam); + + PreventReportRiskEvent getEventById(String id); + + int updateEventById(PreventReportRiskEvent eventList); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskAnaUnitService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskAnaUnitService.java new file mode 100644 index 0000000..f040494 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskAnaUnitService.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskAnaUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitUpdateParams; + +import java.util.List; + +public interface PreventRiskAnaUnitService extends IService<PreventRiskAnaUnit> { + + /** + * 风险分析单元-分页查询 + */ + IPage<PreventRiskAnaUnit> getRiskUnitPage(Page<Object> objectPage, PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO); + /** + * 风险分析单元-新增 + */ + int saveRiskAnaUnit(PreventRiskAnaUnit riskAnaUnit); + /** + * 风险分析单元-根据名称获取单元信息 + */ + PreventRiskAnaUnit getRiskUnitByName(String riskUnitName); + /** + * 风险分析单元-新增 + */ + int updateRiskAnaUnitById(PreventRiskAnaUnitUpdateParams params); + /** + * 风险分析单元-删除 + */ + int deleteRiskAnaUnitById(PreventRiskAnaUnitDeleteParams deleteParams); + /** + * 风险分析单元-根据id查询 + */ + PreventRiskAnaUnit getRiskUnitById(Long riskUnitId); + /** + * 风险分析单元-根据produce_device_uuid查询 + */ + List<PreventRiskAnaUnit> getRiskUnitByDeviceId(Long deviceId); + /** + * 风险分析单元-根据风险编码查询 + */ + PreventRiskAnaUnit getRiskUnitByCode(String riskCode); + /** + * 风险单元list-仅少量信息提供前端使用 + */ + List<PreventRiskAnaUnit> listRiskUnits(); + /** + * 安全风险分析单元-手工上报-配置 + */ + int updateRiskAnaUnitReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + /** + * 安全风险分析单元-上报数据检索 + */ + List<PreventRiskAnaUnit> listRiskAnaUnit(); + + + /** + * 安全风险分析单元-修改上报状态 + */ + void updateReportStatus(HandlerReportParam handlerReportParam); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlMeasureService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlMeasureService.java new file mode 100644 index 0000000..45c91c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlMeasureService.java @@ -0,0 +1,115 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.PreventRiskControlMeasureListDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskControlMeasureListQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventrCheckContentRespDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureUpdateParams; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface PreventRiskControlMeasureService extends IService<PreventRiskControlMeasure> { + + /** + * 管控措施-分页查询 + */ + IPage<PreventRiskControlMeasure> getRiskControlMeasurePage(@Param("page") Page<Object> page, @Param("queryParams") PreventRiskControlMeasureQueryParams queryParams); + + + /** + * 管控措施-根据RiskEventId查询 + */ + List<PreventRiskControlMeasure> getRiskControlMeasureByRiskEventId(Long riskEventId); + /** + * 管控措施-新增 + */ + int saveRiskControlMeasure(PreventRiskControlMeasure controlMeasure); + /** + * 管控措施-根据措施编码与riskEventId查询 + */ + PreventRiskControlMeasure getRiskControlMeasureByCodeAndEventId(Long riskEventId, String controlMeasureCode); + /** + * 管控措施-修改 + */ + int updateRiskControlMeasure(PreventRiskControlMeasureUpdateParams updateParams); + /** + * 管控措施-根据id查询 + */ + PreventRiskControlMeasure getControlMeasureById(Long id); + /** + * 管控措施-删除 + */ + int deleteRiskControlMeasure(PreventRiskControlMeasureDeleteParams deleteParams); + /** + * 任务单元、任务关联修改 + * 管控措施-修改管控措施By + */ + void updateControlMeasureByUnitId(Long unitId); + /** + * 管控措施-根据measureCode查询 + */ + PreventRiskControlMeasure getControlMeasureByCode(String measureCode); + /** + * 管控措施-根据measureCode + * 修改关联checkWorkId + */ + PreventRiskControlMeasure updateWorkIdByMeasureCode(String controlMeasureCode, Long checkWorkId); + /** + * 管控措施-根据WorkId查询 + */ + List<PreventRiskControlMeasure> getControlMeasureByWorkId(Long workId); + + /** + * 管控措施-根据单元id查找对应措施id列表 + */ + List<PreventRiskControlMeasure> getlistByUnitId(Long taskUnitId); + /** + * 管控措施-根据measureId修改关联的任务taskId + */ + void updateControlMeasureByMeasureIdAndUnitId(Long measureId, Long taskUnitId); + /** + * 措施-手工上报-配置 + */ + int updateMeasuresReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + /** + * 措施-手工上报-配置 + */ + List<PreventRiskControlMeasure> listReportMeasure(); + /** + * 管控措施- 管控措施列表 + */ + List<PreventRiskControlMeasure> listControlMeasure(); + + + /** + * 管控措施- 管控措施UUid + */ + PreventRiskControlMeasure getControlMeasureByUuid(String measureUuid); + + /** + * 管控措施- 上报状态更新 + */ + void updateMeasureReportStatus(HandlerReportParam handlerReportParam); + /** + * 管控措施- 管控措施列表 - 分页 + */ + IPage<PreventRiskControlMeasureListDO> listControlMeasurePage(Page<Object> objectPage, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO); + + /** + * 管控措施+内容 批量查询 + */ + List<PreventRiskControlMeasure> getControlMeasureAndContent(List<Long> idLists); + /** + * 管控措施+内容 查询全部 + */ + List<PreventRiskControlMeasure> listAllControlMeasure(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlTemplateService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlTemplateService.java new file mode 100644 index 0000000..39641f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskControlTemplateService.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlTemplate; + +import java.util.List; + +public interface PreventRiskControlTemplateService extends IService<PreventRiskControlTemplate> { + /** + * 获取控制措施模板 + * */ + List<PreventRiskControlTemplate> listMeasureTemplates(); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskEventService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskEventService.java new file mode 100644 index 0000000..03f3455 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskEventService.java @@ -0,0 +1,63 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventUpdateParams; + +import java.util.List; + +public interface PreventRiskEventService extends IService<PreventRiskEvent> { + /** + * 风险事件-分页查询 + */ + IPage<PreventRiskEvent> getRiskEventPage(Page<Object> page, PreventRiskEventQueryParams queryParams); + /** + * 风险事件-根据事件名字查询 + */ + PreventRiskEvent getRiskEventByName(String riskEventName); + /** + * 风险事件-新增 + */ + int saveRiskEvent(PreventRiskEvent riskEvent); + /** + * 风险事件-修改 + */ + int updateRiskEvent(PreventRiskEventUpdateParams updateParams); + /** + * 风险事件-删除 + */ + int deleteRiskEventById(PreventDeleteParams deleteParams); + /** + * 风险事件-根据id获取名名称 + */ + PreventRiskEvent getRiskEventNameById(Long id); + /** + * 风险事件-根据RiskUnitId获取 + */ + List<PreventRiskEvent> getRiskEventNameByRiskUnitId(Long riskUnitId); + /** + * 风险事件-事件list + */ + List<PreventRiskEvent> getListEvents(); + /** + * 安全风险事件-手工上报-配置 + */ + int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO); + + + + /** + * 安全风险事件-上报数据 + */ + List<PreventRiskEvent> listReportEvent(); + /** + * 安全风险事件-更新上报状态 + */ + void updateEventReportStatus(HandlerReportParam handlerReportParam); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskMapService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskMapService.java new file mode 100644 index 0000000..725f6a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventRiskMapService.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskMap; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskMapUpdateParams; + +public interface PreventRiskMapService extends IService<PreventRiskMap> { + + /** + * 风险分布图-分页查询详细信息 + */ + IPage<PreventRiskMap> getMapPage(Page<Object> mapPage); + + /** + * 风险分布图-新增 + */ + int saveRiskMap(PreventRiskMap riskMap); + /** + * 风险分布图-删除 + */ + int deleteRiskMap(Long id); + /** + * 风险分布图-修改 + */ + int updateRiskMap(PreventRiskMapUpdateParams params); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskAndMeasureService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskAndMeasureService.java new file mode 100644 index 0000000..f0f08a0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskAndMeasureService.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventTaskAndMeasure; +import com.gk.hotwork.doublePrevention.entity.PreventTaskUnitAndMeasure; +import com.gk.hotwork.doublePrevention.repository.param.PreventCheckResultParams; + +import java.util.List; + +public interface PreventTaskAndMeasureService extends IService<PreventTaskAndMeasure> { + + /** + * 保存任务与措施的关联 + * */ + int saveTaskAndMeasure(PreventTaskAndMeasure taskAndMeasure); + + /** + * 以任务id为条件,重置管控措施与任务的关联 + * */ + void deleteTaskAndMeasureByTaskId(Long taskId); + /** + * 以任务id为条件,查询 + * */ + List<PreventTaskAndMeasure> getListByTaskId(Long taskId); + /** + * 结果填报 + * */ + int updateCheckResult(PreventCheckResultParams checkResultParams); + /** + * 根绝任务id查找 + * */ + PreventTaskAndMeasure getTaskAndMeasureByTaskId(Long id); + /** + * 根绝任务id批量查找 + * */ + List<PreventTaskAndMeasure> getListByTaskIdByIdList(List<Long> taskIdLists); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskUnitAndMeasureService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskUnitAndMeasureService.java new file mode 100644 index 0000000..b59488b --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventTaskUnitAndMeasureService.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.PreventTaskUnitAndMeasure; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskUnitAndMeasureParams; + +import java.util.List; + +public interface PreventTaskUnitAndMeasureService extends IService<PreventTaskUnitAndMeasure> { + + /** + * 保存任务单元与管控措施的关系 + * */ + void insert(PreventTaskUnitAndMeasure taskUnitAndMeasure); + /** + * 重置任务单元与管控措施的关系 + * */ + void deleteTaskUnitAndMeasure(PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams); + /** + * 获取任务单元对应的管控措施-by taskUnitId + * */ + List<PreventTaskUnitAndMeasure> getListByUnitId(Long taskUnitId); + /** + * 获取任务单元对应的管控措施-by measureId + * */ + List<PreventTaskUnitAndMeasure> getListByMeasureId(Long measureId); +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventWorkAndMeasureService.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventWorkAndMeasureService.java new file mode 100644 index 0000000..9cb0495 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/PreventWorkAndMeasureService.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.doublePrevention.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.doublePrevention.entity.PreventWorkAndMeasure; + +import java.util.List; + +public interface PreventWorkAndMeasureService extends IService<PreventWorkAndMeasure> { + /** + * 插入作业与措施的关联 + * */ + int insertWorkAndMeasure(PreventWorkAndMeasure workAndMeasure); + /** + * 重置作业与措施的关联 + * */ + void updateWorkAndMeasure(String workUuid); + /** + * 查询作业与措施关联表 + * */ + PreventWorkAndMeasure getWorkAndMeasure(String workUuid, String measureUuid); + /** + * 查询作业与措施关联表 + * */ + List<PreventWorkAndMeasure> getWorkAndMeasureByWorkUuid(String uuid); + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckContentServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckContentServiceImpl.java new file mode 100644 index 0000000..33c89b5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckContentServiceImpl.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckContent; +import com.gk.hotwork.doublePrevention.repository.PreventDangerCheckContentRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckContentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("PreventDangerCheckContentService") +public class PreventDangerCheckContentServiceImpl + extends ServiceImpl<PreventDangerCheckContentRepository, PreventDangerCheckContent> implements PreventDangerCheckContentService { + + @Autowired + private PreventDangerCheckContentRepository preventDangerCheckContentRepository; + + /** + * 插入管控措施,同时插入措施对应的隐患排查内容 + * */ + @Override + public int saveDangerCheckContent(PreventDangerCheckContent checkContent) { + int insertResult = preventDangerCheckContentRepository.insert(checkContent); + + return insertResult; + } + + /** + * 查询管控措施-通过关联的措施id + * */ + @Override + public PreventDangerCheckContent getCheckContentByMeasureId(Long measureId) { + return preventDangerCheckContentRepository.getCheckContentByMeasureId(measureId); + } + + /** + * 修改隐患排查内容-通过关联的措施id + * */ + @Override + public void updateDangerCheckContent(Long measureId, String checkContent) { + + int result = preventDangerCheckContentRepository.updateDangerCheckContent(measureId, checkContent); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + /** + * 查询任隐患排查内容-根据务关联的检查内容taskId + * */ + @Override + public PreventDangerCheckContent getCheckContentByTaskId(Long taskId) { + return preventDangerCheckContentRepository.getCheckContentByTaskId(taskId); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskServiceImpl.java new file mode 100644 index 0000000..e230eb6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskServiceImpl.java @@ -0,0 +1,223 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTask; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventDangerCheckTaskRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskToUserParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("PreventDangerCheckTaskService") +public class PreventDangerCheckTaskServiceImpl + extends ServiceImpl<PreventDangerCheckTaskRepository, PreventDangerCheckTask> implements PreventDangerCheckTaskService { + + @Autowired + private PreventDangerCheckTaskRepository preventDangerCheckTaskRepository; + + /** + * 隐患排查任务-分页查询 + */ + @Override + public IPage<PreventDangerCheckTask> getTaskPage(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + return preventDangerCheckTaskRepository.getTaskPage(page, taskQueryReqDTO); + } + /** + * 隐患排查任务-分页查询-手机端使用 + */ + @Override + public IPage<PreventDangerCheckTask> getTaskPageForMobile(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + return preventDangerCheckTaskRepository.getTaskPageForMobile(page, taskQueryReqDTO); + } + + /** + * 隐患排查任务- + */ + @Override + public int saveTask(PreventDangerCheckTask checkTask) { + int result = preventDangerCheckTaskRepository.insert(checkTask); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return result; + } + + /** + * 隐患排查任务-修改 + */ + @Override + public int updateTask(PreventDangerCheckTaskUpdateParams updateParams) { + int result = preventDangerCheckTaskRepository.updateTask(updateParams); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return result; + } + + /** + * 隐患排查任务-删除 + */ + @Override + public int deleteTask(PreventDeleteParams deleteParams) { + int result = preventDangerCheckTaskRepository.deleteTask(deleteParams); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return result; + } + /** + * 隐患排查任务-通过id查询信息 + */ + @Override + public PreventDangerCheckTask getTaskById(Long checkTaskId) { + return preventDangerCheckTaskRepository.getTaskById(checkTaskId); + } + + /** + * 隐患排查任务-通过taskCode查询信息 + */ + @Override + public PreventDangerCheckTask getTaskByCode(Long taskCode) { + return preventDangerCheckTaskRepository.getTaskByCode(taskCode); + } + + /** + * 隐患排查任务-通过id修改任务状态 + */ + @Override + public int updateTaskStatus(Long taskId, Byte taskStatus) { + return preventDangerCheckTaskRepository.updateTaskStatus(taskId, taskStatus); + } + /** + * 设置任务为超时 + * */ + @Override + public int resetTaskStatus(Long taskId) { + return preventDangerCheckTaskRepository.resetTaskStatus(taskId); + } + + /** + * 隐患排查任务-通过作业id查询 + */ + @Override + public List<PreventDangerCheckTask> getTaskByCheckWorkId(Long checkWorkId) { + return preventDangerCheckTaskRepository.getTaskByCheckWorkId(checkWorkId); + } + /** + * 排查任务-手工上报-配置 + */ + @Override + public int updateCheckTaskReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventDangerCheckTaskRepository.updateCheckTaskReport(preventHandReportConfigReqDTO); + } + /** + * 排查任务-认领任务 + */ + @Override + public int taskToUser(PreventTaskToUserParams taskToUserParams) { + return preventDangerCheckTaskRepository.taskToUser(taskToUserParams); + } + + @Override + public List<Map> selectInspectorsStatistics(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectorsStatistics(depId,list,startTime,endTime); + } + + @Override + public List<Map> selectInspectionCompleted(Long depId, Byte status, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectionCompleted(depId, status, list,startTime,endTime); + } + + + /** + * 排查任务-上报数据 + */ + @Override + public List<PreventDangerCheckTask> listReportTask() { + return preventDangerCheckTaskRepository.listReportTask(); + } + /** + * 排查任务-上报数据状态变更 + */ + @Override + public void updateTaskReportStatus(HandlerReportParam handlerReportParam) { + int result = preventDangerCheckTaskRepository.updateTaskReportStatus(handlerReportParam); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + /** + * 排查任务-检查是否已经创建 + */ + @Override + public PreventDangerCheckTask getTaskByCheckWorkIdAndStartTime(Long workId, Date checkTime) { + return preventDangerCheckTaskRepository.getTaskByCheckWorkIdAndStartTime(workId, checkTime); + } + /** + * 排查任务-查询应该已经过期,但是还在执行中状态的任务 + */ + @Override + public List<PreventDangerCheckTask> listOverTask(Date startTime, Date endTime) { + return preventDangerCheckTaskRepository.listOverTask(startTime, endTime); + } + /** + * 排查任务-查询应该已经开始,但是还在待执行状态的任务 + */ + @Override + public List<PreventDangerCheckTask> listWaitExecTask(Date endTime) { + return preventDangerCheckTaskRepository.listWaitExecTask(endTime); + } + /**查询应该已经结束,但是还在执行中状态的任务*/ + @Override + public List<PreventDangerCheckTask> listTimeOutTask(Date endTime) { + return preventDangerCheckTaskRepository.listTimeOutTask(endTime); + } + + @Override + public List<Map> selectInspectionTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectionTask(depId, list,startTime,endTime); + } + + @Override + public List<Map> selectInspectionClaimedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectionClaimedTask(depId, list,startTime,endTime); + } + + @Override + public List<Map> selectInspectionCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectionCompletedTask(depId, list,startTime,endTime); + } + + @Override + public List<Map> selectInspectionUnCompletedTask(Long depId, List<String> list, LocalDateTime startTime, LocalDateTime endTime) { + return preventDangerCheckTaskRepository.selectInspectionUnCompletedTask(depId, list,startTime,endTime); + } + + @Override + public List<PreventDangerCheckTaskRectifyDO> selectPreventDangerPage(Page<PreventDangerCheckTaskRectifyDO> page, Map<String, Object> params) { + return preventDangerCheckTaskRepository.selectPreventDangerPage(page,params); + } + + + @Override + public Map<String, Integer> selectRectifyNum() { + return preventDangerCheckTaskRepository.selectRectifyNum(); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskUnitServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskUnitServiceImpl.java new file mode 100644 index 0000000..eba1308 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckTaskUnitServiceImpl.java @@ -0,0 +1,143 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckTaskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventDangerCheckTaskUnitRepository; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckTaskUnitUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventDangerCheckTaskUnitService") +public class PreventDangerCheckTaskUnitServiceImpl + extends ServiceImpl<PreventDangerCheckTaskUnitRepository, PreventDangerCheckTaskUnit> implements PreventDangerCheckTaskUnitService { + + @Autowired + private PreventDangerCheckTaskUnitRepository preventDangerCheckTaskUnitRepository; + + /** + * 隐患排查任务单元-分页查询 + */ + @Override + public IPage<PreventDangerCheckTaskUnit> getTaskUnitPage(Page<Object> page, PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO) { + + return preventDangerCheckTaskUnitRepository.getTaskUnitPage(page, taskUnitQueryReqDTO); + } + + /** + * 隐患排查任务单元-通过名称查询单元信息 + */ + @Override + public PreventDangerCheckTaskUnit getTaskUnitByName(String taskUnitName) { + return preventDangerCheckTaskUnitRepository.getTaskUnitByName(taskUnitName); + } + + /** + * 隐患排查任务单元-新增 + */ + @Override + public int saveTaskUnit(PreventDangerCheckTaskUnit taskUnit) { + int insertResult = preventDangerCheckTaskUnitRepository.insert(taskUnit); + if (insertResult == 0){ + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + return insertResult; + } + + /** + * 隐患排查任务单元-修改 + */ + @Override + public int updateTaskUnit(PreventDangerCheckTaskUnitUpdateParams updateParams) { + int i = preventDangerCheckTaskUnitRepository.updateTaskUnit(updateParams); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return i; + } + /** + * 隐患排查任务单元-删除 + */ + @Override + public int deleteTaskUnit(PreventDangerCheckTaskUnitDeleteParams deleteParams) { + int i = preventDangerCheckTaskUnitRepository.deleteTaskUnit(deleteParams); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return i; + } + + /** + * 隐患排查任务单元- + * 根据名称修改关联作业id + */ + @Override + public PreventDangerCheckTaskUnit updateWorkIdByUnitName(String taskUnitName, Long checkWorkId) { + + return preventDangerCheckTaskUnitRepository.updateWorkIdByUnitName(taskUnitName, checkWorkId); + } + + /** + * 隐患排查任务单元- + * 根据workId 查询 + */ + @Override + public PreventDangerCheckTaskUnit getTaskUnitByWorkId(Long workId) { + return preventDangerCheckTaskUnitRepository.getTaskUnitByWorkId(workId); + } + + /** + * 隐患排查任务单元-重置关联任务单元workId + * 根据taskUnitName + */ + @Override + public void deleteWorkIdByUnitName(String taskUnitName) { + int result = preventDangerCheckTaskUnitRepository.deleteWorkIdByUnitName(taskUnitName); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + /** + * 隐患排查任务单元-根据Id查询 + */ + @Override + public PreventDangerCheckTaskUnit getTaskUnitById(Long id) { + return preventDangerCheckTaskUnitRepository.getTaskUnitById(id); + } + + /** + * 隐患排查任务单元- + * 根据unitId 修改 workId + */ + @Override + public void updateWorkIdByUnitId(Long taskUnitId, Long checkWorkId , String checkWorkUuid) { + preventDangerCheckTaskUnitRepository.updateWorkIdByUnitId(taskUnitId, checkWorkId ,checkWorkUuid); + } + + /** + * 隐患作业id,重置与任务单元的关联 + */ + @Override + public void deleteByWorkId(Long workId) { + int result = preventDangerCheckTaskUnitRepository.deleteByWorkId(workId); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + /** + * 隐患排查任务单元-任务单元列表 + */ + @Override + public List<PreventDangerCheckTaskUnit> listTaskUnit() { + return preventDangerCheckTaskUnitRepository.listTaskUnit(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckWorkServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckWorkServiceImpl.java new file mode 100644 index 0000000..ef7783a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerCheckWorkServiceImpl.java @@ -0,0 +1,189 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckWork; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerCheckWorkQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventDangerCheckWorkRepository; +import com.gk.hotwork.doublePrevention.repository.param.CheckWorkAutoUpdateParams; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventDangerCheckWorkUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckWorkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service("preventDangerCheckWorkService") +public class PreventDangerCheckWorkServiceImpl + extends ServiceImpl<PreventDangerCheckWorkRepository, PreventDangerCheckWork> implements PreventDangerCheckWorkService { + + @Autowired + private PreventDangerCheckWorkRepository preventDangerCheckWorkRepository; + + /** + * 隐患排查作业-分页查询 + */ + @Override + public IPage<PreventDangerCheckWork> getCheckWorkPage(Page<Object> page, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) { + + return preventDangerCheckWorkRepository.getCheckWorkPage(page, workQueryReqDTO); + } + /** + * 隐患排查作业-新增 + */ + @Override + public int saveCheckWork(PreventDangerCheckWork checkWorkParams) { + return preventDangerCheckWorkRepository.insert(checkWorkParams); + } + + /** + * 隐患排查作业-修改 + */ + @Override + public int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams) { + return preventDangerCheckWorkRepository.updateCheckWork(updateParams); + } + + /** + * 隐患排查作业-删除 + */ + @Override + public int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams) { + int deleteResult = preventDangerCheckWorkRepository.deleteCheckWork(deleteParams); + if (deleteResult < 1){ + throw new BusinessException(ResultCodes.SERVER_DEL_ERROR); + } + return deleteResult; + } + + /** + * 隐患排查作业-根据作业名称查找 + */ + @Override + public PreventDangerCheckWork getWorkByName(String checkWorkName) { + + return preventDangerCheckWorkRepository.getWorkByName(checkWorkName); + } + + /** + * 隐患排查作业-任务列表 + */ + @Override + public List<PreventDangerCheckWork> listCheckWork() { + return preventDangerCheckWorkRepository.listCheckWork(); + } + + /** + * 隐患排查作业-根据任务单元查找 + */ + @Override + public PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId) { + return preventDangerCheckWorkRepository.getWorkByTaskUnitId(taskUnitId); + } + + /** + * 隐患排查作业-根据Id查找 + */ + @Override + public PreventDangerCheckWork getWorkById(Long workId) { + return preventDangerCheckWorkRepository.getWorkById(workId); + } + + /** + * 隐患排查作业 下次调度时间--上传调度时间 + * -根据Id + */ + @Override + public int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateWorkParams) { + int result = preventDangerCheckWorkRepository.updateCheckWorkLastTimeAndNextTime(updateWorkParams); + + return result; + } + + /** + * 隐患排查作业 修改为调度中 + * -根据Id + */ + @Override + public void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams) { + preventDangerCheckWorkRepository.updateCheckWorkStatus(updateParams); + } + + /** + * 隐患排查作业 重置作业状态 + */ + @Override + public int resetWorkStatus(Long workId) { + return preventDangerCheckWorkRepository.resetWorkStatus(workId); + } + + /** + * 隐患排查作业 查询可调度的列表 + */ + @Override + public List<PreventDangerCheckWork> listScheduleCheckWork() { + return preventDangerCheckWorkRepository.listScheduleCheckWork(); + } + /** + * 排查作业-手工上报-配置 + */ + @Override + public int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventDangerCheckWorkRepository.updateCheckWorkReport(preventHandReportConfigReqDTO); + } + + + /** + * 上报数据,任务配置检索 + */ + @Override + public List<PreventDangerCheckWork> listReportWork() { + return preventDangerCheckWorkRepository.listReportWork(); + } + /** + * 上报数据,任务配置上报状态变更 + */ + @Override + public void updateWorkReportStatus(HandlerReportParam handlerReportParam) { + int result = preventDangerCheckWorkRepository.updateWorkReportStatus(handlerReportParam); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + /** + * 排查作业-有问题的work + */ + @Override + public List<PreventDangerCheckWork> listErrorCheckWork(Date date) { + return preventDangerCheckWorkRepository.listErrorCheckWork(date); + } + /** + * 排查作业-重置错误时间 + */ + @Override + public int resetErrorWork(Date resetTime, Long id) { + return preventDangerCheckWorkRepository.resetErrorWork(resetTime, id); + } + /** + * 排查作业-检查待执行列表 + */ + @Override + public List<PreventDangerCheckWork> listExecCheckWork(Date startTime, Date endTime) { + return preventDangerCheckWorkRepository.listExecCheckWork(startTime, endTime); + } + /** + * 排查作业-检查待执行列表 + */ + @Override + public int resetCheckWorkStatus(Long Id) { + return preventDangerCheckWorkRepository.resetCheckWorkStatus(Id); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerImageServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerImageServiceImpl.java new file mode 100644 index 0000000..b30b98d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerImageServiceImpl.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerImage; +import com.gk.hotwork.doublePrevention.enums.DataConvertEnum; +import com.gk.hotwork.doublePrevention.enums.ImageTypeEnum; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.repository.PreventDangerImageRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerImageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; + + +@Service("preventDangerImageService") +public class PreventDangerImageServiceImpl extends ServiceImpl<PreventDangerImageRepository, PreventDangerImage> implements PreventDangerImageService { + + @Autowired + private PreventDangerImageRepository preventDangerImageRepository; + + @Override + public List<PreventDangerImage> listImagesByParentId(Long parentId, ImageTypeEnum typeEnum) { + if (parentId == null || typeEnum == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return preventDangerImageRepository.selectList(new LambdaQueryWrapper<PreventDangerImage>() + .eq(PreventDangerImage::getParentId, parentId) + .eq(PreventDangerImage::getStatus, DataConvertEnum.DELETE_STATUS_USE.getCode()) + .eq(PreventDangerImage::getType,typeEnum.getCode())); + } + + @Override + public void deleteImageByParentId(Long parentId, ImageTypeEnum typeEnum) { + if (parentId == null || typeEnum == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + preventDangerImageRepository.updateStatusByParentId(parentId, typeEnum.getCode(), DataConvertEnum.DELETE_STATUS_DISCARD.getCode()); + } + + @Override + public List<PreventDangerImage> listImagesByParentId(Long parentId) { + return preventDangerImageRepository.selectList(new LambdaQueryWrapper<PreventDangerImage>() + .eq(PreventDangerImage::getParentId, parentId) + .eq(PreventDangerImage::getStatus, DataConvertEnum.DELETE_STATUS_USE.getCode())); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageServiceImpl.java new file mode 100644 index 0000000..0e243bd --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageServiceImpl.java @@ -0,0 +1,172 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManage; +import com.gk.hotwork.doublePrevention.entity.dto.query.db.OwnRectifyPageDBQuery; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerManageQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventDangerManageRepository; +import com.gk.hotwork.doublePrevention.repository.param.*; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerManageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service("PreventDangerManageService") +public class PreventDangerManageServiceImpl + extends ServiceImpl<PreventDangerManageRepository, PreventDangerManage> implements PreventDangerManageService { + + @Autowired + private PreventDangerManageRepository preventDangerManageRepository; + + /** + * 隐患治理清单-分页查询 + */ + @Override + public IPage<PreventDangerManage> getDangerManagePage(Page<Object> page, PreventDangerManageQueryReqDTO manageQueryReqDTO) { + return preventDangerManageRepository.getDangerManagePage(page, manageQueryReqDTO); + } + /** + * 隐患治理清单-新增 + */ + @Override + public int saveDangerManage(PreventDangerManage dangerManage) { + return preventDangerManageRepository.insert(dangerManage); + } + + /** + * 隐患治理清单-修改 + */ + @Override + public int updateDangerManage(PreventDangerManageUpdateParams updateParams) { + return preventDangerManageRepository.updateDangerManage(updateParams); + } + + /** + * 隐患治理清单-删除 + */ + @Override + public int deleteDangerManage(PreventDeleteParams deleteParams) { + return preventDangerManageRepository.deleteDangerManage(deleteParams); + } + + /** + * 隐患治理清单-根据dangerCode查询 + */ + @Override + public PreventDangerManage getDangerManageByCode(String dangerCode) { + return preventDangerManageRepository.getDangerManageByCode(dangerCode); + } + /** + * 隐患治理清单-根据id查询 + */ + @Override + public PreventDangerManage getDangerManageById(Long dangerManagerId) { + return preventDangerManageRepository.getDangerManageById(dangerManagerId); + } + /** + * 隐患治理清单-根据taskId查询 + */ + @Override + public PreventDangerManage getDangerManageByTaskId(Long taskId) { + return preventDangerManageRepository.getDangerManageByTaskId(taskId); + } + + /** + * 隐患治理清单-列表 + */ + @Override + public List<PreventDangerManage> listDangerManage() { + return preventDangerManageRepository.listDangerManage(); + } + /** + * 隐患管理-手工上报-配置 + */ + @Override + public int updateDangerManagerReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventDangerManageRepository.updateDangerManagerReport(preventHandReportConfigReqDTO); + } + /** + * 隐患管理-验收 + */ + @Override + public int updateRectifyResult(UpdateRectifyResultParams updateParams) { + return preventDangerManageRepository.updateRectifyResult(updateParams); + } + + /** + * 隐患管理-延期状态 + */ + @Override + public int updateManagerStatus(Long dangerManagerId, byte code) { + return preventDangerManageRepository.updateManagerStatus(dangerManagerId, code); + } + + /** + * 隐患管理-关闭隐患单 + */ + @Override + public int closeDanger(CloseDangerParams closeDangerParams) { + return preventDangerManageRepository.closeDanger(closeDangerParams); + } + /** + * 隐患-整改完成的 + */ + @Override + public List<PreventDangerManage> listRectifyOver(PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + return preventDangerManageRepository.listRectifyOver(rectifyOverQueryReqDTO); + } + + /** + * 隐患-上报数据 + */ + @Override + public List<PreventDangerManage> listReportDanger() { + return preventDangerManageRepository.listReportDanger(); + } + /** + * 隐患-上报数据状态变更 + */ + @Override + public void updateManageReportStatus(HandlerReportParam handlerReportParam) { + int result = preventDangerManageRepository.updateManageReportStatus(handlerReportParam); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public IPage<PreventDangerManage> getDangerManagePageTORectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + return preventDangerManageRepository.getDangerManagePageTORectify(objectPage, rectifyOverQueryReqDTO); + } + + + @Override + public int countByCreateTime(Date startTime, Date endTime) { + if(startTime == null || endTime == null || startTime.after(endTime)) + return 0; + return preventDangerManageRepository.countByCreateTime(startTime,endTime); + } + + @Override + public PreventDangerManage findByDangerSerialCode(String serialCode) { + if(serialCode == null || serialCode.length() < 13){ + return null; + } + return preventDangerManageRepository.findByDangerSerialCode(serialCode); + } + + @Override + public List<PreventDangerCheckTaskRectifyDO> listOwnRectifyPage(Page<PreventDangerCheckTaskRectifyDO> page, OwnRectifyPageDBQuery dbQuery) { + return preventDangerManageRepository.listOwnRectifyPage(page,dbQuery); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageTimeoutServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageTimeoutServiceImpl.java new file mode 100644 index 0000000..4b89e5e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerManageTimeoutServiceImpl.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.entity.PreventDangerManageTimeout; +import com.gk.hotwork.doublePrevention.repository.PreventDangerManageTimeoutRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerManageTimeoutService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service("PreventDangerManageTimeoutService") +public class PreventDangerManageTimeoutServiceImpl + extends ServiceImpl<PreventDangerManageTimeoutRepository, PreventDangerManageTimeout> implements PreventDangerManageTimeoutService { + + @Autowired + private PreventDangerManageTimeoutRepository preventDangerManageTimeoutRepository; + + /** + * 是否延期状态设置 + * */ + @Override + public int insert(PreventDangerManageTimeout manageTimeout) { + return preventDangerManageTimeoutRepository.insert(manageTimeout); + } + /** + * 延期 + * */ + @Override + public int updateTimeout(PreventDangerManageTimeout manageTimeout) { + return preventDangerManageTimeoutRepository.manageTimeout(manageTimeout); + } + /** + * 延期状态-根据dangerManagerId查询 + * */ + @Override + public PreventDangerManageTimeout getByManageId(Long dangerManagerId) { + return preventDangerManageTimeoutRepository.getByManageId(dangerManagerId); + } + /** + * 延期状态-根据RectifyId查询 + * */ + @Override + public PreventDangerManageTimeout getByRectifyId(Long rectifyId) { + return preventDangerManageTimeoutRepository.getByRectifyId(rectifyId); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerRectifyServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerRectifyServiceImpl.java new file mode 100644 index 0000000..1f74852 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventDangerRectifyServiceImpl.java @@ -0,0 +1,151 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerRectifyQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventDangerRectifyRepository; +import com.gk.hotwork.doublePrevention.repository.param.*; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerRectifyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("PreventDangerRectifyService") +public class PreventDangerRectifyServiceImpl + extends ServiceImpl<PreventDangerRectifyRepository, PreventDangerRectify> implements PreventDangerRectifyService { + + @Autowired + private PreventDangerRectifyRepository preventDangerRectifyRepository; + + /** + * 隐患整改清单-分页查询 + */ + @Override + public IPage<PreventDangerRectify> getDangerRectifyPage(Page<Object> page, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) { + return preventDangerRectifyRepository.getDangerRectifyPage(page, rectifyQueryReqDTO); + } + + /** + * 隐患整改清单-已整改-分页查询 + */ + @Override + public IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + return preventDangerRectifyRepository.getRectifyOverPage(objectPage, rectifyOverQueryReqDTO); + } + + /** + * 隐患整改清单-新增 + */ + @Override + public int saveDangerRectify(PreventDangerRectify dangerRectify) { + int result = preventDangerRectifyRepository.insert(dangerRectify); + if (result == 0) { + throw new BusinessException(E.ADD_FAIL, "新增失败"); + } + return result; + } + + /** + * 隐患整改清单-修改 + */ + @Override + public int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams) { + int result = preventDangerRectifyRepository.updateDangerRectify(updateParams); + return result; + } + + /** + * 隐患整改清单-删除 + */ + @Override + public int deleteDangerRectify(PreventDeleteParams deleteParams) { + int result = preventDangerRectifyRepository.deleteDangerRectify(deleteParams); + if (result == 0) { + throw new BusinessException(E.NOT_DELETE, "删除失败"); + } + return result; + } + + /** + * 隐患整改清单-整改验收报告 + */ + @Override + public int applyReport(PreventDangerReportRectifyUpdayeParams reportParams) { + return preventDangerRectifyRepository.applyReport(reportParams); + } + /** + * 隐患整改清单-验收 + */ + @Override + public int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams) { + return preventDangerRectifyRepository.reportRectify(reportParams); + } + + /** + * 隐患整改清单-根据隐患单Code查询 + */ + @Override + public PreventDangerRectify getRectifyByCode(String dangerCode) { + return preventDangerRectifyRepository.getRectifyByCode(dangerCode); + } + /** + * 隐患整改清单-延期 + */ + @Override + public int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams) { + return preventDangerRectifyRepository.updateRectifyTime(updateParams); + } + /** + * 隐患整改清单-根据ID查询 + */ + @Override + public PreventDangerRectify getRectifyById(Long id) { + return preventDangerRectifyRepository.getRectifyById(id); + } + + /** + * 隐患整改清单-关闭整改单 + */ + @Override + public int closeDanger(CloseDangerParams closeDangerParams) { + return preventDangerRectifyRepository.closeDanger(closeDangerParams); + } + + /** + * 隐患整改清单-根据ManageID查询 + */ + @Override + public PreventDangerRectify getRectifyByManageId(Long manageId) { + return preventDangerRectifyRepository.getRectifyByManageId(manageId); + } + /** + * 隐患整改清单-根据ManageID查询-包含删除数据 + */ + @Override + public PreventDangerRectify getRectifyByManageIdForReport(Long manageId) { + return preventDangerRectifyRepository.getRectifyByManageIdForReport(manageId); + } + /** + * 隐患整改清单-变更上报状态 + */ + @Override + public void updateRectifyReportStatus(HandlerReportParam handlerReportParam) { + int result = preventDangerRectifyRepository.updateRectifyReportStatus(handlerReportParam); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + /** + * 隐患整改完成、验收-数据查询 + * */ + @Override + public IPage<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + return preventDangerRectifyRepository.getDangerRectifyPageToOverRectify(objectPage, rectifyOverQueryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventProduceDeviceServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventProduceDeviceServiceImpl.java new file mode 100644 index 0000000..d21bc72 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventProduceDeviceServiceImpl.java @@ -0,0 +1,131 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.repository.PreventProduceDeviceRepository; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventProduceDeviceUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventProduceDeviceService; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * (PreventProduceDevice)表服务实现类 + * + * @author makejava + * @since 2022-06-25 10:40:17 + */ +@Service("preventProduceDeviceService") +public class PreventProduceDeviceServiceImpl extends ServiceImpl<PreventProduceDeviceRepository, PreventProduceDevice> implements PreventProduceDeviceService { + + @Resource + private PreventProduceDeviceRepository preventProduceDeviceRepository; + + /** + * 生产装置-分页查询 + * */ + @Override + public IPage<PreventProduceDevice> getDevicePage(Page<Object> page, @Param("queryParams") PreventProduceDeviceQueryParams queryParams) { + return preventProduceDeviceRepository.getDevicePage(page, queryParams); + } + + /** + * 生产装置-根绝设备名称和所在位置查询 + * */ + @Override + public PreventProduceDevice selectByNameAndLocation(String produceDeviceName, String location) { + + return selectByNameAndLocation(produceDeviceName, location); + } + + /** + * 生产装置-新增 + * */ + @Override + public int saveDevice(PreventProduceDevice device) { + int result = preventProduceDeviceRepository.insert(device); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + return result; + } + + /** + * 生产装置-删除 + */ + @Override + public int deleteById(PreventProduceDeviceDeleteParams param) { + int result = preventProduceDeviceRepository.deleteOne(param); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_DEL_ERROR); + } + return result; + } + /** + * 生产装置-修改信息 + */ + @Override + public int updateProduceDevice(PreventProduceDeviceUpdateParams updateParams) { + int result = preventProduceDeviceRepository.updateProduceDevice(updateParams); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return result; + } + /** + * 生产装置-查询-通过设备名称 + */ + @Override + public PreventProduceDevice getDeviceByName(String produceDeviceName) { + PreventProduceDevice device = preventProduceDeviceRepository.getByDeviceName(produceDeviceName); + return device; + } + + + /** + * 生产装置-查询-通过设备id + */ + @Override + public PreventProduceDevice getDeviceById(Long id) { + PreventProduceDevice device = preventProduceDeviceRepository.selectByDeviceId(id); + return device; + } + + + /** + * 生产装置-根绝风险等级查询 + * */ + @Override + public PreventProduceDevice getByLevel(Byte riskLevel) { + PreventProduceDevice byRiskLevel = preventProduceDeviceRepository.getByRiskLevel(riskLevel); + return byRiskLevel; + } + /** + * 生产装置- 查询生产装置列表 + */ + @Override + public List<PreventProduceDevice> getListDevices() { + return preventProduceDeviceRepository.getListDevices(); + } + /** + * 生产装置- 查询生产装置-通过名称与部门 + */ + @Override + public PreventProduceDevice getDeviceByNameAndDep(String name, String dep) { + return preventProduceDeviceRepository.getDeviceByNameAndDep(name, dep); + } + + @Override + public Map countDeviceEveryLevel() { + return preventProduceDeviceRepository.countDeviceEveryLevel(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportBatchServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportBatchServiceImpl.java new file mode 100644 index 0000000..78689bf --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportBatchServiceImpl.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.entity.PreventReportBatch; +import com.gk.hotwork.doublePrevention.repository.PreventReportBatchRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportBatchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("PreventReportBatchService") +public class PreventReportBatchServiceImpl extends ServiceImpl<PreventReportBatchRepository, PreventReportBatch> implements PreventReportBatchService { + + @Autowired + private PreventReportBatchRepository preventReportBatchRepository; + + /** + * 批次Id插入 + * */ + @Override + public int insertBatchId(PreventReportBatch reportBatch) { + int result = preventReportBatchRepository.insert(reportBatch); + if (result < 1){ + throw new RuntimeException("批次id失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckRecordFromTaskServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckRecordFromTaskServiceImpl.java new file mode 100644 index 0000000..43b62bc --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckRecordFromTaskServiceImpl.java @@ -0,0 +1,72 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckRecordFromTask; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckRecordFromTaskReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportCheckRecordFromTaskRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportCheckRecordFromTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportCheckRecordFromTaskService") +public class PreventReportCheckRecordFromTaskServiceImpl + extends ServiceImpl<PreventReportCheckRecordFromTaskRepository, PreventReportCheckRecordFromTask> implements PreventReportCheckRecordFromTaskService { + + @Autowired + private PreventReportCheckRecordFromTaskRepository preventReportCheckRecordFromTaskRepository; + + /** + * 批量插入任务记录 + * */ + @Override + public int insert(PreventReportCheckRecordFromTask recordFromTasks) { + return preventReportCheckRecordFromTaskRepository.insert(recordFromTasks); + } + + /** + * 任务记录-分页查询 + * */ + @Override + public IPage<PreventReportCheckRecordFromTask> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckRecordFromTaskReqDTO queryReqDTO) { + return preventReportCheckRecordFromTaskRepository.getReportTaskFromWorkPage(objectPage, queryReqDTO); + } + + /** + * 任务-查询待上报 + * */ + @Override + public List<PreventReportCheckRecordFromTask> listReportTaskRecordDate() { + return preventReportCheckRecordFromTaskRepository.listReportTaskRecordDate(); + } + /** + * 任务-待上报状态变更 + * */ + @Override + public void updateTaskReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportCheckRecordFromTaskRepository.updateTaskReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "修改任务配置数据上报状态失败"); + } + } + + @Override + public PreventReportCheckRecordFromTask getTaskById(String id) { + return preventReportCheckRecordFromTaskRepository.getTaskById(id); + } + + @Override + public int updateTaskById(PreventReportCheckRecordFromTask recordFromTasks) { + int result = preventReportCheckRecordFromTaskRepository.updateTaskById(recordFromTasks); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "修改任务配置数据失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckTaskFromWorkServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckTaskFromWorkServiceImpl.java new file mode 100644 index 0000000..5669657 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportCheckTaskFromWorkServiceImpl.java @@ -0,0 +1,83 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventReportCheckTaskFromWork; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportCheckTaskFromWorkReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportCheckTaskFromWorkRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportCheckTaskFromWorkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportCheckTaskFromWorkService") +public class PreventReportCheckTaskFromWorkServiceImpl + extends ServiceImpl<PreventReportCheckTaskFromWorkRepository, PreventReportCheckTaskFromWork> implements PreventReportCheckTaskFromWorkService { + + @Autowired + private PreventReportCheckTaskFromWorkRepository preventReportCheckTaskFromWorkRepository; + + /** + * 批量插入数据 + * */ + @Override + public int insert(List<PreventReportCheckTaskFromWork> taskFromWorkLists) { + return preventReportCheckTaskFromWorkRepository.insertList(taskFromWorkLists); + } + + /** + * 上报数据-任务配置-分页查询 + */ + @Override + public IPage<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(Page<Object> objectPage, PreventReportCheckTaskFromWorkReqDTO queryReqDTO) { + return preventReportCheckTaskFromWorkRepository.getReportTaskFromWorkPage(objectPage,queryReqDTO); + } + /** + * 插入数据 + * */ + @Override + public int insertTaskFromWorkList(PreventReportCheckTaskFromWork taskFromWork) { + int result = preventReportCheckTaskFromWorkRepository.insert(taskFromWork); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + return result; + } + + /** + * 任务配置 -查询待上报 + * */ + @Override + public List<PreventReportCheckTaskFromWork> listReportTaskFromWorkDate() { + return preventReportCheckTaskFromWorkRepository.listReportTaskFromWorkDate(); + } + /** + * 任务配置 -待上报状态变更 + * */ + @Override + public void updateWorkReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportCheckTaskFromWorkRepository.updateWorkReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "任务-配置 状态变更失败"); + } + } + + @Override + public PreventReportCheckTaskFromWork getWorkById(String id) { + return preventReportCheckTaskFromWorkRepository.getWorkById(id); + } + + @Override + public int updateWorkById(PreventReportCheckTaskFromWork taskFromWorkList) { + int result = preventReportCheckTaskFromWorkRepository.updateWorkById(taskFromWorkList); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "任务-配置 状态变更失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigLogServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigLogServiceImpl.java new file mode 100644 index 0000000..ab911aa --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigLogServiceImpl.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfigLog; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportConfigLogRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportConfigLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("PreventReportConfigLogService") +public class PreventReportConfigLogServiceImpl extends ServiceImpl<PreventReportConfigLogRepository, PreventReportConfigLog> implements PreventReportConfigLogService { + + @Autowired + private PreventReportConfigLogRepository preventReportConfigLogRepository; + + @Override + public int insertOldReportConfig(PreventReportConfigLog preventReportConfigLog) { + return preventReportConfigLogRepository.insert(preventReportConfigLog); + } + + /** + * 数据上报配置历史记录-查询 + */ + @Override + public IPage<PreventReportConfigLog> getReportConfigLogPage(Page<Object> page, PreventReportConfigLogQueryReqDTO queryReqDTO) { + return preventReportConfigLogRepository.getReportConfigLogPage(page, queryReqDTO); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigServiceImpl.java new file mode 100644 index 0000000..a3a4af0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportConfigServiceImpl.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.entity.PreventReportConfig; +import com.gk.hotwork.doublePrevention.repository.PreventReportConfigRepository; +import com.gk.hotwork.doublePrevention.repository.param.PreventReportConfigUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportConfigService") +public class PreventReportConfigServiceImpl extends ServiceImpl<PreventReportConfigRepository, PreventReportConfig> implements PreventReportConfigService { + + @Autowired + private PreventReportConfigRepository preventReportConfigRepository; + + /** + * 数据上报配置-查询 + */ + @Override + public List<PreventReportConfig> ListReportConfigs() { + return preventReportConfigRepository.ListReportConfigs(); + } + + /** + * 数据上报配置-修改 + */ + @Override + public int updateReportConfig(PreventReportConfigUpdateParams updateParams) { + return preventReportConfigRepository.updateReportConfig(updateParams); + } + + /** + * 数据上报配置-按照id查询 + */ + @Override + public PreventReportConfig getReportConfigById(int Id) { + return preventReportConfigRepository.selectById(Id); + } + + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportDangerInfoServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportDangerInfoServiceImpl.java new file mode 100644 index 0000000..ea9b695 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportDangerInfoServiceImpl.java @@ -0,0 +1,71 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventReportDangerInfo; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportDangerInfoReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportDangerInfoRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportDangerInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportDangerInfoService") +public class PreventReportDangerInfoServiceImpl + extends ServiceImpl<PreventReportDangerInfoRepository, PreventReportDangerInfo> implements PreventReportDangerInfoService { + + @Autowired + private PreventReportDangerInfoRepository preventReportDangerInfoRepository; + + /** + * 插入隐患信息 + * */ + @Override + public int insert(PreventReportDangerInfo danger) { + return preventReportDangerInfoRepository.insert(danger); + } + /** + * 上报数据-隐患信息-分页查询 + */ + @Override + public IPage<PreventReportDangerInfo> getReportDangerInfoPage(Page<Object> objectPage, PreventReportDangerInfoReqDTO queryReqDTO) { + return preventReportDangerInfoRepository.getReportDangerInfoPage(objectPage, queryReqDTO); + } + + /** + * 上报数据-待上报数据查询 + */ + @Override + public List<PreventReportDangerInfo> listReportDangerDate() { + return preventReportDangerInfoRepository.listReportDangerDate(); + } + /** + * 上报数据-待上报状态变更 + */ + @Override + public void updateTaskReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportDangerInfoRepository.updateTaskReportStatus(handlerReportParam); + if (result < 0){ + throw new BusinessException(E.UPDATE_FAIL, "隐患信息状态变更失败"); + } + } + + @Override + public PreventReportDangerInfo getDangerById(String id) { + return preventReportDangerInfoRepository.getDangerById(id); + } + + @Override + public int updateDangerById(PreventReportDangerInfo danger) { + int result = preventReportDangerInfoRepository.updateDangerById(danger); + if (result < 0){ + throw new BusinessException(E.UPDATE_FAIL, "隐患信息状态变更失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskAnaUnitServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskAnaUnitServiceImpl.java new file mode 100644 index 0000000..e7d63e4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskAnaUnitServiceImpl.java @@ -0,0 +1,89 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportRiskAnaUnitRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportRiskAnaUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportRiskAnaUnitService") +public class PreventReportRiskAnaUnitServiceImpl + extends ServiceImpl<PreventReportRiskAnaUnitRepository, PreventReportRiskAnaUnit> implements PreventReportRiskAnaUnitService { + + @Autowired + private PreventReportRiskAnaUnitRepository preventReportRiskAnaUnitRepository; + + /** + * 上报数据-风险分析单元-分页查询 + */ + @Override + public IPage<PreventReportRiskAnaUnit> getReportRiskUnitPage(Page<Object> page, PreReportRiskUnitQueryReqDTO queryReqDTO) { + return preventReportRiskAnaUnitRepository.getReportRiskUnitPage(page, queryReqDTO); + } + + /** + * 上报数据-风险分析单元-分页查询 + */ + @Override + public int insert(List<PreventReportRiskAnaUnit> unitLists) { + return preventReportRiskAnaUnitRepository.saveList(unitLists); + } + + /** + * 上报数据-插入 + */ + @Override + public int insertUnitList(PreventReportRiskAnaUnit unit) { + int result = preventReportRiskAnaUnitRepository.insert(unit); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + return result; + } + + /** + * 上报数据-查询待上报数据 + */ + @Override + public List<PreventReportRiskAnaUnit> listReportUnitDate() { + return preventReportRiskAnaUnitRepository.listReportUnitDate(); + } + + /** + * 上报数据-修改待上报 + */ + @Override + public void updateReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportRiskAnaUnitRepository.updateReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + } + /** + * 上报数据-更新数据 + */ + @Override + public int updateUnitById(PreventReportRiskAnaUnit unitList) { + int result = preventReportRiskAnaUnitRepository.updateUnitById(unitList); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + return result; + } + /** + * 上报数据-更新数据 + */ + @Override + public PreventReportRiskAnaUnit getUnitById(String id) { + return preventReportRiskAnaUnitRepository.getUnitById(id); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskControlMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskControlMeasureServiceImpl.java new file mode 100644 index 0000000..fb5725e --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskControlMeasureServiceImpl.java @@ -0,0 +1,84 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportRiskControlMeasureReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportRiskControlMeasureRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportRiskControlMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportRiskControlMeasureService") +public class PreventReportRiskControlMeasureServiceImpl + extends ServiceImpl<PreventReportRiskControlMeasureRepository, PreventReportRiskControlMeasure> implements PreventReportRiskControlMeasureService { + + @Autowired + private PreventReportRiskControlMeasureRepository preventReportRiskControlMeasureRepository; + + /** + * 批量插入 + * */ + @Override + public int insert(List<PreventReportRiskControlMeasure> measureLists) { + return preventReportRiskControlMeasureRepository.insertList(measureLists); + } + + /** + * 上报数据-管控措施-分页查询 + */ + @Override + public IPage<PreventReportRiskControlMeasure> getReportMeasurePage(Page<Object> objectPage, PreventReportRiskControlMeasureReqDTO queryReqDTO) { + return preventReportRiskControlMeasureRepository.getReportMeasurePage(objectPage, queryReqDTO); + } + /** + * 插入 + * */ + @Override + public int insertMeasureList(PreventReportRiskControlMeasure measure) { + int result = preventReportRiskControlMeasureRepository.insert(measure); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + return result; + } + + /** + * 管控措施-上报数据 + * */ + @Override + public List<PreventReportRiskControlMeasure> listReportMeasureDate() { + return preventReportRiskControlMeasureRepository.listReportMeasureDate(); + } + + /** + * 管控措施-修改上报状态 + * */ + @Override + public void updateMeasureReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportRiskControlMeasureRepository.updateMeasureReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "风险单元状态更新失败"); + } + } + + @Override + public PreventReportRiskControlMeasure getMeasureById(String id) { + return preventReportRiskControlMeasureRepository.getMeasureById(id); + } + + @Override + public int updateMeasureById(PreventReportRiskControlMeasure measureList) { + int result = preventReportRiskControlMeasureRepository.updateMeasureById(measureList); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "风险单元状态更新失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskEventServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskEventServiceImpl.java new file mode 100644 index 0000000..d30a7fa --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventReportRiskEventServiceImpl.java @@ -0,0 +1,86 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventReportRiskEventRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.service.baseService.PreventReportRiskEventService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventReportRiskEventService") +public class PreventReportRiskEventServiceImpl + extends ServiceImpl<PreventReportRiskEventRepository, PreventReportRiskEvent> implements PreventReportRiskEventService { + + @Autowired + private PreventReportRiskEventRepository preventReportRiskEventRepository; + + /** + * 批量插入 + * */ + @Override + public int insert(List<PreventReportRiskEvent> eventLists) { + return preventReportRiskEventRepository.saveList(eventLists); + } + + /** + * 分页查询 + * */ + @Override + public IPage<PreventReportRiskEvent> getReportRiskEventPage(Page<Object> objectPage, PreReportRiskEventQueryReqDTO queryReqDTO) { + return preventReportRiskEventRepository.getReportRiskEventPage(objectPage, queryReqDTO); + } + + /** + * 插入 + * */ + @Override + public int insertEventLists(PreventReportRiskEvent event) { + int result = preventReportRiskEventRepository.insert(event); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存风险单元失败"); + } + return result; + } + + /** + * 上报数据-查询待上报数据 + * */ + @Override + public List<PreventReportRiskEvent> listReportEventDate() { + return preventReportRiskEventRepository.listReportEventDate(); + } + + /** + * 修改上报状态 + * */ + @Override + public int updateEventReportStatus(HandlerReportParam handlerReportParam) { + int result = preventReportRiskEventRepository.updateEventReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "修改上报-事件状态失败"); + } + return result; + } + + @Override + public PreventReportRiskEvent getEventById(String id) { + return preventReportRiskEventRepository.getEventById(id); + } + + @Override + public int updateEventById(PreventReportRiskEvent eventList) { + int result = preventReportRiskEventRepository.updateEventById(eventList); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "修改事件失败"); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskAnaUnitServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskAnaUnitServiceImpl.java new file mode 100644 index 0000000..16a3a88 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskAnaUnitServiceImpl.java @@ -0,0 +1,130 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskAnaUnitQueryReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventRiskAnaUnitRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskAnaUnitUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventRiskAnaUnitService; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventRiskAnaUnitService") +public class PreventRiskAnaUnitServiceImpl extends ServiceImpl<PreventRiskAnaUnitRepository, PreventRiskAnaUnit> implements PreventRiskAnaUnitService{ + + @Autowired + private PreventRiskAnaUnitRepository preventRiskAnaUnitRepository; + + /** + * 风险分析单元-分页查询 + */ + @Override + public IPage<PreventRiskAnaUnit> getRiskUnitPage(Page<Object> page, @Param("queryParams") PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO) { + + return preventRiskAnaUnitRepository.getRiskUnitPage(page, riskAnaUnitQueryReqDTO); + } + /** + * 风险分析单元-新增 + */ + @Override + public int saveRiskAnaUnit(PreventRiskAnaUnit riskAnaUnit) { + + return preventRiskAnaUnitRepository.insert(riskAnaUnit); + } + + /** + * 风险分析单元-根据名称获取单元信息 + */ + @Override + public PreventRiskAnaUnit getRiskUnitByName(String riskUnitName) { + + return preventRiskAnaUnitRepository.getRiskUnitByName(riskUnitName); + } + + /** + * 风险分析单元-修改 + */ + @Override + public int updateRiskAnaUnitById(PreventRiskAnaUnitUpdateParams updateParams) { + + int result = preventRiskAnaUnitRepository.updateRiskAnaUnitById(updateParams); + return result; + } + + /** + * 风险分析单元-删除 + */ + @Override + public int deleteRiskAnaUnitById(PreventRiskAnaUnitDeleteParams deleteParams) { + return preventRiskAnaUnitRepository.deleteRiskAnaUnitById(deleteParams); + } + + /** + * 风险事件-分页查询 + */ + @Override + public PreventRiskAnaUnit getRiskUnitById(Long riskUnitId) { + return preventRiskAnaUnitRepository.getRiskUnitById(riskUnitId); + } + + /** + * 风险分析单元-根据produce_device_uuid查询 + */ + @Override + public List<PreventRiskAnaUnit> getRiskUnitByDeviceId(Long deviceId) { + return preventRiskAnaUnitRepository.getRiskUnitByDeviceId(deviceId); + } + + /** + * 风险分析单元-根据风险编码查询 + */ + @Override + public PreventRiskAnaUnit getRiskUnitByCode(String riskCode) { + return preventRiskAnaUnitRepository.getRiskUnitByCode(riskCode); + } + + /** + * 风险事件-新增 - 单元list查询 + */ + @Override + public List<PreventRiskAnaUnit> listRiskUnits() { + return preventRiskAnaUnitRepository.listRiskUnits(); + } + + /** + * 安全风险分析单元-手工上报-配置 + */ + @Override + public int updateRiskAnaUnitReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventRiskAnaUnitRepository.updateRiskAnaUnitReport(preventHandReportConfigReqDTO); + } + + /** + * 安全风险分析单元-上报数据检索 + */ + @Override + public List<PreventRiskAnaUnit> listRiskAnaUnit() { + return preventRiskAnaUnitRepository.listRiskAnaUnit(); + } + /** + * 安全风险分析单元-修改上报状态 + */ + @Override + public void updateReportStatus(HandlerReportParam handlerReportParam) { + int result = preventRiskAnaUnitRepository.updateReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "更新数据上报状态失败"); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java new file mode 100644 index 0000000..cbb7fe9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java @@ -0,0 +1,205 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.dto.PreventRiskControlMeasureListDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskControlMeasureListQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventrCheckContentRespDTO; +import com.gk.hotwork.doublePrevention.repository.PreventRiskControlMeasureRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskControlMeasureUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventRiskControlMeasureService; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventRiskControlMeasureService") +public class PreventRiskControlMeasureServiceImpl extends ServiceImpl<PreventRiskControlMeasureRepository, PreventRiskControlMeasure> implements PreventRiskControlMeasureService { + + @Autowired + private PreventRiskControlMeasureRepository preventRiskControlMeasureRepository; + + /** + * 管控措施-分页查询 + */ + @Override + public IPage<PreventRiskControlMeasure> getRiskControlMeasurePage(@Param("page") Page<Object> page, @Param("queryParams")PreventRiskControlMeasureQueryParams queryParams) { + return preventRiskControlMeasureRepository.getRiskControlMeasurePage(page, queryParams); + //queryParams.getControlWay(), queryParams.getRiskEventId() + } + + /** + * 管控措施-根据RiskEventId查询 + */ + @Override + public List<PreventRiskControlMeasure> getRiskControlMeasureByRiskEventId(Long riskEventId) { + return preventRiskControlMeasureRepository.getRiskControlMeasureByRiskEventId(riskEventId); + } + + /** + * 管控措施-新增 + */ + @Override + public int saveRiskControlMeasure(PreventRiskControlMeasure controlMeasure) { + int insertResult = preventRiskControlMeasureRepository.insert(controlMeasure); + return insertResult; + } + /** + * 管控措施-根据措施编码与riskEventId查询 + */ + @Override + public PreventRiskControlMeasure getRiskControlMeasureByCodeAndEventId(Long riskEventId, String controlMeasureCode) { + return preventRiskControlMeasureRepository.getRiskControlMeasureByCodeAndEventId(riskEventId, controlMeasureCode); + } + + /** + * 管控措施-修改 + */ + @Override + public int updateRiskControlMeasure(PreventRiskControlMeasureUpdateParams updateParams) { + return preventRiskControlMeasureRepository.updateRiskControlMeasure(updateParams); + } + /** + * 管控措施-根据id查询 + */ + @Override + public PreventRiskControlMeasure getControlMeasureById(Long id) { + return preventRiskControlMeasureRepository.selectByMeasureId(id); + } + + /** + * 管控措施-删除 + */ + @Override + public int deleteRiskControlMeasure(PreventRiskControlMeasureDeleteParams deleteParams) { + return preventRiskControlMeasureRepository.deleteRiskControlMeasure(deleteParams); + } + /** + * 任务单元、任务关联修改,设置为空 + * 管控措施-修改管控措施 + */ + @Override + public void updateControlMeasureByUnitId(Long unitId) { + int result = preventRiskControlMeasureRepository.updateControlMeasureByUnitId(unitId); + if (result < 1){ + throw new RuntimeException("重置单元与work的关联失败"); + } + } + + /** + * 管控措施-根据measureCode查询 + */ + @Override + public PreventRiskControlMeasure getControlMeasureByCode(String measureCode) { + return preventRiskControlMeasureRepository.getControlMeasureByCode(measureCode); + } + + /** + * 管控措施-根据measureCode + * 修改关联checkWorkId + */ + @Override + public PreventRiskControlMeasure updateWorkIdByMeasureCode(String controlMeasureCode, Long checkWorkId) { + return preventRiskControlMeasureRepository.updateWorkIdByMeasureCode(controlMeasureCode, checkWorkId); + } + + /** + * 管控措施-根据WorkId查询 + */ + @Override + public List<PreventRiskControlMeasure> getControlMeasureByWorkId(Long workId) { + return preventRiskControlMeasureRepository.getControlMeasureByWorkId(workId); + } + + /** + * 管控措施-根据单元id查找对应措施id列表 + */ + @Override + public List<PreventRiskControlMeasure> getlistByUnitId(Long taskUnitId) { + + return preventRiskControlMeasureRepository.getListByUnitId(taskUnitId); + } + /** + * 管控措施-根据measureId修改关联的任务taskId + */ + @Override + public void updateControlMeasureByMeasureIdAndUnitId(Long measureId, Long taskUnitId) { + int result = preventRiskControlMeasureRepository.updateControlMeasureByMeasureIdAndUnitId(measureId, taskUnitId); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + /** + * 安全风险事件-手工上报-配置 + */ + @Override + public int updateMeasuresReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventRiskControlMeasureRepository.updateRiskEventReport(preventHandReportConfigReqDTO); + } + + /** + * 措施-手工上报-配置 + */ + @Override + public List<PreventRiskControlMeasure> listReportMeasure() { + return preventRiskControlMeasureRepository.listReportMeasure(); + } + /** + * 管控措施- 管控措施列表 + */ + @Override + public List<PreventRiskControlMeasure> listControlMeasure() { + return preventRiskControlMeasureRepository.listControlMeasure(); + } + + /** + * 管控措施- 管控措施UUid + */ + @Override + public PreventRiskControlMeasure getControlMeasureByUuid(String measureUuid) { + return preventRiskControlMeasureRepository.getControlMeasureByUuid(measureUuid); + } + /** + * 管控措施- 上报状态更新 + */ + @Override + public void updateMeasureReportStatus(HandlerReportParam handlerReportParam) { + int result = preventRiskControlMeasureRepository.updateMeasureReportStatus(handlerReportParam); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + /** + * 管控措施- 管控措施列表 - 分页 + */ + @Override + public IPage<PreventRiskControlMeasureListDO> listControlMeasurePage(Page<Object> objectPage, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO) { + return preventRiskControlMeasureRepository.listControlMeasurePage(objectPage, listQueryReqDTO); + } + + /** + * 管控措施+内容 批量查询 + */ + @Override + public List<PreventRiskControlMeasure> getControlMeasureAndContent(List<Long> idLists) { + return preventRiskControlMeasureRepository.getControlMeasureAndContent(idLists); + } + /** + * 管控措施+内容 查询全部 + */ + @Override + public List<PreventRiskControlMeasure> listAllControlMeasure() { + return preventRiskControlMeasureRepository.listAllControlMeasure(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlTemplateServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlTemplateServiceImpl.java new file mode 100644 index 0000000..49df6c7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskControlTemplateServiceImpl.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlTemplate; +import com.gk.hotwork.doublePrevention.repository.PreventRiskControlTemplateRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventRiskControlTemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventRiskControlTemplateService") +public class PreventRiskControlTemplateServiceImpl + extends ServiceImpl<PreventRiskControlTemplateRepository, PreventRiskControlTemplate> implements PreventRiskControlTemplateService { + + @Autowired + private PreventRiskControlTemplateRepository preventRiskControlTemplateRepository; + + /** + * 获取控制措施模板 + * */ + @Override + public List<PreventRiskControlTemplate> listMeasureTemplates() { + + return preventRiskControlTemplateRepository.listMeasureTemplates(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java new file mode 100644 index 0000000..2e8e84d --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java @@ -0,0 +1,119 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventRiskEvent; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO; +import com.gk.hotwork.doublePrevention.repository.PreventRiskEventRepository; +import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; +import com.gk.hotwork.doublePrevention.repository.param.PreventDeleteParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventQueryParams; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskEventUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventRiskEventService; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventRiskEventService") +public class PreventRiskEventServiceImpl extends ServiceImpl<PreventRiskEventRepository, PreventRiskEvent> implements PreventRiskEventService { + + @Autowired + private PreventRiskEventRepository preventRiskEventRepository; + + /** + * 风险事件-分页查询 + */ + @Override + public IPage<PreventRiskEvent> getRiskEventPage(Page<Object> page, @Param("queryParams")PreventRiskEventQueryParams queryParams) { + return preventRiskEventRepository.getRiskEventPage(page, queryParams); + } + + /** + * 风险事件-根据事件名字查询 + */ + @Override + public PreventRiskEvent getRiskEventByName(String riskEventName) { + return preventRiskEventRepository.getRiskEventByName(riskEventName); + } + + /** + * 风险事件-新增 + */ + @Override + public int saveRiskEvent(PreventRiskEvent riskEvent) { + return preventRiskEventRepository.insert(riskEvent); + } + + /** + * 风险事件-修改 + */ + @Override + public int updateRiskEvent(PreventRiskEventUpdateParams updateParams) { + return preventRiskEventRepository.updateRiskEvent(updateParams); + } + + /** + * 风险事件-删除 + */ + @Override + public int deleteRiskEventById(PreventDeleteParams deleteParams) { + return preventRiskEventRepository.deleteRiskEventById(deleteParams); + } + + /** + * 风险事件-根据id获取名名称 + */ + @Override + public PreventRiskEvent getRiskEventNameById(Long id) { + return preventRiskEventRepository.getRiskEventNameById(id); + } + + /** + * 风险事件-根据RiskUnitId获取 + */ + @Override + public List<PreventRiskEvent> getRiskEventNameByRiskUnitId(Long riskUnitId) { + return preventRiskEventRepository.getRiskEventNameByRiskUnitId(riskUnitId); + } + + /** + * 风险事件-事件list + */ + @Override + public List<PreventRiskEvent> getListEvents() { + return preventRiskEventRepository.getListEvents(); + } + + /** + * 安全风险事件-手工上报-配置 + */ + @Override + public int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + return preventRiskEventRepository.updateRiskEventReport(preventHandReportConfigReqDTO); + } + + + + /** + * 安全风险事件-上报数据 + */ + @Override + public List<PreventRiskEvent> listReportEvent() { + return preventRiskEventRepository.listReportEvent(); + } + /** + * 安全风险事件-更新上报状态 + */ + @Override + public void updateEventReportStatus(HandlerReportParam handlerReportParam) { + int result = preventRiskEventRepository.updateEventReportStatus(handlerReportParam); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "安全风险事件-更新上报状态失败"); + } + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskMapServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskMapServiceImpl.java new file mode 100644 index 0000000..4cddab3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventRiskMapServiceImpl.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventRiskMap; +import com.gk.hotwork.doublePrevention.repository.PreventRiskMapRepository; +import com.gk.hotwork.doublePrevention.repository.param.PreventRiskMapUpdateParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventRiskMapService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service("PreventRiskMapService") +public class PreventRiskMapServiceImpl extends ServiceImpl<PreventRiskMapRepository, PreventRiskMap> implements PreventRiskMapService{ + + @Autowired + private PreventRiskMapRepository preventRiskMapRepository; + /** + * 风险分布图-分页查询详细信息 + */ + @Override + public IPage<PreventRiskMap> getMapPage(Page<Object> mapPage) { + + return preventRiskMapRepository.getMapPage(mapPage); + } + + /** + * 风险分布图-新增 + */ + @Override + public int saveRiskMap(PreventRiskMap riskMap) { + int result = preventRiskMapRepository.insert(riskMap); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + return result; + } + + /** + * 风险分布图-删除 + */ + @Override + public int deleteRiskMap(Long id) { + int result = preventRiskMapRepository.deleteRiskMap(id); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_DEL_ERROR); + } + return result; + } + + /** + * 风险分布图-修改 + */ + @Override + public int updateRiskMap(PreventRiskMapUpdateParams params) { + int result = preventRiskMapRepository.updateRiskMap(params); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + return result; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskAndMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskAndMeasureServiceImpl.java new file mode 100644 index 0000000..e6d49de --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskAndMeasureServiceImpl.java @@ -0,0 +1,75 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.doublePrevention.repository.PreventTaskAndMeasureRepository; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventTaskAndMeasure; +import com.gk.hotwork.doublePrevention.repository.param.PreventCheckResultParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventTaskAndMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventTaskMeasureService") +public class PreventTaskAndMeasureServiceImpl + extends ServiceImpl<PreventTaskAndMeasureRepository, PreventTaskAndMeasure> implements PreventTaskAndMeasureService { + + @Autowired + private PreventTaskAndMeasureRepository preventTaskAndMeasureRepository; + + + /** + * 保存任务与措施的关联 + * */ + @Override + public int saveTaskAndMeasure(PreventTaskAndMeasure taskAndMeasure) { + int result = preventTaskAndMeasureRepository.insert(taskAndMeasure); + return result; + } + + /** + * 以任务id为条件,重置管控措施与任务的关联 + * */ + @Override + public void deleteTaskAndMeasureByTaskId(Long taskId) { + preventTaskAndMeasureRepository.deleteTaskAndMeasureByTaskId(taskId); + } + + /** + * 以任务id为条件,查询 + * */ + @Override + public List<PreventTaskAndMeasure> getListByTaskId(Long taskId) { + return preventTaskAndMeasureRepository.getListByTaskId(taskId); + } + + /** + * 结果填报 + * */ + @Override + public int updateCheckResult(PreventCheckResultParams checkResultParams) { + int result = preventTaskAndMeasureRepository.updateCheckResult(checkResultParams); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "排查结果填报失败"); + } + return result; + } + + /** + * 根绝任务id查找 + * */ + @Override + public PreventTaskAndMeasure getTaskAndMeasureByTaskId(Long taskId) { + return preventTaskAndMeasureRepository.getTaskAndMeasureByTaskId(taskId); + } + + /** + * 根绝任务id批量查找 + * */ + @Override + public List<PreventTaskAndMeasure> getListByTaskIdByIdList(List<Long> taskIdLists) { + return preventTaskAndMeasureRepository.getListByTaskIdByIdList(taskIdLists); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskUnitAndMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskUnitAndMeasureServiceImpl.java new file mode 100644 index 0000000..9fe6617 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventTaskUnitAndMeasureServiceImpl.java @@ -0,0 +1,56 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.doublePrevention.entity.PreventRiskControlMeasure; +import com.gk.hotwork.doublePrevention.entity.PreventTaskUnitAndMeasure; +import com.gk.hotwork.doublePrevention.repository.PreventTaskUnitAndMeasureRepository; +import com.gk.hotwork.doublePrevention.repository.param.PreventTaskUnitAndMeasureParams; +import com.gk.hotwork.doublePrevention.service.baseService.PreventTaskUnitAndMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventTaskUnitAndMeasureService") +public class PreventTaskUnitAndMeasureServiceImpl extends ServiceImpl<PreventTaskUnitAndMeasureRepository, PreventTaskUnitAndMeasure> implements PreventTaskUnitAndMeasureService { + + @Autowired + private PreventTaskUnitAndMeasureRepository preventTaskUnitAndMeasureRepository; + + /** + * 保存任务单元与管控措施的关系 + * */ + @Override + public void insert(PreventTaskUnitAndMeasure taskUnitAndMeasure) { + int result = preventTaskUnitAndMeasureRepository.insert(taskUnitAndMeasure); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存任务单元与管控措施的关系失败"); + } + } + /** + * 获取任务单元对应的管控措施 + * */ + @Override + public List<PreventTaskUnitAndMeasure> getListByUnitId(Long taskUnitId) { + return preventTaskUnitAndMeasureRepository.getListByUnitId(taskUnitId); + } + /** + * 重置任务单元与管控措施的关系 + * */ + @Override + public void deleteTaskUnitAndMeasure(PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams) { + int result = preventTaskUnitAndMeasureRepository.deleteTaskUnitAndMeasure(taskUnitAndMeasureParams); + if (result < 1){ + throw new BusinessException(E.ADD_FAIL, "保存任务单元与管控措施的关系失败"); + } + } + /** + * 获取任务单元对应的管控措施-by measureId + * */ + @Override + public List<PreventTaskUnitAndMeasure> getListByMeasureId(Long measureId) { + return preventTaskUnitAndMeasureRepository.getListByMeasureId(measureId); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventWorkAndMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventWorkAndMeasureServiceImpl.java new file mode 100644 index 0000000..8c9dbe6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/baseService/impl/PreventWorkAndMeasureServiceImpl.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.doublePrevention.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.PreventWorkAndMeasure; +import com.gk.hotwork.doublePrevention.repository.PreventWorkAndMeasureRepository; +import com.gk.hotwork.doublePrevention.service.baseService.PreventWorkAndMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("PreventWorkAndMeasureService") +public class PreventWorkAndMeasureServiceImpl extends ServiceImpl<PreventWorkAndMeasureRepository, PreventWorkAndMeasure> implements PreventWorkAndMeasureService { + + @Autowired + private PreventWorkAndMeasureRepository preventWorkAndMeasureRepository; + + /** + * 插入作业与措施的关联 + * */ + @Override + public int insertWorkAndMeasure(PreventWorkAndMeasure workAndMeasure) { + return preventWorkAndMeasureRepository.insert(workAndMeasure); + } + + /** + * 重置作业与措施的关联 + * */ + @Override + public void updateWorkAndMeasure(String workUuid) { + int i = preventWorkAndMeasureRepository.updateWorkAndMeasure(workUuid); + if (i<1){ + throw new BusinessException(E.NOT_DELETE, "重置作业与措施的关联"); + } + } + + /** + * 查询作业与措施关联表 + * */ + @Override + public PreventWorkAndMeasure getWorkAndMeasure(String workUuid, String measureUuid) { + return preventWorkAndMeasureRepository.getWorkAndMeasure(workUuid, measureUuid); + } + /** + * 查询作业与措施关联表 + * */ + @Override + public List<PreventWorkAndMeasure> getWorkAndMeasureByWorkUuid(String workUuid) { + return preventWorkAndMeasureRepository.getWorkAndMeasureByWorkUuid(workUuid); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/DangerServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/DangerServiceImpl.java new file mode 100644 index 0000000..c33d5ab --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/DangerServiceImpl.java @@ -0,0 +1,2105 @@ +package com.gk.hotwork.doublePrevention.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.Service.UserService; +import com.gk.hotwork.doublePrevention.utils.BeanCopyUtils; +import com.gk.hotwork.doublePrevention.utils.SnowFlow; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.CheckResultReportDO; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.resp.*; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.enums.WorkStatusEnum; +import com.gk.hotwork.doublePrevention.mq.msg.PreventNoticeExecTaskMsg; +import com.gk.hotwork.doublePrevention.mq.msg.PreventTimeOutTaskMsg; +import com.gk.hotwork.doublePrevention.mq.msg.PreventWaitExecTaskMsg; +import com.gk.hotwork.doublePrevention.repository.param.*; +import com.gk.hotwork.doublePrevention.service.DangerService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import org.apache.commons.lang3.ObjectUtils; + +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.parameters.P; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.xml.crypto.Data; +import java.util.*; +import java.util.concurrent.TimeUnit; + +@Service +public class DangerServiceImpl implements DangerService { + + + @Autowired + private AccountAuthService accountAuthService; + @Autowired + private UserService userService; + + + @Autowired + private AccountDepartmentService accountDepartmentService; + @Autowired + private RedissonClient redissonClient; + @Autowired + private PreventDangerCheckTaskUnitService preventDangerCheckTaskUnitService; + @Autowired + private PreventRiskControlMeasureService preventRiskControlMeasureService; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventDangerCheckContentService preventDangerCheckContentService; + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private DepartmentService departmentService; + @Autowired + private PreventTaskUnitAndMeasureService preventTaskUnitAndMeasureService; + + @Autowired + private PreventTaskAndMeasureService preventTaskAndMeasureService; + @Autowired + private PreventWorkAndMeasureService preventWorkAndMeasureService; + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.preventCreateTaskTopic}") + private String preventCreateTaskTopic; + @Value("${rocketmq.topic.preventNoticeTaskTopic}") + private String preventNoticeTaskTopic; + @Value("${rocketmq.topic.preventTimeOutTaskTopic}") + private String preventTimeOutTaskTopic; + @Value("${rocketmq.topic.preventWaitWorkTopic}") + private String preventWaitWorkTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + /** + * 隐患排查任务单元-分页查询 + */ + @Override + public ResultVO<PreventDangerCheckTaskUnit> getTaskUnitPage(Long userId, PreventDangerCheckTaskUnitQueryReqDTO taskUnitQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<String> measureList = new ArrayList<>(); + List<PreventDangerCheckTaskUnitQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = taskUnitQueryReqDTO.getPageIndex(); + Integer pageSize = taskUnitQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //获取分页数据 + IPage<PreventDangerCheckTaskUnit> page = + preventDangerCheckTaskUnitService.getTaskUnitPage(new Page<>(pageIndex, pageSize), taskUnitQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //遍历结果集,封装数据 + for (PreventDangerCheckTaskUnit record : page.getRecords()) { + //拷贝任务单元数据 + PreventDangerCheckTaskUnitQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerCheckTaskUnitQueryRespDTO.class); + //获取当前任务单元关联的所有管控措施 + List<PreventTaskUnitAndMeasure> measureLists = preventTaskUnitAndMeasureService.getListByUnitId(record.getId()); + //封装管控措施编码 + if (measureLists.size() > 0){ + List<PreventRiskControlMeasureDataRespDTO> measureContentList = new ArrayList<>(); + for (PreventTaskUnitAndMeasure controlMeasure : measureLists) { + PreventDangerCheckContent checkContent = preventDangerCheckContentService.getCheckContentByMeasureId(controlMeasure.getMeasureId()); + PreventRiskControlMeasureDataRespDTO measure = BeanCopyUtils.copyBean(controlMeasure, PreventRiskControlMeasureDataRespDTO.class); + measure.setCheckContent(checkContent.getCheckContent()); + measure.setId(controlMeasure.getMeasureId()); + measureContentList.add(measure); + } + respDTO.setMeasureList(measureContentList); + } + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + /** + * 隐患排查任务单元-新增 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckTaskUnit> saveTaskUnit(Long userId, PreventDangerCheckTaskUnitSaveReqDTO taskUnitSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + PreventDangerCheckTaskUnit taskUnit = new PreventDangerCheckTaskUnit(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (taskUnitSaveReqDTO.getTaskUnitName() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患排查任务单元名称不能为空"); + } + //检查是否存在同名任务单元 + PreventDangerCheckTaskUnit taskUnitByName = preventDangerCheckTaskUnitService.getTaskUnitByName(taskUnitSaveReqDTO.getTaskUnitName()); + if (ObjectUtils.isNotEmpty(taskUnitByName)){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "隐患排查任务单元名称已存在,请修改任务单元名称,或者添加编号"); + } + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long taskUnitId = snowFlow.nextId(); + + //封装新增参数 + taskUnit.setId(taskUnitId); + taskUnit.setUuid(uuid); + taskUnit.setTaskUnitName(taskUnitSaveReqDTO.getTaskUnitName()); + taskUnit.setEnterpriseId((long) 1); + taskUnit.setEnterpriseUuid("111"); + taskUnit.setGmtCreate(date); + taskUnit.setGmtModitify(date); + taskUnit.setCreateByUserName(userById.getRealName()); + taskUnit.setLastEditUserName(userById.getRealName()); + taskUnit.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + if (ObjectUtils.isEmpty(taskUnitSaveReqDTO.getNote())){ + taskUnit.setNote(null); + } + taskUnit.setNote(taskUnitSaveReqDTO.getNote()); + + //执行新增单元操作 + int result = preventDangerCheckTaskUnitService.saveTaskUnit(taskUnit); + + //保存管控措施与任务单元的关联 + if (taskUnitSaveReqDTO.getMeasureList().size() > 0){ + for (Long measureId : taskUnitSaveReqDTO.getMeasureList()) { + //获取任务单元与措施关联对象 + PreventTaskUnitAndMeasure taskUnitAndMeasure = new PreventTaskUnitAndMeasure(); + //查询管控措施 + PreventRiskControlMeasure controlMeasureById = preventRiskControlMeasureService.getControlMeasureById(measureId); + //封装参数 + taskUnitAndMeasure.setTaskUnitId(taskUnitId); + taskUnitAndMeasure.setTaskUnitUuid(uuid); + taskUnitAndMeasure.setMeasureId(measureId); + taskUnitAndMeasure.setMeasureUuid(controlMeasureById.getUuid()); + taskUnitAndMeasure.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + taskUnitAndMeasure.setGmtCreate(date); + taskUnitAndMeasure.setCreateByUserName(userById.getRealName()); + taskUnitAndMeasure.setGmtModitify(date); + taskUnitAndMeasure.setLastEditUserName(userById.getRealName()); + preventTaskUnitAndMeasureService.insert(taskUnitAndMeasure); + } + } + + resultVO.setCount(result); + + return resultVO; + } + + /** + * 隐患排查任务单元-修改 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckTaskUnit> updateTaskUnit(Long userId, PreventDangerCheckTaskUnitUpdateReqDTO taskUnitUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + PreventDangerCheckTaskUnitUpdateParams updateParams = new PreventDangerCheckTaskUnitUpdateParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (taskUnitUpdateReqDTO.getTaskUnitName() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患排查任务单元名称不能为空"); + } + //检查是否存在同名任务单元 + PreventDangerCheckTaskUnit taskUnitByName = + preventDangerCheckTaskUnitService.getTaskUnitByName(taskUnitUpdateReqDTO.getTaskUnitName()); + //如果查询结果不为空,且入参Id与查询到的Id不相等,判断是存在同名任务单元 + if (ObjectUtils.isNotEmpty(taskUnitByName) && !taskUnitByName.getId().equals(taskUnitUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "隐患排查任务单元名称已存在,请修改任务单元名称,或者添加编号"); + } + //获取需要填充的信息 + Date date = new Date(); + //封装参数 + updateParams.setId(taskUnitUpdateReqDTO.getId()); + updateParams.setTaskUnitName(taskUnitUpdateReqDTO.getTaskUnitName()); + updateParams.setGmtModitify(date); + updateParams.setLastEditUserName(userById.getRealName()); + //填充非必填的参数 + updateParams.setNote(taskUnitUpdateReqDTO.getNote()); + //执行修改 + int result = preventDangerCheckTaskUnitService.updateTaskUnit(updateParams); + + //重置关联关系 + PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams = new PreventTaskUnitAndMeasureParams(); + taskUnitAndMeasureParams.setTaskUnitId(taskUnitUpdateReqDTO.getId()); + taskUnitAndMeasureParams.setGmtModitify(date); + taskUnitAndMeasureParams.setLastEditUserName(userById.getRealName()); + taskUnitAndMeasureParams.setDeleteStatus(StatusEnum.DELETE_STATUS_DISCARD.getCode()); + preventTaskUnitAndMeasureService.deleteTaskUnitAndMeasure(taskUnitAndMeasureParams); + + //便历措施Code集合,添加关联信息 + if (taskUnitUpdateReqDTO.getMeasureList().size() > 0){ + for (Long measureId : taskUnitUpdateReqDTO.getMeasureList()) { + //获取任务单元与措施关联对象 + PreventTaskUnitAndMeasure taskUnitAndMeasure = new PreventTaskUnitAndMeasure(); + //查询管控措施 + PreventRiskControlMeasure controlMeasureById = preventRiskControlMeasureService.getControlMeasureById(measureId); + PreventDangerCheckTaskUnit taskUnitById = preventDangerCheckTaskUnitService.getTaskUnitById(taskUnitUpdateReqDTO.getId()); + //封装参数 + + taskUnitAndMeasure.setTaskUnitId(taskUnitUpdateReqDTO.getId()); + taskUnitAndMeasure.setTaskUnitUuid(taskUnitById.getUuid()); + taskUnitAndMeasure.setMeasureId(measureId); + taskUnitAndMeasure.setMeasureUuid(controlMeasureById.getUuid()); + taskUnitAndMeasure.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + taskUnitAndMeasure.setGmtCreate(date); + taskUnitAndMeasure.setCreateByUserName(userById.getRealName()); + taskUnitAndMeasure.setGmtModitify(date); + taskUnitAndMeasure.setLastEditUserName(userById.getRealName()); + preventTaskUnitAndMeasureService.insert(taskUnitAndMeasure); + } + } + + resultVO.setCount(result); + + return resultVO; + } + + /** + * 隐患排查任务单元-任务单元列表 + */ + @Override + public ResultVO<PreventDangerCheckTaskUnit> listTaskUnit(Long valueOf) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + List<PreventDangerCheckTaskUnitListQueryRespDTO> list = new ArrayList<>(); + + List<PreventDangerCheckTaskUnit> listTaskUnit = preventDangerCheckTaskUnitService.listTaskUnit(); + for (PreventDangerCheckTaskUnit taskUnit : listTaskUnit) { + PreventDangerCheckWork workByTaskUnitId = preventDangerCheckWorkService.getWorkByTaskUnitId(taskUnit.getId()); + if (ObjectUtils.isEmpty(workByTaskUnitId)){ + PreventDangerCheckTaskUnitListQueryRespDTO respDTO = BeanCopyUtils.copyBean(taskUnit, PreventDangerCheckTaskUnitListQueryRespDTO.class); + list.add(respDTO); + } + } + + resultVO.setData(list); + return resultVO; + } + + /** + * 隐患排查任务单元-删除 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckTaskUnit> deleteTaskUnit(Long userId, PreventDangerCheckTaskUnitDeleteReqDTO taskUnitDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventDangerCheckTaskUnitDeleteParams deleteParams = new PreventDangerCheckTaskUnitDeleteParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (taskUnitDeleteReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的删除内容"); + } + //获取需要填充的信息 + Date date = new Date(); + //封装删除需要的参数 + deleteParams.setId(taskUnitDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + + //检查该单元是否有措施 + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(taskUnitDeleteReqDTO.getId()); + //重置关联关系 + if (listByUnitId != null && listByUnitId.size() > 0){ + PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams = new PreventTaskUnitAndMeasureParams(); + taskUnitAndMeasureParams.setTaskUnitId(taskUnitDeleteReqDTO.getId()); + taskUnitAndMeasureParams.setGmtModitify(date); + taskUnitAndMeasureParams.setLastEditUserName(userById.getRealName()); + taskUnitAndMeasureParams.setDeleteStatus(StatusEnum.DELETE_STATUS_DISCARD.getCode()); + preventTaskUnitAndMeasureService.deleteTaskUnitAndMeasure(taskUnitAndMeasureParams); + } + //删除单元 + int result = preventDangerCheckTaskUnitService.deleteTaskUnit(deleteParams); + + resultVO.setCount(result); + + return resultVO; + } + + //隐患排查作业 + /** + * 隐患排查作业-分页查询 + */ + @Override + public ResultVO<PreventDangerCheckWork> getCheckWorkPage(Long userId, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerCheckWorkQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = workQueryReqDTO.getPageIndex(); + Integer pageSize = workQueryReqDTO.getPageSize(); + + //获取用户信息 + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //如果传空字符串,转换为null + if (workQueryReqDTO.getCheckWorkName() == ""){ + workQueryReqDTO.setCheckWorkName(null); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + //获取到所有符合条件的作业 + IPage<PreventDangerCheckWork> page = + preventDangerCheckWorkService.getCheckWorkPage(new Page<>(pageIndex, pageSize), workQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //封装数据 + //List<PreventDangerCheckWorkQueryRespDTO> respList = BeanCopyUtils.copyBeanList(page.getRecords(), PreventDangerCheckWorkQueryRespDTO.class); + + for (PreventDangerCheckWork record : page.getRecords()) { + PreventDangerCheckWorkQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerCheckWorkQueryRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + if (record.getTaskUnitId() != null){ + PreventDangerCheckTaskUnit taskUnit = preventDangerCheckTaskUnitService.getTaskUnitById(record.getTaskUnitId()); + if (ObjectUtils.isNotEmpty(taskUnit)){ + respDTO.setTaskUnitName(taskUnit.getTaskUnitName()); + } + } + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setDepId(userById.getDepartment().getDepId()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + /** + * 隐患排查作业-查看检查内容 + */ + @Override + public ResultVO<PreventDangerCheckWork> getCheckWorkContent(Long userId, PreventDangerCheckWorkContentQueryReqDTO contentReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + List<String> checkContentList = new ArrayList<>(); + + if (contentReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL,""); + } + + //根据id,查询任务单元 + PreventDangerCheckTaskUnit taskUnitByWorkId = preventDangerCheckTaskUnitService.getTaskUnitByWorkId(contentReqDTO.getId()); + //如果结果不为空,查寻对应措施,得到检查内容并封装。 + if (ObjectUtils.isNotEmpty(taskUnitByWorkId)){ + //获取任务单元内的管控措施 + List<PreventRiskControlMeasure> measureListByUnit = preventRiskControlMeasureService.getlistByUnitId(taskUnitByWorkId.getId()); + //获取管控措施对应的内容 + for (PreventRiskControlMeasure controlMeasure : measureListByUnit) { + PreventDangerCheckContent checkContents = preventDangerCheckContentService.getCheckContentByMeasureId(controlMeasure.getId()); + checkContentList.add(checkContents.getCheckContent()); + } + } + resultVO.setCount(checkContentList.size()); + resultVO.setData(checkContentList); + return resultVO; + } + + /** + * 隐患排查作业-新增 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckWork> saveCheckWork(Long userId, PreventDangerCheckWorkSaveReqDTO workSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + PreventDangerCheckWork checkWork = new PreventDangerCheckWork(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + + //校验参数,并设置作业类型 + if (workSaveReqDTO.getCheckWorkType() == 1){ + checkWork.setCheckWorkType(workSaveReqDTO.getCheckWorkType()); + }else if(workSaveReqDTO.getCheckWorkType() == 2) { + checkWork.setCheckWorkType(workSaveReqDTO.getCheckWorkType()); + }else { + throw new BusinessException(E.DATA_PARAM_NULL, "作业类型选择错误"); + } + //校验参数,并设置时间单位 + if (workSaveReqDTO.getCheckCycleUnit() == 1){ + checkWork.setCheckCycleUnit(workSaveReqDTO.getCheckCycleUnit()); + }else if (workSaveReqDTO.getCheckCycleUnit() == 2) { + checkWork.setCheckCycleUnit(workSaveReqDTO.getCheckCycleUnit()); + }else if (workSaveReqDTO.getCheckCycleUnit() == 3) { + checkWork.setCheckCycleUnit(workSaveReqDTO.getCheckCycleUnit()); + }else if (workSaveReqDTO.getCheckCycleUnit() == 4) { + checkWork.setCheckCycleUnit(workSaveReqDTO.getCheckCycleUnit()); + }else if (workSaveReqDTO.getCheckCycleUnit() == 5) { + checkWork.setCheckCycleUnit(workSaveReqDTO.getCheckCycleUnit()); + }else { + throw new BusinessException(E.DATA_PARAM_NULL, "时间单位选择错误"); + } + //校验普通参数 + if (workSaveReqDTO.getCheckWorkName() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业名称不能为空"); + } + //根据workName获取作业信息 + PreventDangerCheckWork workByName = preventDangerCheckWorkService.getWorkByName(workSaveReqDTO.getCheckWorkName()); + if (ObjectUtils.isNotEmpty(workByName)){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "作业名称已存在"); + } + if (workSaveReqDTO.getCheckCycle() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "排查周期-数值不能为空"); + } + if (workSaveReqDTO.getNoticeTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "提前通知时间-数值不能为空"); + } + if (workSaveReqDTO.getValidTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业有效期不能为空"); + } + if (workSaveReqDTO.getFirstStartTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "首次排查任务开始时间不能为空"); + } + if (workSaveReqDTO.getExecDepId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "任务所属部门不能为空"); + } + //校验部门是否存在 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(workSaveReqDTO.getExecDepId()); + if (ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该部门不存在或已被删除,请选择正确的部门"); + } + if (workSaveReqDTO.getTaskUnitId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "任务单元不能为空"); + } + PreventDangerCheckTaskUnit taskUnit = preventDangerCheckTaskUnitService.getTaskUnitById(workSaveReqDTO.getTaskUnitId()); + if (ObjectUtils.isEmpty(taskUnit)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该任务单元不存在或已被删除,请选择正确的任务单元"); + } + //A方案 一个作业只能调度一个任务单元 + PreventDangerCheckWork workByTaskUnitId = + preventDangerCheckWorkService.getWorkByTaskUnitId(workSaveReqDTO.getTaskUnitId()); + if (ObjectUtils.isNotEmpty(workByTaskUnitId)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该任务单元已经被【" +workByTaskUnitId.getCheckWorkName() +"】作业调度"); + } + if (workSaveReqDTO.getFirstStartTime().getTime() < new Date().getTime()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "首次调度时间应该大于当前时间"); + } + + //获取巡检作业需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long checkWorkId = snowFlow.nextId(); + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + //封装参数 + PreventDangerCheckWork checkWorkParams = BeanCopyUtils.copyBean(workSaveReqDTO, PreventDangerCheckWork.class); + checkWorkParams.setId(checkWorkId); + checkWorkParams.setUuid(uuid); + checkWorkParams.setCheckWorkStatus(WorkStatusEnum.WORK_OPEN.getCode()); + checkWorkParams.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + checkWorkParams.setNextCheckTime(workSaveReqDTO.getFirstStartTime()); + checkWorkParams.setEnterpriseId((long) 1); + checkWorkParams.setEnterpriseUuid("111"); + checkWorkParams.setExecDepUuid(null); + checkWorkParams.setExecDep(departmentInfo.getDepartment()); + checkWorkParams.setGmtCreate(date); + checkWorkParams.setGmtModitify(date); + checkWorkParams.setCreateByUserName(userById.getRealName()); + checkWorkParams.setLastEditUserName(userById.getRealName()); + checkWorkParams.setTaskUnitUuid(taskUnit.getUuid()); + checkWorkParams.setLastCheckTime(null); + checkWorkParams.setCreateByUserId(userId); + + checkWorkParams.setReportTime(null); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + checkWorkParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + checkWorkParams.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + checkWorkParams.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + checkWorkParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkWorkParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkWorkParams.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + checkWorkParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkWorkParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkWorkParams.setUpdateReportDataTime(date); + } + + //插入作业 + int result = preventDangerCheckWorkService.saveCheckWork(checkWorkParams); + if (result < 0){ + throw new BusinessException(E.ADD_FAIL, "作业插入失败"); + } + + //作业与措施的关联表,暂时未使用,只为了上报数据使用 + //获取措施list todo 此处有问题 +// List<PreventRiskControlMeasure> measureLists = preventRiskControlMeasureService.getlistByUnitId(workSaveReqDTO.getTaskUnitId()); + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(workSaveReqDTO.getTaskUnitId()); + + PreventWorkAndMeasure workAndMeasure = new PreventWorkAndMeasure(); + for (PreventTaskUnitAndMeasure unitAndMeasure : listByUnitId) { + String workAndMeasureUuid = UUID.randomUUID().toString(); + workAndMeasure.setId(workAndMeasureUuid); + workAndMeasure.setWorkUuid(uuid); + workAndMeasure.setWorkId(checkWorkId); + workAndMeasure.setMeasureId(unitAndMeasure.getMeasureId()); + workAndMeasure.setMeasureUuid(unitAndMeasure.getMeasureUuid()); + int resultWorkAndMeasure = preventWorkAndMeasureService.insertWorkAndMeasure(workAndMeasure); + if (resultWorkAndMeasure < 1){ + throw new BusinessException(E.ADD_FAIL, "保存作业与措施的关系失败"); + } + } + + resultVO.setCount(result); + + return resultVO; + } + + /** + * 隐患排查作业-修改 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckWork> updateCheckWork(Long userId, PreventDangerCheckWorkUpdateReqDTO workUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + PreventDangerCheckWork checkWork = new PreventDangerCheckWork(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数,并设置作业类型 + if (workUpdateReqDTO.getCheckWorkType() == 1){ + checkWork.setCheckWorkType(workUpdateReqDTO.getCheckWorkType()); + }else if(workUpdateReqDTO.getCheckWorkType() == 2) { + checkWork.setCheckWorkType(workUpdateReqDTO.getCheckWorkType()); + }else { + throw new BusinessException(E.DATA_PARAM_NULL, "作业类型选择错误"); + } + //校验参数,并设置时间单位 + if (workUpdateReqDTO.getCheckCycleUnit() == 1){ + checkWork.setCheckCycleUnit(workUpdateReqDTO.getCheckCycleUnit()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 2) { + checkWork.setCheckCycleUnit(workUpdateReqDTO.getCheckCycleUnit()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 3) { + checkWork.setCheckCycleUnit(workUpdateReqDTO.getCheckCycleUnit()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 4) { + checkWork.setCheckCycleUnit(workUpdateReqDTO.getCheckCycleUnit()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 5) { + checkWork.setCheckCycleUnit(workUpdateReqDTO.getCheckCycleUnit()); + }else { + throw new BusinessException(E.DATA_PARAM_NULL, "时间单位选择错误"); + } + //校验参数,并设置作业状态 + if (workUpdateReqDTO.getCheckWorkType() == 1 ){ + checkWork.setCheckWorkStatus(workUpdateReqDTO.getCheckWorkStatus()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 2) { + checkWork.setCheckWorkStatus(workUpdateReqDTO.getCheckWorkStatus()); + }else if (workUpdateReqDTO.getCheckCycleUnit() == 3) { + checkWork.setCheckWorkStatus(workUpdateReqDTO.getCheckWorkStatus()); + } + //校验普通参数 + if (workUpdateReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL,""); + } + if (workUpdateReqDTO.getCheckWorkName() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业名称不能为空"); + } + //根据workName获取作业信息 + PreventDangerCheckWork workByName = preventDangerCheckWorkService.getWorkByName(workUpdateReqDTO.getCheckWorkName()); + if (ObjectUtils.isNotEmpty(workByName) && !workByName.getId().equals(workUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "作业名称已存在"); + } +// if (workUpdateReqDTO.getCheckWorkStatus() == null){ +// throw new BusinessException(E.DATA_DATABASE_EXIST, "作业状态不能为空"); +// } + if (workUpdateReqDTO.getCheckCycle() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "排查周期-数值不能为空"); + } + if (workUpdateReqDTO.getNoticeTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "提前通知时间-数值不能为空"); + } + if (workUpdateReqDTO.getValidTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业有效期不能为空"); + } + + if (workUpdateReqDTO.getExecDepId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "执行部门不能为空"); + } + //校验部门是否存在 +// ResultVO<DepInfoRPCRespDTO> depInfo = accountDepartmentService.getDepInfoByDepId(userId, workUpdateReqDTO.getExecDepId()); +// DepInfoRPCRespDTO execDep = (DepInfoRPCRespDTO)depInfo.getData(); + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(workUpdateReqDTO.getExecDepId()); + if (ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该部门不存在或已被删除,请选择正确的部门"); + } + if (workUpdateReqDTO.getTaskUnitId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "任务单元不能为空"); + } + PreventDangerCheckTaskUnit taskUnit = preventDangerCheckTaskUnitService.getTaskUnitById(workUpdateReqDTO.getTaskUnitId()); + if (ObjectUtils.isEmpty(taskUnit)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该任务单元不存在或已被删除,请选择正确的任务单元"); + } + //A方案 一个作业只能调度一个任务单元,或者若干个管控措施 + PreventDangerCheckWork workByTaskUnitId = + preventDangerCheckWorkService.getWorkByTaskUnitId(workUpdateReqDTO.getTaskUnitId()); + if (ObjectUtils.isNotEmpty(workByTaskUnitId) && !workByTaskUnitId.getId().equals(workUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_PARAM_NULL, "该任务单元已经被" +workByTaskUnitId.getCheckWorkName() +"作业调度"); + } + if (workUpdateReqDTO.getFirstStartTime().getTime() < new Date().getTime()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "首次调度时间应该大于当前时间"); + } + + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + Date date = new Date(); + //封装参数 + PreventDangerCheckWorkUpdateParams updateParams = BeanCopyUtils.copyBean(workUpdateReqDTO, PreventDangerCheckWorkUpdateParams.class); + + updateParams.setGmtModitify(date); + updateParams.setLastEditUserName(userById.getRealName()); + updateParams.setExecDep(departmentInfo.getDepartment()); + updateParams.setTaskUnitUuid(taskUnit.getUuid()); + updateParams.setNextCheckTime(workUpdateReqDTO.getFirstStartTime()); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + updateParams.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + + int result = preventDangerCheckWorkService.updateCheckWork(updateParams); + //获取当前作业 + PreventDangerCheckWork workById = preventDangerCheckWorkService.getWorkById(workUpdateReqDTO.getId()); + if (!workUpdateReqDTO.getTaskUnitId().equals(workById.getTaskUnitId())){ + if (ObjectUtils.isNotEmpty(preventWorkAndMeasureService.getWorkAndMeasureByWorkUuid(workById.getUuid()))){ + //重置作业与措施的关联 + preventWorkAndMeasureService.updateWorkAndMeasure(workById.getUuid()); + } + } + + //作业与措施的关联表,暂时未使用,只为了上报数据使用 + //获取措施list +// List<PreventRiskControlMeasure> measureLists = preventRiskControlMeasureService.getlistByUnitId(workUpdateReqDTO.getTaskUnitId()); +// PreventWorkAndMeasure workAndMeasure = new PreventWorkAndMeasure(); +// for (PreventRiskControlMeasure measureList : measureLists) { +// String workAndMeasureUuid = UUID.randomUUID().toString(); +// workAndMeasure.setId(workAndMeasureUuid); +// workAndMeasure.setWorkUuid(workById.getUuid()); +// workAndMeasure.setMeasureUuid(measureList.getUuid()); +// int resultWorkAndMeasure = preventWorkAndMeasureService.insertWorkAndMeasure(workAndMeasure); +// if (resultWorkAndMeasure < 0){ +// throw new BusinessException(E.ADD_FAIL, "保存作业与措施的关系失败"); +// } +// } + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(workUpdateReqDTO.getTaskUnitId()); + + PreventWorkAndMeasure workAndMeasure = new PreventWorkAndMeasure(); + for (PreventTaskUnitAndMeasure unitAndMeasure : listByUnitId) { + String workAndMeasureUuid = UUID.randomUUID().toString(); + workAndMeasure.setId(workAndMeasureUuid); + workAndMeasure.setWorkUuid(workById.getUuid()); + workAndMeasure.setWorkId(workById.getId()); + workAndMeasure.setMeasureId(unitAndMeasure.getMeasureId()); + workAndMeasure.setMeasureUuid(unitAndMeasure.getMeasureUuid()); + int resultWorkAndMeasure = preventWorkAndMeasureService.insertWorkAndMeasure(workAndMeasure); + if (resultWorkAndMeasure < 1){ + throw new BusinessException(E.ADD_FAIL, "保存作业与措施的关系失败"); + } + } + resultVO.setCount(result); + + return resultVO; + } + + /** + * 隐患排查作业-列表 + */ + @Override + public ResultVO<PreventDangerCheckWork> listCheckWork(Long valueOf) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerCheckWork> listCheckWork = preventDangerCheckWorkService.listCheckWork(); + List<PreventDangerCheckWorkListQueryRespDTO> respDTOS = + BeanCopyUtils.copyBeanList(listCheckWork, PreventDangerCheckWorkListQueryRespDTO.class); + + resultVO.setData(respDTOS); + return resultVO; + } + /** + * 排查作业-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateCheckWorkReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventDangerCheckWork workById = preventDangerCheckWorkService.getWorkById(preventHandReportConfigReqDTO.getId()); + //配置相同,做处理 + if (workById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + int result ; + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_TASK_FROM_WORK.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventDangerCheckWorkService.updateCheckWorkReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患排查作业-删除 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckWork> deleteCheckWork(Long userId, PreventDangerCheckWorkDeleteReqDTO workDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventDangerCheckWorkDeleteParams deleteParams = new PreventDangerCheckWorkDeleteParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (workDeleteReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的删除内容"); + } + //获取需要填充的信息 + Date date = new Date(); + //封装删除需要的参数 + deleteParams.setId(workDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(date); + //获取当前作业 + PreventDangerCheckWork workById = preventDangerCheckWorkService.getWorkById(workDeleteReqDTO.getId()); + + if (ObjectUtils.isNotEmpty(preventWorkAndMeasureService.getWorkAndMeasureByWorkUuid(workById.getUuid()))){ + //重置作业与措施的关联 + preventWorkAndMeasureService.updateWorkAndMeasure(workById.getUuid()); + } + //删除作业 + int result = preventDangerCheckWorkService.deleteCheckWork(deleteParams); + + + resultVO.setCount(result); + return resultVO; + } + + //隐患排查任务 + /** + * 隐患排查任务-分页查询 + */ + @Override + public ResultVO<PreventDangerCheckTask> getTaskPage(Long userId, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + Integer pageIndex = taskQueryReqDTO.getPageIndex(); + Integer pageSize = taskQueryReqDTO.getPageSize(); + List<PreventDangerCheckTaskQueryRespDTO> list = new ArrayList<>(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + + //获取到所有符合条件任务 + IPage<PreventDangerCheckTask> page = + preventDangerCheckTaskService.getTaskPage(new Page<>(pageIndex, pageSize), taskQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + + List<Long> taskIdLists = new ArrayList<>(); + //取出所有符合条件的任务的id + for (PreventDangerCheckTask record : page.getRecords()) { + taskIdLists.add(record.getId()); + } + + //取出所有符合条件的任务和措施的对应关系 + List<PreventTaskAndMeasure> taskAndMeasureList = preventTaskAndMeasureService.getListByTaskIdByIdList(taskIdLists); + //取出所有符合条件的措施id + List<Long> measureIdList = new ArrayList<>(); + for (PreventTaskAndMeasure preventTaskAndMeasure : taskAndMeasureList) { + measureIdList.add(preventTaskAndMeasure.getControlMeasureId()); + } + + //取出所有符合条件措施 + List<PreventRiskControlMeasure> controlMeasureList = preventRiskControlMeasureService.getControlMeasureAndContent(measureIdList); + //取出所有部门 + List<DepartmentInfo> departmentList = departmentService.listDepartmentInfoById(); + + //遍历任务集合,匹配封装排查任务信息。 + //1、遍历所有符合条件的任务 + for (PreventDangerCheckTask task : page.getRecords()) { + //封装task数据 + PreventDangerCheckTaskQueryRespDTO respDTO = BeanCopyUtils.copyBean(task, PreventDangerCheckTaskQueryRespDTO.class); + //获取隐患排查内容的list + List<PreventrCheckContentRespDTO> checkContentRespDTOS = new ArrayList<>(); + //2、遍历所有符合条件的对应关系 + for (PreventTaskAndMeasure taskAndMeasure : taskAndMeasureList) { + if (taskAndMeasure.getCheckTaskId().equals(task.getId())){ + //3、遍历所有符合条件的措施数据 + for (PreventRiskControlMeasure measure : controlMeasureList) { + //4、匹配到任务对应的措施信息,封装检查内容 + if (measure.getId().equals(taskAndMeasure.getControlMeasureId())){ + PreventrCheckContentRespDTO checkInfo = BeanCopyUtils.copyBean(taskAndMeasure, PreventrCheckContentRespDTO.class); + checkInfo.setControlType(measure.getControlType()); + checkInfo.setClassify1(measure.getClassify1()); + checkInfo.setClassify2(measure.getClassify2()); + checkInfo.setClassify3(measure.getClassify3()); + checkInfo.setMeasureDesc(measure.getMeasureDesc()); + checkInfo.setControlMeasureCode(measure.getControlMeasureCode()); + checkContentRespDTOS.add(checkInfo); + } + } + } + } + //4、遍历部门信息,封装任务执行部门 + for (DepartmentInfo department : departmentList) { + if (department.getId().equals(task.getExecDepId())){ + respDTO.setExecDep(department.getDepartment()); + } + } + respDTO.setCheckContent(checkContentRespDTOS); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + /** + * 隐患排查任务-分页查询-手机端使用 + */ + @Override + public ResultVO<PreventDangerCheckTask> getTaskPageForMobile(Long userId, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + Integer pageIndex = taskQueryReqDTO.getPageIndex(); + Integer pageSize = taskQueryReqDTO.getPageSize(); + List<PreventDangerCheckTaskQueryRespDTO> list = new ArrayList<>(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + + + //获取到所有符合条件任务 + IPage<PreventDangerCheckTask> page = + preventDangerCheckTaskService.getTaskPageForMobile(new Page<>(pageIndex, pageSize), taskQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + + List<PreventRiskControlMeasure> controlMeasureList = preventRiskControlMeasureService.listAllControlMeasure(); + //遍历任务集合,取出所有的排查任务信息。 + for (PreventDangerCheckTask record : page.getRecords()) { + //取出任务和措施的对应关系 + List<PreventTaskAndMeasure> listByTaskId = preventTaskAndMeasureService.getListByTaskId(record.getId()); + + PreventDangerCheckTaskQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerCheckTaskQueryRespDTO.class); + //获取隐患排查内容的list + List<PreventrCheckContentRespDTO> preventCheckContentRespDTOS = new ArrayList<>(); + //封装措施数据 + + for (PreventTaskAndMeasure taskAndMeasure : listByTaskId) { + PreventrCheckContentRespDTO checkContentRespDTO = BeanCopyUtils.copyBean(taskAndMeasure, PreventrCheckContentRespDTO.class); + for (PreventRiskControlMeasure measure : controlMeasureList) { + if (measure.getId().equals(taskAndMeasure.getControlMeasureId())){ + checkContentRespDTO.setControlType(measure.getControlType()); + checkContentRespDTO.setClassify1(measure.getClassify1()); + checkContentRespDTO.setClassify2(measure.getClassify2()); + checkContentRespDTO.setClassify3(measure.getClassify3()); + checkContentRespDTO.setMeasureDesc(measure.getMeasureDesc()); + checkContentRespDTO.setControlMeasureCode(measure.getControlMeasureCode()); + } + } + preventCheckContentRespDTOS.add(checkContentRespDTO); +// + } + + respDTO.setCheckContent(preventCheckContentRespDTOS); + + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(record.getExecDepId()); + respDTO.setExecDep(departmentInfo.getDepartment()); + //封装任务数据 + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + //封装排查内容数据 + list.add(respDTO); + + } + + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + /** + * 隐患排查任务-分页查询-手机端使用-test + */ + @Override + public ResultVO<PreventDangerCheckTask> getTaskPageForMobileTest(Long userId, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + Integer pageIndex = taskQueryReqDTO.getPageIndex(); + Integer pageSize = taskQueryReqDTO.getPageSize(); + List<PreventDangerCheckTaskQueryRespDTO> list = new ArrayList<>(); + +// System.out.println("进入方法"); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + + + //获取到所有符合条件任务 + IPage<PreventDangerCheckTask> page = + preventDangerCheckTaskService.getTaskPageForMobile(new Page<>(pageIndex, pageSize), taskQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + if (ObjectUtils.isEmpty(page.getRecords())){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + List<Long> taskIdLists = new ArrayList<>(); + //取出所有符合条件的任务的id + for (PreventDangerCheckTask record : page.getRecords()) { + taskIdLists.add(record.getId()); + } + + //取出所有符合条件的任务和措施的对应关系 + List<PreventTaskAndMeasure> taskAndMeasureList = preventTaskAndMeasureService.getListByTaskIdByIdList(taskIdLists); + //取出所有符合条件的措施id + List<Long> measureIdList = new ArrayList<>(); + for (PreventTaskAndMeasure preventTaskAndMeasure : taskAndMeasureList) { + measureIdList.add(preventTaskAndMeasure.getControlMeasureId()); + } + + //取出所有符合条件措施 + List<PreventRiskControlMeasure> controlMeasureList = preventRiskControlMeasureService.getControlMeasureAndContent(measureIdList); + //取出所有部门 + List<DepartmentInfo> departmentList = departmentService.listDepartmentInfoById(); + + //遍历任务集合,匹配封装排查任务信息。 + //1、遍历所有符合条件的任务 + for (PreventDangerCheckTask task : page.getRecords()) { + //封装task数据 + PreventDangerCheckTaskQueryRespDTO respDTO = BeanCopyUtils.copyBean(task, PreventDangerCheckTaskQueryRespDTO.class); + //获取隐患排查内容的list + List<PreventrCheckContentRespDTO> checkContentRespDTOS = new ArrayList<>(); + //2、遍历所有符合条件的对应关系 + for (PreventTaskAndMeasure taskAndMeasure : taskAndMeasureList) { + if (taskAndMeasure.getCheckTaskId().equals(task.getId())){ + //3、遍历所有符合条件的措施数据 + for (PreventRiskControlMeasure measure : controlMeasureList) { + //4、匹配到任务对应的措施信息,封装检查内容 + if (measure.getId().equals(taskAndMeasure.getControlMeasureId())){ + PreventrCheckContentRespDTO checkInfo = BeanCopyUtils.copyBean(taskAndMeasure, PreventrCheckContentRespDTO.class); + checkInfo.setControlType(measure.getControlType()); + checkInfo.setClassify1(measure.getClassify1()); + checkInfo.setClassify2(measure.getClassify2()); + checkInfo.setClassify3(measure.getClassify3()); + checkInfo.setMeasureDesc(measure.getMeasureDesc()); + checkInfo.setControlMeasureCode(measure.getControlMeasureCode()); + checkContentRespDTOS.add(checkInfo); + } + } + } + } + //4、遍历部门信息,封装任务执行部门 + for (DepartmentInfo department : departmentList) { + if (department.getId().equals(task.getExecDepId())){ + respDTO.setExecDep(department.getDepartment()); + } + } + respDTO.setCheckContent(checkContentRespDTOS); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + /** + * 排查任务-认领任务 + */ + @Override + public ResultVO<PreventDangerCheckTask> taskToUser(ContextCacheUser currentUser, PreventDangerCheckTaskDeleteReqDTO taskToUserDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("认领成功"); + + //校验 + PreventDangerCheckTask taskById = preventDangerCheckTaskService.getTaskById(taskToUserDTO.getId()); + + if (ObjectUtils.isEmpty(taskById)){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "传参错误,未找到对应任务"); + } + if (ObjectUtils.isNotEmpty(taskById)){ + if (taskById.getExecUserId() != null){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "当前任务已经被人认领"); + } + if (taskById.getTaskStatus() == 3){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "当前任务已经超时,无法认领"); + } + if (taskById.getTaskStatus() == 2){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "任务已结束,无法认领"); + } + Date date = new Date(); + PreventTaskToUserParams taskToUserParams = new PreventTaskToUserParams(); + //封装参数 + taskToUserParams.setId(taskToUserDTO.getId()); + taskToUserParams.setExecUserId(currentUser.getUid()); + taskToUserParams.setExecUserName(currentUser.getRealName()); + taskToUserParams.setLastEditUserName(currentUser.getRealName()); + taskToUserParams.setGmtModitify(date); + taskToUserParams.setTaskBelong((byte) 2); + taskToUserParams.setBelongTime(date); + //执行修改,认领任务 + int result = preventDangerCheckTaskService.taskToUser(taskToUserParams); + resultVO.setCount(result); + } + + return resultVO; + } + + /** + * 排查任务-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateCheckTaskReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventDangerCheckTask taskById = preventDangerCheckTaskService.getTaskById(preventHandReportConfigReqDTO.getId()); + //配置相同,做处理 + if (taskById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + int result ; + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventDangerCheckTaskService.updateCheckTaskReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患排查任务-手动新增--暂时不提供 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckTask> saveTask(Long userId, PreventDangerCheckTaskSaveReqDTO taskSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + PreventDangerCheckTask checkTask = new PreventDangerCheckTask(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (taskSaveReqDTO.getStartTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写任务开始时间"); + } + if (taskSaveReqDTO.getValidTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写任务有效时间"); + } + if (taskSaveReqDTO.getExecUserId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写执行人姓名"); + } + //获取执行人信息 + ResultVO<UserRPCRespDTO> execUserResult = accountAuthService.getUserById(taskSaveReqDTO.getExecUserId()); + UserRPCRespDTO execUser = (UserRPCRespDTO)execUserResult.getData(); + if (ObjectUtils.isEmpty(execUser)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写正确的执行人姓名"); + } + + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long taskId = snowFlow.nextId(); + + List<Long> measureIdList = new ArrayList<>(); + //判断任务单元是否为空,不为空,则取出措施id + if (taskSaveReqDTO.getTaskUnitId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择任务单元"); + } + //查找单元信息 + PreventDangerCheckTaskUnit taskUnitById = preventDangerCheckTaskUnitService.getTaskUnitById(taskSaveReqDTO.getTaskUnitId()); + if (ObjectUtils.isEmpty(taskUnitById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的任务单元"); + } + + //根据单元id查找对应措施id列表-->measureList + // List<PreventRiskControlMeasure> measureList = preventRiskControlMeasureService.getlistByUnitId(taskSaveReqDTO.getTaskUnitId()); + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(taskSaveReqDTO.getTaskUnitId()); + //如果单元内措施列表不为空,遍历集合,取出措施id + if (listByUnitId.size() > 0) { + for (PreventTaskUnitAndMeasure taskUnitAndMeasure : listByUnitId) { + measureIdList.add(taskUnitAndMeasure.getMeasureId()); + } + } + + //设置任务参数 + checkTask.setCheckTaskUnitId(taskSaveReqDTO.getTaskUnitId()); + checkTask.setCheckTaskUnitUuid(taskUnitById.getUuid()); + //封装数据 + checkTask.setId(taskId); + checkTask.setUuid(uuid); + checkTask.setStartTime(taskSaveReqDTO.getStartTime()); + checkTask.setValidTime(taskSaveReqDTO.getValidTime()); + checkTask.setNoticeTime(date);//需要改为通知时间 + checkTask.setGmtCreate(date); + checkTask.setGmtModitify(date); + checkTask.setCreateUserName(userById.getRealName()); + checkTask.setLastEditUserName(userById.getRealName()); + checkTask.setResult(null); + checkTask.setTaskStatus(WorkStatusEnum.TASK_WAIT.getCode()); + checkTask.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + checkTask.setCheckWorkId(null); + checkTask.setCheckWorkUuid(null); + checkTask.setTaskType(WorkStatusEnum.TASK_TYPE_USER_ADD.getCode()); + checkTask.setTaskCode("task"+ date.toString());//TODO 暂定位task+时间 + checkTask.setExecUserId(taskSaveReqDTO.getExecUserId()); + checkTask.setExecUserName(execUser.getRealName()); + checkTask.setEnterpriseId((long) 1); + checkTask.setEnterpriseUuid("111"); + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + checkTask.setReportTime(null); + + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + checkTask.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + checkTask.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + checkTask.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkTask.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + checkTask.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkTask.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + + //任务插入 + int result = preventDangerCheckTaskService.saveTask(checkTask); + + //保存管控措施与任务关联,添加检查内容 + PreventTaskAndMeasure taskAndMeasure = new PreventTaskAndMeasure(); + for (Long measureId : measureIdList) { + //得到管控措施对应的检查内容 + PreventDangerCheckContent checkContent = preventDangerCheckContentService.getCheckContentByMeasureId(measureId); + //封装数据 + taskAndMeasure.setCheckTaskId(taskId); + taskAndMeasure.setControlMeasureId(measureId); + taskAndMeasure.setCheckContent(checkContent.getCheckContent()); + preventTaskAndMeasureService.saveTaskAndMeasure(taskAndMeasure); + } + + resultVO.setCount(result); + return resultVO; + } + /** + * 隐患排查任务-调度 + */ + @Transactional + @Override + public boolean createAutoTask(Long workId) { + + boolean createResult = false; + //查询对应的作业,获取信息 + PreventDangerCheckWork workById = preventDangerCheckWorkService.getWorkById(workId); + if (ObjectUtils.isEmpty(workById.getTaskUnitId())){ + logger.info("【双重预防】任务对应单元已被删除,停止调度"); + throw new BusinessException(E.DATA_STATUS_NOT_EXIST,"任务对应单元已被删除,停止调度"); + } + + System.out.println("\n【##】调度作业-检索信息"); + if (ObjectUtils.isEmpty(workById)){ + return createResult; + } + //0、加分布式锁 +// String lockName = "SAFECHECK_TASK_CREATE_"+workId; +// RLock createTaskLock = redissonClient.getLock(lockName); +// createTaskLock.lock(5, TimeUnit.SECONDS); + + + PreventDangerCheckTask checkTask = new PreventDangerCheckTask(); + + //获取调度任务时,需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long taskId = snowFlow.nextId(); + Date validTime = null; + Date noticeTime = null; + Date nextCheckTime = null; + Date checkTime = null; + //如果是第一次调度,以firstTime为标准;否则以nextTime为标准 + if (ObjectUtils.isNotEmpty(workById.getNextCheckTime())){ + //解析任务有效时间,以本次调度时的预期下次执行时间为基础计算 + if (workById.getValidTimeUnit() == 1) { + //如果时间单位是分钟 + validTime = new Date(workById.getNextCheckTime().getTime() + workById.getValidTime() * 60 * 1000); + }else if (workById.getValidTimeUnit() == 2) { + //如果时间单位是小时 + validTime = new Date(workById.getNextCheckTime().getTime() + workById.getValidTime() * 60 * 60 * 1000); + }else if (workById.getValidTimeUnit() == 3) { + //如果时间单位是日 + validTime = new Date(workById.getNextCheckTime().getTime() + workById.getValidTime() * 24 * 60 * 60 * 1000); + }else if (workById.getValidTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getNextCheckTime());//设置起时间 + calendar.add(Calendar.MONTH, workById.getValidTime());//增加N个月 + validTime = calendar.getTime(); + } + //解析任务通知时间 + if (workById.getNoticeTimeUnit() == 1) { + //如果时间单位是分钟 + noticeTime = new Date(workById.getNextCheckTime().getTime() - workById.getNoticeTime() * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 2) { + //如果时间单位是小时 + noticeTime = new Date(workById.getNextCheckTime().getTime() - workById.getNoticeTime() * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 3) { + //如果时间单位是日 + noticeTime = new Date(workById.getNextCheckTime().getTime() - workById.getNoticeTime() * 24 * 60 * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getNextCheckTime());//设置起时间 + calendar.add(Calendar.MONTH, -workById.getNoticeTime());//前移N个月 + noticeTime = calendar.getTime(); + } + checkTime = workById.getNextCheckTime(); + }else { + //解析任务有效时间,以本次调度时的预期下次执行时间为基础计算 + if (workById.getValidTimeUnit() == 1) { + //如果时间单位是分钟 + validTime = new Date(workById.getFirstStartTime().getTime() + workById.getValidTime() * 60 * 1000); + }else if (workById.getValidTimeUnit() == 2) { + //如果时间单位是小时 + validTime = new Date(workById.getFirstStartTime().getTime() + workById.getValidTime() * 60 * 60 * 1000); + }else if (workById.getValidTimeUnit() == 3) { + //如果时间单位是日 + validTime = new Date(workById.getFirstStartTime().getTime() + workById.getValidTime() * 24 * 60 * 60 * 1000); + }else if (workById.getValidTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getFirstStartTime());//设置起时间 + calendar.add(Calendar.MONTH, workById.getValidTime());//增加N个月 + validTime = calendar.getTime(); + } + //解析任务通知时间 + if (workById.getNoticeTimeUnit() == 1) { + //如果时间单位是分钟 + noticeTime = new Date(workById.getFirstStartTime().getTime() - workById.getNoticeTime() * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 2) { + //如果时间单位是小时 + noticeTime = new Date(workById.getFirstStartTime().getTime() - workById.getNoticeTime() * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 3) { + //如果时间单位是日 + noticeTime = new Date(workById.getFirstStartTime().getTime() - workById.getNoticeTime() * 24 * 60 * 60 * 1000); + }else if (workById.getNoticeTimeUnit() == 4) { + //如果时间单位是月 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(workById.getFirstStartTime());//设置起时间 + calendar.add(Calendar.MONTH, -workById.getNoticeTime());//前移N个月 + noticeTime = calendar.getTime(); + } + checkTime = workById.getFirstStartTime(); + } + + //0、加分布式锁 + String lockName = "PREVENT_TASK_CREATE_"+workId; + RLock createTaskLock = redissonClient.getLock(lockName); + createTaskLock.lock(3, TimeUnit.SECONDS); + + //锁3秒期间,判断任务是否已经生成,如果已经生成,结束方法 + PreventDangerCheckTask taskByCheckWorkIdAndStartTime = preventDangerCheckTaskService.getTaskByCheckWorkIdAndStartTime(workId, checkTime); + if (ObjectUtils.isNotEmpty(taskByCheckWorkIdAndStartTime)){ + logger.info("任务已被创建"); + return false; + } + + //解析调度周期时间间隔,work的下次执行时间 + if (workById.getCheckCycleUnit() == 1) { + //如果时间单位是分钟 + nextCheckTime = new Date(validTime.getTime() + workById.getCheckCycle() * 60 * 1000); + }else if (workById.getCheckCycleUnit() == 2) { + //如果时间单位是小时 + nextCheckTime = new Date(validTime.getTime() + workById.getCheckCycle() * 60 * 60 * 1000); + }else if (workById.getCheckCycleUnit() == 3) { + //如果时间单位是日 + nextCheckTime = new Date(validTime.getTime() + workById.getCheckCycle() * 24 * 60 * 60 * 1000); + }else if (workById.getCheckCycleUnit() == 4) { + //如果时间单位是月 + nextCheckTime = new Date(validTime.getTime() + workById.getCheckCycle() * 24 * 60 * 60 * 1000); + } + + + if (checkTime.getTime() > validTime.getTime()){ + logger.info("【双重预防】时间异常,停止调度,等待异常重置"); + throw new BusinessException(E.DATA_STATUS_NOT_EXIST,"时间异常,停止调度"); + } + + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG__CHECK_RECORD.getCode()); + //封装任务数据 + checkTask.setId(taskId); + checkTask.setUuid(uuid); + checkTask.setStartTime(checkTime); + checkTask.setValidTime(validTime); + checkTask.setNoticeTime(noticeTime); + checkTask.setGmtCreate(date); + checkTask.setGmtModitify(date); + checkTask.setCreateUserName(workById.getCreateByUserName()); + checkTask.setLastEditUserName(workById.getCreateByUserName()); + checkTask.setResult((byte) 3);//排查结果:1-正常,2-存在隐患,3-未处理 + checkTask.setTaskStatus(WorkStatusEnum.TASK_WAIT.getCode()); + checkTask.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + checkTask.setCheckWorkId(workId); + checkTask.setCheckWorkUuid(workById.getUuid()); + checkTask.setTaskCode(workById.getCheckWorkName()); + checkTask.setExecUserId(null); + checkTask.setExecUserName(null); + checkTask.setEnterpriseId((long) 1); + checkTask.setEnterpriseUuid("111"); + checkTask.setDesc(null); + checkTask.setExecDepId(workById.getExecDepId()); + checkTask.setExecDepUuid(null); + checkTask.setTaskType(workById.getCheckWorkType()); + checkTask.setTaskBelong((byte) 1); + checkTask.setBelongTime(null); +// if (workById.getCheckWorkStatus().equals(WorkStatusEnum.TASK_TYPE_AUTO.getCode())){ +// checkTask.setTaskType((byte) 1); +// } +// if (workById.getCheckWorkStatus().equals(WorkStatusEnum.TASK_TYPE_USER_ADD.getCode())){ +// checkTask.setTaskType((byte) 2); +// } + //任务参数 + checkTask.setCheckTaskUnitId(workById.getId()); + checkTask.setCheckTaskUnitUuid(workById.getUuid()); + checkTask.setReportTime(null); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + checkTask.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + checkTask.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + checkTask.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkTask.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + checkTask.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + checkTask.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + checkTask.setUpdateReportDataTime(date); + } + + int step = 1; + + /**写入任务信息*/ + int taskResult = preventDangerCheckTaskService.saveTask(checkTask); + + if (taskResult > 0) { + PreventTaskAndMeasure taskAndMeasure = new PreventTaskAndMeasure(); + //查询任务单元对应的管控错措施列表 + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(workById.getTaskUnitId()); + //如果单元内措施列表不为空,遍历集合,取出措施id + if (listByUnitId != null && listByUnitId.size() > 0){ + /**保存管控措施与任务的关联 */ + for (PreventTaskUnitAndMeasure taskUnitAndMeasure : listByUnitId) { + //得到管控措施对应的检查内容 + PreventDangerCheckContent checkContent = preventDangerCheckContentService.getCheckContentByMeasureId(taskUnitAndMeasure.getMeasureId()); + //封装数据 + taskAndMeasure.setCheckTaskId(taskId); + taskAndMeasure.setControlMeasureId(taskUnitAndMeasure.getMeasureId()); + taskAndMeasure.setCheckContent(checkContent.getCheckContent()); + taskAndMeasure.setCheckResult((byte) 3);//单项检查结果:1-正常,2-异常,3-未处理 + taskAndMeasure.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + int result = preventTaskAndMeasureService.saveTaskAndMeasure(taskAndMeasure); + if (result == 0){ + throw new BusinessException(E.ADD_FAIL, "保存对应检查内容失败"); + } + } + } + step = 2; + }else { + throw new BusinessException(E.ADD_FAIL, "保存任务信息失败"); + } + + /**修改作业信息*/ + if (step == 2){ + CheckWorkAutoUpdateParams updateWorkParams = new CheckWorkAutoUpdateParams(); + //封装修改参数 + updateWorkParams.setId(workById.getId()); + updateWorkParams.setLastCheckTime(checkTime); + updateWorkParams.setNextCheckTime(nextCheckTime); + if (workById.getCheckWorkType() == 2){ + updateWorkParams.setCheckWorkStatus((byte) 2); + }else if (workById.getCheckWorkType() == 1){ + updateWorkParams.setCheckWorkStatus((byte) 4); + } + int result = preventDangerCheckWorkService.updateCheckWorkLastTimeAndNextTime(updateWorkParams); + System.out.println("\n【##】修改作业状态成功" + new Date()); + if (result == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + step = 3; + }else { + throw new BusinessException(E.ADD_FAIL, "修改下次调度时间失败"); + } + // todo + // todo + if(step == 3){ + //发送执行提醒消息 + PreventNoticeExecTaskMsg preventNoticeExecTaskMsg = new PreventNoticeExecTaskMsg(); + preventNoticeExecTaskMsg.setTaskId(taskId); + preventNoticeExecTaskMsg.setNoticeTaskTime(noticeTime); + System.out.println("发送mq消息"); + SendResult sendResult = rocketMQTemplate.syncSend(preventNoticeTaskTopic, preventNoticeExecTaskMsg); + System.out.println("发送成功"); + if (sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("MQ发送任务通知信息失败"); + } + logger.info("\n【##】向Notice消息\t" + "MSG ID : " + sendResult.getMsgId()+"\t" + + "预计执行时间" + preventNoticeExecTaskMsg.getNoticeTaskTime()); + step = 4; + }else { + logger.info("第3步出错"); + } + + /**向MQ发送消息*/ + if (step == 4){ + //发送待执行消息 + PreventWaitExecTaskMsg preventWaitExecTaskMsg = new PreventWaitExecTaskMsg(); + //TASK ID + preventWaitExecTaskMsg.setTaskId(taskId); + //预期执行时间 + preventWaitExecTaskMsg.setExecTaskTime(workById.getNextCheckTime()); + SendResult sendResult = rocketMQTemplate.syncSend(preventWaitWorkTopic, preventWaitExecTaskMsg); + if (sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("MQ发送作业等待信息失败"); + } + logger.info("\n【##】向WaitExec消息\t" + "MSG ID : " + sendResult.getMsgId()+"\t" + + "预计执行时间" + preventWaitExecTaskMsg.getExecTaskTime()); + step = 5; + }else { + logger.info("第4步出错"); + } + + if(step == 5){ + //发送 改为 任务可调度状态 + if (workById.getCheckWorkType() == 1){ + PreventTimeOutTaskMsg preventTimeOutTaskMsg = new PreventTimeOutTaskMsg(); + preventTimeOutTaskMsg.setTaskId(taskId); + preventTimeOutTaskMsg.setWorkId(workId); + preventTimeOutTaskMsg.setOutTaskTime(validTime); + SendResult sendResult =rocketMQTemplate.syncSend(preventTimeOutTaskTopic, preventTimeOutTaskMsg); + if (sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("MQ发送任务状态变更通知信息失败"); + } + logger.info("\n【##】向TimeOut消息\t"+ "MSG ID : " + sendResult.getMsgId()+"\t" + + "预计执行时间" +preventTimeOutTaskMsg.getOutTaskTime()); + } + step = 6; + createResult = true; + }else { + logger.info("第5步出错"); + } + + if (step ==6) { + System.out.println("\n【##】任务创建完成:" + taskId + "----任务开始时间" + workById.getNextCheckTime()); + }else { + logger.info("第6步出错"); + } + //释放分布式锁 + createTaskLock.unlock(); + + return createResult; + } + + /** + * 隐患排查任务-数据上报 + */ + @Transactional + @Override + public ResultVO<PreventDangerCheckTask> updateTask(Long userId, PreventDangerCheckTaskUpdateReqDTO taskUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("任务结果提交成功"); + PreventDangerCheckTaskUpdateParams updateParams = new PreventDangerCheckTaskUpdateParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userInfo = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userInfo)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + + //获取执行人信息 + PreventDangerCheckTask taskById = preventDangerCheckTaskService.getTaskById(taskUpdateReqDTO.getId()); + UserRPCRespDTO execUser = (UserRPCRespDTO)rpcResult.getData(); + if (taskById.getExecUserId() .equals(userInfo.getUid())){ + throw new BusinessException(E.DATA_PARAM_NULL, "非认领人,无法操作"); + } + if (taskUpdateReqDTO.getCheckResults().size() <= 0){ + throw new BusinessException(E.DATA_PARAM_NULL, "检查结果不能为空"); + } + + //获取需要填充的信息 + int tag = 0; + Byte resultTag = 1; + PreventCheckResultParams checkResultParams = new PreventCheckResultParams(); + for (CheckResultReportDO CheckResults : taskUpdateReqDTO.getCheckResults()) { + //封装填报参数 + checkResultParams.setId(CheckResults.getId()); + checkResultParams.setCheckResult(CheckResults.getCheckResult()); + checkResultParams.setControlMeasureId(CheckResults.getControlMeasureId()); + preventTaskAndMeasureService.updateCheckResult(checkResultParams); + tag = tag + 1; + if (CheckResults.getCheckResult().equals(WorkStatusEnum.TASK_EXEC_RESULT_ERROR.getCode())){ + resultTag = WorkStatusEnum.TASK_EXEC_RESULT_ERROR.getCode(); + } + } + if (tag < taskUpdateReqDTO.getCheckResults().size()){ + throw new BusinessException(E.UPDATE_FAIL, "填报遇到问题,请稍后再尝试"); + } + + updateParams.setId(taskUpdateReqDTO.getId()); + updateParams.setLastEditUserName(userInfo.getRealName()); + updateParams.setGmtModitify(new Date()); + updateParams.setTaskStatus(WorkStatusEnum.TASK_EXEC_USED.getCode()); + updateParams.setResult(resultTag); + int result = preventDangerCheckTaskService.updateTask(updateParams); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "任务结果提交失败"); + } + + return resultVO; + } + + /** + * 隐患排查任务-删除 + */ + @Override + public ResultVO<PreventDangerCheckTask> deleteTask(Long userId, PreventDangerCheckTaskDeleteReqDTO taskDeleteReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventDeleteParams deleteParams = new PreventDeleteParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (taskDeleteReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择正确的查询内容"); + } + + UserInfo userInfo = userService.getByUserId(userId); + if (userInfo.getType().equals(3)){ + throw new BusinessException(E.DATA_PARAM_NULL, "非管理员,无法删除"); + } + Date date = new Date(); + //封装参数 + deleteParams.setId(taskDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userInfo.getRealname()); + deleteParams.setUpdateReportDataTime(date); + + int deleteResult = preventDangerCheckTaskService.deleteTask(deleteParams); + + resultVO.setCount(deleteResult); + + return resultVO; + } + + /** + * 隐患排查任务单元-批量删除 + */ + @Override + public ResultVO<PreventDangerCheckTaskUnit> deleteBatchTaskUnit(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + int i = 0; + + //校验参数 + if (ObjectUtils.isEmpty(deleteBatchReqDTO)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的删除内容"); + } + //获取需要填充的信息 + Date date = new Date(); + for (Long id : deleteBatchReqDTO.getIdList()) { + PreventDangerCheckTaskUnitDeleteParams deleteParams = new PreventDangerCheckTaskUnitDeleteParams(); + //封装删除需要的参数 + deleteParams.setId(id); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(currentUser.getRealName()); + + //检查该单元是否有措施 + List<PreventTaskUnitAndMeasure> listByUnitId = preventTaskUnitAndMeasureService.getListByUnitId(id); + //重置关联关系 + if (listByUnitId != null && listByUnitId.size() > 0){ + PreventTaskUnitAndMeasureParams taskUnitAndMeasureParams = new PreventTaskUnitAndMeasureParams(); + taskUnitAndMeasureParams.setTaskUnitId(id); + taskUnitAndMeasureParams.setGmtModitify(date); + taskUnitAndMeasureParams.setLastEditUserName(currentUser.getRealName()); + taskUnitAndMeasureParams.setDeleteStatus(StatusEnum.DELETE_STATUS_DISCARD.getCode()); + preventTaskUnitAndMeasureService.deleteTaskUnitAndMeasure(taskUnitAndMeasureParams); + } + + //删除单元 + int result = preventDangerCheckTaskUnitService.deleteTaskUnit(deleteParams); + i++; + } + + resultVO.setCount(i); + + return resultVO; + + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/FileHandlerServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/FileHandlerServiceImpl.java new file mode 100644 index 0000000..a23244f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/FileHandlerServiceImpl.java @@ -0,0 +1,843 @@ +package com.gk.hotwork.doublePrevention.service.impl;//package com.gk.hotwork.doublePrevention.service.impl; + +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.RiskControlClassify; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.ExcelProperty; +import com.gk.hotwork.Domain.Utils.FileOptUtils; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.RiskControlClassifyService; +import com.gk.hotwork.Service.UserService; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.enums.DeviceStatusEnum; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.service.FileHandlerService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import com.gk.hotwork.doublePrevention.utils.SnowFlow; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.FormulaEvaluator; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import java.util.regex.Pattern; + +import static com.gk.hotwork.Domain.Utils.Properties.filePath; + +@Service +public class FileHandlerServiceImpl implements FileHandlerService { + + @Autowired + private DepartmentService departmentService; + @Autowired + private UserService userService; + + @Autowired + private PreventDangerCheckTaskUnitService preventDangerCheckTaskUnitService; + @Autowired + private PreventRiskControlMeasureService preventRiskControlMeasureService; + @Autowired + private PreventDangerCheckWorkService preventDangerCheckWorkService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventDangerCheckContentService preventDangerCheckContentService; + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private PreventProduceDeviceService preventProduceDeviceService; + @Autowired + private PreventRiskMapService preventRiskMapService; + @Autowired + private PreventRiskAnaUnitService preventRiskUnitService; + @Autowired + private PreventRiskEventService preventRiskEventService; + @Autowired + private PreventRiskControlTemplateService preventRiskControlTemplateService; + + @Autowired + RiskControlClassifyService riskControlClassifyService; + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + //正整数 + String pattern = "^[0-9]*[1-9][0-9]*$"; + + Pattern pattern2 = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); + + String[] deviceTitle = {"生产装置", "风险等级", "所属部门", "区域位置"}; + + String[] riskUnitTitle = {"单元名称", "责任部门", "责任人", "安全风险分析对象编码", "生产装置"}; + + String[] eventTitle = {"事件名称", "单元名称", "可能造成的后果"}; + + String[] measureTitle = {"风险事件", "管控措施编号", "管控方式", "管控措施分类1", "管控措施分类2", "管控措施分类3", "管控措施描述", "隐患排查内容"}; + + + + /** + * 生产装置-导入 + */ + @Transactional + @Override + public ResultVO<PreventProduceDevice> deviceImport(ContextCacheUser currentUser, MultipartFile file) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("生产设施设备导入成功"); + + if (file == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "找不到上传文件"); + } + if (file.getSize() == 0){ + throw new BusinessException(E.DATA_PARAM_NULL, "文件内容为空"); + } + if (!FileOptUtils.isDirExists(filePath)) { + throw new BusinessException(E.DATA_PARAM_NULL, "发生错误或不为目录"); + } + String fileSave = filePath + currentUser.getRealName() + "_" + ".xlsx"; + int sum = 0; + //获取list + List<PreventProduceDevice> deviceLists = new ArrayList<>(); + + try { + file.transferTo(new File(fileSave)); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + InputStream in = new FileInputStream(fileSave); + + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != deviceTitle.length) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的列的个数错误"); + } + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((deviceTitle[i]))) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的第" + (i + 1) + "列的标题为:" + title[i] + ",不为:" + deviceTitle[i]); + } + } + //遍历封装数据 + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realRow = irow + 1; + PreventProduceDevice device = new PreventProduceDevice(); + Object value = null; + row = sheet.getRow(irow); + + //字段1-生产装置 + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,生产装置不能为空.<br/>"); + } else { + //无重名,设置属性 + PreventProduceDevice deviceByName = preventProduceDeviceService.getDeviceByName(value.toString().trim()); + if (ObjectUtils.isEmpty(deviceByName)){ + device.setProduceDeviceName(value.toString().trim()); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,生产装置名称已被使用,请在生产装置名称后添加编号或所属部门.<br/>"); + } + } + + //字段2-风险等级 + //String level1=""; + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,风险等级不能为空.<br/>"); + } + /*1-低风险,2-一般风险,3-较大风险,4-重大风险*/ + if(value.toString().trim().equals("低风险")){ + device.setRiskLevel((byte) 1); + } else if(value.toString().trim().equals("一般风险")){ + device.setRiskLevel((byte) 2); + } else if(value.toString().trim().equals("较大风险")){ + device.setRiskLevel((byte) 3); + } else if(value.toString().trim().equals("重大风险")){ + device.setRiskLevel((byte) 4); + } else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,风险等级不符合规范.<br/>"); + } + + //参数属性3-所属部门 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,所属部门不能为空.<br/>"); + } else { + //通过部门名称查部门 + DepartmentInfo departmentInfo = departmentService.getInfoByName(value.toString().trim()); + if (ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行,部门名称有误,或未录入系统.<br/>"); + }else { + device.setDepName(value.toString().trim()); + device.setDepId(departmentInfo.getId()); + } + } + + //参数属性4-区域位置 + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + (realRow + 1) + "行的区域位置不能为空.<br/>"); + } else { + device.setLocation(value.toString().trim()); + } + //获取填充信息 + Date date = new Date(); + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + //封装参数 + device.setId( snowFlow.nextId()); + device.setUuid(uuid); + device.setStatus(DeviceStatusEnum.DEVICE_USE.getCode()); + device.setEnterpriseId((long) 1); + device.setEnterpriseUuid("111"); + device.setDepUuid(null); + //TODO 此处未获取到真实姓名 + device.setCreateByUserName(currentUser.getRealName());//todo 暂时不知道是否能拿到属性 + device.setGmtCreate(date); + device.setLastEditUserName(currentUser.getRealName()); + device.setGmtModitify(date); + device.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + deviceLists.add(device); + } + } catch (IOException e) { + throw new RuntimeException("读取上传文件发生错误{}"+e); + } + + for (PreventProduceDevice device : deviceLists) { + //插入 + int result = preventProduceDeviceService.saveDevice(device); + sum = sum + result; + } + resultVO.setCount(sum); + + return resultVO; + } + + + /** + * 风险分析单元-导入 + */ + @Transactional + @Override + public ResultVO<PreventRiskAnaUnit> riskUnitImport(ContextCacheUser currentUser, MultipartFile file) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg(" 风险分析单元数据导入成功"); + + if (file == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "找不到上传文件"); + } + if (file.getSize() == 0){ + throw new BusinessException(E.DATA_PARAM_NULL, "文件内容为空"); + } + if (!FileOptUtils.isDirExists(filePath)) { + throw new BusinessException(E.DATA_PARAM_NULL, "发生错误或不为目录"); + } + String fileSave = filePath + currentUser.getRealName() + "_" + ".xlsx"; + int sum = 0; + //获取list + List<PreventRiskAnaUnit> riskUnitLists = new ArrayList<>(); + + try { + file.transferTo(new File(fileSave)); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + InputStream in = new FileInputStream(fileSave); + + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != riskUnitTitle.length) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的列的个数错误"); + } + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((riskUnitTitle[i]))) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的第" + (i + 1) + "列的标题为" + title[i] + "不为" + riskUnitTitle[i]); + } + } + //遍历封装数据 + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realRow = irow + 1; + PreventRiskAnaUnit riskAnaUnit = new PreventRiskAnaUnit(); + Object value = null; + Object value1 = null; + row = sheet.getRow(irow); + + //字段1-安全风险分析单元 + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析单元名称不能为空.<br/>"); + } else { + PreventRiskAnaUnit riskUnitByName = preventRiskUnitService.getRiskUnitByName(value.toString().trim()); + //无重名,设置属性 + if (ObjectUtils.isEmpty(riskUnitByName)){ + riskAnaUnit.setRiskUnitName(value.toString().trim()); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析单元名称已被使用,请在安全风险分析单元名称后添加编号或所属部门.<br/>"); + } + } + + //字段2-责任部门 + value1 = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value1 || StringUtils.isBlank(value1.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,责任部门不能为空.<br/>"); + } else { + //通过部门名称查部门 + DepartmentInfo departmentInfo = departmentService.getInfoByName(value1.toString().trim()); + if (ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,责任部门名称有误,或未录入系统.<br/>"); + }else { + riskAnaUnit.setLiableDep(value1.toString().trim()); + riskAnaUnit.setLiableDepId(departmentInfo.getId()); + riskAnaUnit.setLiableDepUuid(null); + } + } + + //字段3-责任人 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行的责任人不能为空.<br/>"); + } else { + //UserInfo userInfo = userService.selectByUser(value.toString().trim()); + DepartmentInfo departmentInfo = departmentService.getInfoByName(value1.toString().trim()); + UserInfo userByRealName = userService.getUserByRealNameAndDep(value.toString().trim(), departmentInfo.getId()); + if (ObjectUtils.isEmpty(userByRealName)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行的责任人名称有误,或未录入系统.<br/>"); + }else { + riskAnaUnit.setLiablePerson(userByRealName.getRealname()); + riskAnaUnit.setLiablePersonId(userByRealName.getId()); + riskAnaUnit.setLiablePersonUuid(null); + } + } + + //参数属性4-安全风险分析对象编码 + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析对象编码不能为空.<br/>"); + } else { + //查询是否有重复编码 + PreventRiskAnaUnit riskUnitByCode = preventRiskUnitService.getRiskUnitByCode(value.toString().trim()); + if (ObjectUtils.isEmpty(riskUnitByCode)){ + riskAnaUnit.setRiskCode(value.toString().trim()); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析对象编码已经被使用.<br/>"); + } + } + + //参数属性5-所属生产装置 + value = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,生产装置不能为空.<br/>"); + } else { + PreventProduceDevice deviceByName = preventProduceDeviceService.getDeviceByNameAndDep(value.toString().trim(), value1.toString().trim()); + if (ObjectUtils.isEmpty(deviceByName)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,生产装置不存在或未录入系统.<br/>"); + }else { + riskAnaUnit.setProduceDeviceId(deviceByName.getId()); + riskAnaUnit.setProduceDeviceUuid(deviceByName.getUuid()); + } + } + + //获取填充信息 + Date date = new Date(); + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + //封装参数 + riskAnaUnit.setId(snowFlow.nextId()); + riskAnaUnit.setUuid(uuid); + riskAnaUnit.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + riskAnaUnit.setEnterpriseId((long) 1); + riskAnaUnit.setEnterpriseUuid("111"); + riskAnaUnit.setGmtModitify(date); + riskAnaUnit.setGmtCreate(date); + riskAnaUnit.setCreateByUserName(currentUser.getRealName()); + riskAnaUnit.setLastEditUserName(currentUser.getRealName()); + //读取上报主配置,设置上报属性 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //设置上报时间为空 + riskAnaUnit.setReportTime(null); + //设置本条数据上报更新时间 + riskAnaUnit.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + riskAnaUnit.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + riskAnaUnit.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + riskAnaUnit.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + riskAnaUnit.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + //封装数据 + riskUnitLists.add(riskAnaUnit); + } + } catch (IOException e) { + throw new RuntimeException("读取上传文件发生错误{}"+e); + } + + //插入 + for (PreventRiskAnaUnit riskUnit : riskUnitLists) { + int result = preventRiskUnitService.saveRiskAnaUnit(riskUnit); + sum = sum + result; + } + resultVO.setCount(sum); + + return resultVO; + } + + /** + * 安全风险事件-导入 + */ + @Transactional + @Override + public ResultVO<PreventRiskEvent> eventImport(ContextCacheUser currentUser, MultipartFile file) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg(" 安全风险事件数据导入成功"); + + if (file == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "找不到上传文件"); + } + if (file.getSize() == 0){ + throw new BusinessException(E.DATA_PARAM_NULL, "文件内容为空"); + } + if (!FileOptUtils.isDirExists(filePath)) { + throw new BusinessException(E.DATA_PARAM_NULL, "发生错误或不为目录"); + } + String fileSave = filePath + currentUser.getRealName() + "_" + ".xlsx"; + int sum = 0; + //获取list + List<PreventRiskEvent> eventList = new ArrayList<>(); + + try { + file.transferTo(new File(fileSave)); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + InputStream in = new FileInputStream(fileSave); + + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != eventTitle.length) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的列的个数错误"); + } + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((eventTitle[i]))) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的第" + (i + 1) + "列的标题为:" + title[i] + ",不为:" + eventTitle[i]); + } + } + //遍历封装数据 + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realRow = irow + 1; + PreventRiskEvent event = new PreventRiskEvent(); + Object value = null; + row = sheet.getRow(irow); + + //字段1-风险事件名称 + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,风险事件名称不能为空.<br/>"); + } else { + //通过部门名称查部门 + PreventRiskEvent riskEventByName = preventRiskEventService.getRiskEventByName(value.toString().trim()); + if (ObjectUtils.isEmpty(riskEventByName)){ + event.setRiskEventName(value.toString().trim()); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,风险事件名称已经被使用,请为新事件添加编号、部门、设施.<br/>"); + } + } + + //字段2-安全风险分析单元 + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析单元名称不能为空.<br/>"); + } else { + PreventRiskAnaUnit riskUnitByName = preventRiskUnitService.getRiskUnitByName(value.toString().trim()); + if (ObjectUtils.isEmpty(riskUnitByName)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,安全风险分析单元不存在或未录入系统.<br/>"); + }else { + event.setRiskUnitId(riskUnitByName.getId()); + event.setRiskUnitUuid(riskUnitByName.getUuid()); + } + } + + //字段3-可能造成的后果 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + event.setEventResult(null); + } else { + event.setEventResult(value.toString().trim()); + } + + //获取填充信息 + Date date = new Date(); + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + //封装参数 + event.setId(snowFlow.nextId()); + event.setUuid(uuid); + event.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + event.setEnterpriseId((long) 1); + event.setEnterpriseUuid("111"); + event.setGmtModitify(date); + event.setGmtCreate(date); + event.setCreateByUserName(currentUser.getRealName()); + event.setLastEditUserName(currentUser.getRealName()); + //读取上报主配置,设置属性 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + //设置上报时间为空 + event.setReportTime(null); + //设置本条数据上报更新时间 + event.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + event.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + event.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + event.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + event.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + eventList.add(event); + } + } catch (IOException e) { + throw new RuntimeException("读取上传文件发生错误{}"+e); + } + + //插入 + for (PreventRiskEvent event : eventList) { + int result = preventRiskEventService.saveRiskEvent(event); + sum = sum + result; + } + resultVO.setCount(sum); + + return resultVO; + } + + + + /** + * 管控措施-导入 + */ + @Transactional + @Override + public ResultVO<PreventRiskEvent> measureImport(ContextCacheUser currentUser, MultipartFile file) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg(" 安全风险管控措施导入成功"); + + if (file == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "找不到上传文件"); + } + if (file.getSize() == 0){ + throw new BusinessException(E.DATA_PARAM_NULL, "文件内容为空"); + } + if (!FileOptUtils.isDirExists(filePath)) { + throw new BusinessException(E.DATA_PARAM_NULL, "发生错误或不为目录"); + } + String fileSave = filePath + currentUser.getRealName() + "_" + ".xlsx"; + int sum = 0; + //获取list + List<PreventRiskControlMeasure> measureList = new ArrayList<>(); + List<PreventDangerCheckContent> checkContentList = new ArrayList<>(); + + try { + file.transferTo(new File(fileSave)); + String name = file.getOriginalFilename(); + Boolean isExcel2007 = name.substring(name.lastIndexOf(".") + 1).endsWith("xlsx") ? true : false; + InputStream in = new FileInputStream(fileSave); + + Workbook workbook = null; + if (isExcel2007) { + workbook = new XSSFWorkbook(in); + } else { + workbook = new HSSFWorkbook(in); + } + + FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "excel 第1页不能为空"); + } + Row row = sheet.getRow(0); + // 标题总列数 + int colNum = row.getPhysicalNumberOfCells(); + String[] title = new String[colNum]; + + if (colNum != measureTitle.length) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的列的个数错误"); + } + for (int i = 0; i < colNum; i++) { + + title[i] = row.getCell(i).getStringCellValue(); + if (StringUtils.isNotBlank(title[i])) { + title[i] = title[i].trim(); + } + if (!title[i].equals((measureTitle[i]))) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "上传文件的第" + (i+1) + "列的标题为:" + title[i] + ",不为:" + measureTitle[i]); + } + } + //遍历封装数据 + for (int irow = 1; irow <= sheet.getLastRowNum(); irow++) { + int realRow = irow + 1; + PreventRiskControlMeasure measure = new PreventRiskControlMeasure(); + PreventDangerCheckContent checkContent = new PreventDangerCheckContent(); + Object value = null; + Object value1 = null; + row = sheet.getRow(irow); + + //字段1-风险事件名称 封装eventId 与 eventUuid + value = ExcelProperty.getCellValue(row.getCell(0), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,风险事件名称不能为空.<br/>"); + } else { + //通过名称查事件 + PreventRiskEvent riskEventByName = preventRiskEventService.getRiskEventByName(value.toString().trim()); + if (ObjectUtils.isEmpty(riskEventByName)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,风险事件不存在或未录入系统.<br/>"); + }else { + measure.setRiskEventId(riskEventByName.getId()); + measure.setRiskEventUuid(riskEventByName.getUuid()); + } + } + + //字段2-管控措施编号 + value = ExcelProperty.getCellValue(row.getCell(1), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控措施编号不能为空.<br/>"); + } else { + PreventRiskControlMeasure controlMeasureByCode = preventRiskControlMeasureService.getControlMeasureByCode(value.toString().trim()); + if (ObjectUtils.isEmpty(controlMeasureByCode)){ + measure.setControlMeasureCode(value.toString().trim()); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控措施编号已经被使用.<br/>"); + } + } + + //字段3-管控方式 + value = ExcelProperty.getCellValue(row.getCell(2), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控方式不能为空.<br/>"); + } else { + if (value.toString().trim().equals("自动化监控")){ + measure.setControlType((byte) 1); + }else if (value.toString().trim().equals("隐患排查")){ + measure.setControlType((byte) 2); + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控方式不符合要求.<br/>"); + } + } + + + //字段4、5-管控措施分类1、管控措施分类2 + value = ExcelProperty.getCellValue(row.getCell(3), evaluator); + value1 = ExcelProperty.getCellValue(row.getCell(4), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控措施分类1不能为空.<br/>"); + } else if (null == value1 || StringUtils.isBlank(value.toString())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控措施分类2不能为空.<br/>"); + }else { + RiskControlClassify getByClassify1AndClassify2 = riskControlClassifyService.getByClassify1AndClassify2(value.toString().trim(), value1.toString().trim()); + if (ObjectUtils.isEmpty(getByClassify1AndClassify2)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,管控措施分类1与管控措施分类2不符合规范或者不是父子层级.<br/>"); + }else { + RiskControlClassify Classify1 = riskControlClassifyService.getByClassify(value.toString().trim()); + measure.setClassify1(Classify1.getId().byteValue()); + RiskControlClassify Classify2 = riskControlClassifyService.getByClassify2(Classify1.getId(), value1.toString().trim()); + measure.setClassify2(Classify2.getId().byteValue()); + } + } + + //字段6-管控措施分类3 + value = ExcelProperty.getCellValue(row.getCell(5), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + measure.setClassify3(null); + } else { + measure.setClassify3(value.toString().trim()); + } + + //字段7-管控措施描述 + value = ExcelProperty.getCellValue(row.getCell(6), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + measure.setMeasureDesc(null); + } else { + measure.setMeasureDesc(value.toString().trim()); + } + + //字段7-隐患排查内容 + value = ExcelProperty.getCellValue(row.getCell(7), evaluator); + if (null == value || StringUtils.isBlank(value.toString())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "文件不符合要求,第" + realRow + "行,隐患排查内容不能为空.<br/>"); + } else { + checkContent.setCheckContent(value.toString().trim()); + } +// String[] measureTitle = {"风险事件", "管控措施编号", "管控方式", "管控措施分类1", "管控措施分类2", "管控措施分类3", "管控措施描述", "隐患排查内容"}; todo + //获取填充信息 + Date date = new Date(); + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + long measureId = snowFlow.nextId(); + //封装管控措施参数 + measure.setId(measureId); + measure.setUuid(uuid); + measure.setEnterpriseId((long) 1); + measure.setEnterpriseUuid("123"); + measure.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + measure.setGmtModitify(date); + measure.setGmtCreate(date); + measure.setCreateByUserName(currentUser.getRealName()); + measure.setLastEditUserName(currentUser.getRealName()); + measure.setCheckTaskUnitId(null); + measure.setCheckTaskUnitUuid(null); + measure.setCheckWorkId(null); + measure.setCheckWorkUuid(null); + measure.setCheckTaskId(null); + measure.setCheckTaskUuid(null); + + //封装隐患检查内容的参数 + checkContent.setControlMeasureId(measureId); + checkContent.setControlMeasureUuid(uuid); + + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //设置上报时间为空 + measure.setReportTime(null); + //设置本条数据上报更新时间 + measure.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + measure.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + measure.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + measure.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + measure.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + measureList.add(measure); + checkContentList.add(checkContent); + } + } catch (IOException e) { + throw new RuntimeException("读取上传文件发生错误{}"+e); + } + + //插入 +// for (PreventRiskControlMeasure measure : measureList) { +// int result = preventRiskControlMeasureService.saveRiskControlMeasure(measure); +// if (result == 0 ){ +// throw new BusinessException(E.ADD_FAIL, "新增失败"); +// } +// sum = sum + result; +// } + //todo + boolean b = preventRiskControlMeasureService.saveBatch(measureList); + + //保存排查内容 + for (PreventDangerCheckContent checkContent : checkContentList) { + int result = preventDangerCheckContentService.saveDangerCheckContent(checkContent); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + resultVO.setCount(sum); + + return resultVO; + } +} + + + diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RectifyServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RectifyServiceImpl.java new file mode 100644 index 0000000..41d09d2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RectifyServiceImpl.java @@ -0,0 +1,1745 @@ +package com.gk.hotwork.doublePrevention.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.doublePrevention.entity.dto.query.OwnRectifyPageQuery; +import com.gk.hotwork.doublePrevention.entity.dto.query.db.OwnRectifyPageDBQuery; +import com.gk.hotwork.doublePrevention.entity.dto.resp.*; +import com.gk.hotwork.doublePrevention.enums.DataConvertEnum; +import com.gk.hotwork.doublePrevention.enums.ImageTypeEnum; +import com.gk.hotwork.doublePrevention.utils.BeanCopyUtils; +import com.gk.hotwork.doublePrevention.utils.SnowFlow; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.repository.param.*; +import com.gk.hotwork.doublePrevention.service.RectifyService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import org.apache.commons.lang3.ObjectUtils; + +import org.apache.commons.lang3.StringUtils; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +@Service +public class RectifyServiceImpl implements RectifyService { + + @Autowired + private AccountAuthService accountAuthService; + @Autowired + private AccountDepartmentService accountDepartmentService; + @Autowired + private RedissonClient redissonClient; + + @Autowired + private PreventDangerManageService preventDangerManageService; + @Autowired + private PreventDangerRectifyService preventDangerRectifyService; + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventProduceDeviceService preventProduceDeviceService; + @Autowired + private PreventDangerCheckTaskUnitService preventDangerCheckTaskUnitService; + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private PreventRiskAnaUnitService preventRiskAnaUnitService; + @Autowired + private DepartmentService departmentService; + @Autowired + private PreventDangerManageTimeoutService preventDangerManageTimeoutService; + @Autowired + private PreventDangerImageService preventDangerImageService; + + //隐患治理清单 + /** + * 隐患治理清单-分页查询 + */ + @Override + public ResultVO<PreventDangerManage> getDangerManagePage(Long userId, PreventDangerManageQueryReqDTO manageQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerManageQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = manageQueryReqDTO.getPageIndex(); + Integer pageSize = manageQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //获取到所有符合条件的隐患治理清单信息 + IPage<PreventDangerManage> page = + preventDangerManageService.getDangerManagePage(new Page<>(pageIndex, pageSize), manageQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //遍历结果集,封装数据 + for (PreventDangerManage record : page.getRecords()) { + PreventDangerManageQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerManageQueryRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(record.getProduceDeviceId()); + if (ObjectUtils.isNotEmpty(deviceById)){ + respDTO.setProduceDeviceName(deviceById.getProduceDeviceName()); + } + + PreventRiskAnaUnit riskUnitById = preventRiskAnaUnitService.getRiskUnitById(record.getRiskUnitId()); + if (ObjectUtils.isNotEmpty(riskUnitById)){ + respDTO.setRiskUnitName(riskUnitById.getRiskUnitName()); + } + PreventDangerRectify rectifyByManageId = preventDangerRectifyService.getRectifyByManageId(record.getId()); + // 上报图片 + List<PreventDangerImage> images = preventDangerImageService.listImagesByParentId(record.getId()); + if (ObjectUtils.isNotEmpty(rectifyByManageId)){ + //获取责任人信息 + ResultVO<UserRPCRespDTO> liablePersonResult = accountAuthService.getUserById(rectifyByManageId.getLiablePersonId()); + UserRPCRespDTO liablePerson = (UserRPCRespDTO)liablePersonResult.getData(); + if (rectifyByManageId.getCost() != null){ + respDTO.setCost(rectifyByManageId.getCost()); + } + if (rectifyByManageId.getRectifyDesc() != null){ + respDTO.setRectifyDesc(rectifyByManageId.getRectifyDesc()); + } + if (rectifyByManageId.getRectifyInfo() != null){ + respDTO.setRectifyInfo(rectifyByManageId.getRectifyInfo()); + } + if (rectifyByManageId.getCheckAcceptPersonId() != null){ + respDTO.setCheckAcceptTime(rectifyByManageId.getCheckAcceptTime()); + respDTO.setCheckAcceptPerson(rectifyByManageId.getCheckAcceptPerson()); + respDTO.setCheckAcceptDesc(rectifyByManageId.getCheckAcceptDesc()); + respDTO.setLiablePersonId(rectifyByManageId.getLiablePersonId()); + } + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(rectifyByManageId.getRectifyDepId()); + if (departmentInfo != null) { + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + } + respDTO.setCheckAcceptPersonId(rectifyByManageId.getCheckAcceptPersonId()); + respDTO.setRectifyTime(rectifyByManageId.getRectifyTime()); + respDTO.setRectifyType(rectifyByManageId.getRectifyType()); + respDTO.setRectifyDepId(rectifyByManageId.getRectifyDepId()); + respDTO.setLiablePersonId(rectifyByManageId.getLiablePersonId()); + respDTO.setLastEditUserName(rectifyByManageId.getLiablePerson()); + respDTO.setRectifyDepId(rectifyByManageId.getRectifyDepId()); + respDTO.setTimeOutDesc(respDTO.getTimeOutDesc()); + respDTO.setRectifyId(rectifyByManageId.getId()); + + List<PreventDangerManageImageRespDTO> imageRespDTOs = new ArrayList<>(images.size()); + PreventDangerManageImageRespDTO reportImage; + if (images.size() > 0) { + for (PreventDangerImage image : images) { + reportImage = new PreventDangerManageImageRespDTO(); + reportImage.setId(image.getId()); + reportImage.setImagePath(image.getImagePath()); + reportImage.setParentId(image.getParentId()); + reportImage.setType(image.getType()); + imageRespDTOs.add(reportImage); + } + } + List<String> reportList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.REPORT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> rectifyList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.RECTIFY.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> acceptList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.ACCEPT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + respDTO.setReportImages(reportList); + respDTO.setRectifyImages(rectifyList); + respDTO.setAcceptImages(acceptList); + } + DepartmentInfo departmentInfo1 = departmentService.getDepartmentInfoById(record.getDepId()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setDepName(departmentInfo1.getDepartment()); + list.add(respDTO); + } + resultVO.setData(list); + resultVO.setCount((int) page.getTotal()); + + return resultVO; + } + /** + * 隐患治理清单-列表 + */ + @Override + public ResultVO<PreventDangerManage> listDangerManage(Long valueOf) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerManage> dangerManages = preventDangerManageService.listDangerManage(); + List<PreventDangerManageListQueryRespDTO> respDTOS = + BeanCopyUtils.copyBeanList(dangerManages, PreventDangerManageListQueryRespDTO.class); + + resultVO.setData(respDTOS); + return resultVO; + } + /** + * 隐患管理-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateDangerManagerReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改上报数据成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(preventHandReportConfigReqDTO.getId()); + //配置相同,做处理 + if (dangerManageById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + int result ; + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventDangerManageService.updateDangerManagerReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患治理清单-新增 + */ + @Transactional + @Override + public ResultVO<PreventDangerManage> saveDangerManage(Long userId, PreventDangerManageSaveReqDTO manageSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (manageSaveReqDTO.getDangerLevel() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患等级不能为空"); + } + if (manageSaveReqDTO.getDangerType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患类型不能为空"); + } + if (manageSaveReqDTO.getDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患所属部门不能为空"); + } + if (manageSaveReqDTO.getDangerCode() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患名称不能为空"); + } + // 图片 + if (manageSaveReqDTO.getReportImages() == null || manageSaveReqDTO.getReportImages().size() < 1) { + throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空"); + } + for (String path : manageSaveReqDTO.getReportImages()) { + if (StringUtils.isBlank(path)) { + throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空路径"); + } + } + // 图片 + if (manageSaveReqDTO.getReportImages().size() > 3) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "图片上传不能超过三张"); + } + //校验部门是否存在 +// ResultVO<DepInfoRPCRespDTO> depInfoByDepId = accountDepartmentService.getDepInfoByDepId(userId, manageSaveReqDTO.getDepId()); + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(manageSaveReqDTO.getDepId()); + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + if (manageSaveReqDTO.getRiskUnitId() != null){ + PreventRiskAnaUnit riskUnitById = preventRiskAnaUnitService.getRiskUnitById(manageSaveReqDTO.getRiskUnitId()); + if(ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确的风险分析单元"); + } + } + + if (manageSaveReqDTO.getProduceDeviceId() != null){ + PreventProduceDevice deviceById = + preventProduceDeviceService.getDeviceById(manageSaveReqDTO.getProduceDeviceId()); + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写正确的生产装置"); + } + PreventRiskAnaUnit riskUnitById = preventRiskAnaUnitService.getRiskUnitById(manageSaveReqDTO.getRiskUnitId()); + if (ObjectUtils.isNotEmpty(riskUnitById)){ + if (!riskUnitById.getProduceDeviceId().equals(manageSaveReqDTO.getProduceDeviceId())){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写生产装置对应的分析单元"); + } + }else if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写生产装置对应的分析单元"); + } + } + if (manageSaveReqDTO.getRectifyType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改类型不能为空"); + } + if (manageSaveReqDTO.getDangerResult() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患可能造成的后果不能为空"); + } + if (manageSaveReqDTO.getLiablePersonId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改责任人不能为空"); + } + //责任人信息 + ResultVO<UserRPCRespDTO> execUserResult = accountAuthService.getUserById(manageSaveReqDTO.getLiablePersonId()); + UserRPCRespDTO liableUser = (UserRPCRespDTO)execUserResult.getData(); + if (ObjectUtils.isEmpty(liableUser)){ + throw new BusinessException(E.DATA_PARAM_NULL, "该责任人不存在或已被删除,请选择正确的责任人"); + } + if (manageSaveReqDTO.getRectifyTime() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改期限不能为空"); + } + if (manageSaveReqDTO.getRectifyDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改部门不能为空"); + } + if (!manageSaveReqDTO.getRectifyDepId().equals(liableUser.getDepartment().getDepId())){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改人不属于该部门"); + } + + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long dangerManagerId = snowFlow.nextId(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + /**设置隐患管理表参数*/ + PreventDangerManage dangerManage = BeanCopyUtils.copyBean(manageSaveReqDTO, PreventDangerManage.class); + dangerManage.setId(dangerManagerId); + dangerManage.setUuid(uuid); + dangerManage.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + dangerManage.setGmtCreate(date); + dangerManage.setGmtModitify(date); + dangerManage.setCreateByUserName(userById.getRealName()); + dangerManage.setLastEditUserName(userById.getRealName()); + dangerManage.setEnterpriseId((long) 1); + dangerManage.setEnterpriseUuid("123124134"); + dangerManage.setDangerStatus(StatusEnum.DANGER_MANAGER_RECTIFY.getCode()); + dangerManage.setDangerReview(StatusEnum.DANGER_RECTIFY_WAIT.getCode()); + dangerManage.setDangerCode(manageSaveReqDTO.getDangerCode()); + dangerManage.setDangerCloseReason(null); + //这暂时不用字段 + dangerManage.setTaskId(null); + dangerManage.setRegistantId(null); + dangerManage.setRegisterTime(null); + dangerManage.setRegistantName(null); + + /**设置隐患整改验收表的参数*/ + //获取需要填充的信息 + String RectifyUuid = UUID.randomUUID().toString(); + long rectifyId = snowFlow.nextId(); + //封装参数 + PreventDangerRectify dangerRectify = BeanCopyUtils.copyBean(manageSaveReqDTO, PreventDangerRectify.class); + dangerRectify.setId(rectifyId); + dangerRectify.setUuid(RectifyUuid); + dangerRectify.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + dangerRectify.setGmtCreate(date); + dangerRectify.setCreateByUserName(userById.getRealName()); + dangerRectify.setGmtModitify(date); + dangerRectify.setLastEditUserName(userById.getRealName()); + dangerRectify.setEnterpriseId((long) 1); + dangerRectify.setEnterpriseUuid("1564wq"); + dangerRectify.setDangerManagerUuid(uuid); + dangerRectify.setDangerManagerId(dangerManagerId); + dangerRectify.setLiablePerson(liableUser.getRealName()); + dangerRectify.setDangerCode(null); + dangerRectify.setApplyTime(null); + dangerRectify.setTimeOutDesc(null); + dangerRectify.setRectifyInfo(null); + dangerRectify.setCheckAcceptPerson(userById.getRealName()); + dangerRectify.setRectifyDepId(manageSaveReqDTO.getRectifyDepId()); + dangerRectify.setDangerReview(StatusEnum.DANGER_RECTIFY_WAIT.getCode()); + dangerRectify.setCheckAcceptPersonId(userId); + dangerRectify.setCheckAcceptPerson(userById.getRealName()); + // 不确定是否需要的字段 + dangerRectify.setCheckAcceptTime(null); + dangerRectify.setCheckAcceptDesc(null); + //TODO + //设置上报时间为空,以隐患管理表为主,同时设置上报 + dangerManage.setReportTime(null); + dangerRectify.setReportTime(null); + //设置本条数据上报更新时间 + dangerManage.setUpdateReportDataTime(new Date()); + dangerRectify.setUpdateReportDataTime(new Date()); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + dangerManage.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + dangerRectify.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + dangerManage.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + dangerManage.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + dangerRectify.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + dangerManage.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + //生成隐患编码 + LocalDateTime t = dangerManage.getGmtCreate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + LocalDate localDate = t.toLocalDate(); + LocalDateTime startTime = LocalDateTime.of(localDate, LocalTime.of(0,0,0)); + LocalDateTime endTime = LocalDateTime.of(localDate, LocalTime.of(23,59,59)); + Date start = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()); + //1、加分布式锁 + String lockName = "LOCK_DANGER_CODE_GENERATE"; + RLock lock = redissonClient.getLock(lockName); + lock.lock(3, TimeUnit.SECONDS); + int count = -1; + try { + count = preventDangerManageService.countByCreateTime(start,end); + } catch (Exception e) { + lock.unlock(); + throw new BusinessException(E.ADD_FAIL, "保存隐患整改信息失败"); + } + //2、生成编码 + String serialCode = generateDangerSerialCode(dangerManage.getGmtCreate(),count); + if(serialCode == null || serialCode.isEmpty()){ + throw new BusinessException(E.ADD_FAIL, "保存隐患整改信息失败"); + } + dangerManage.setSerialCode(serialCode); + + + // 图片 + List<PreventDangerImage> images = new ArrayList<>(); + PreventDangerImage image; + for (String path : manageSaveReqDTO.getReportImages()) { + image = new PreventDangerImage(); + image.setId(snowFlow.nextId()); + image.setImagePath(path); + image.setParentId(dangerManage.getId()); + image.setStatus(DataConvertEnum.DELETE_STATUS_USE.getCode()); + image.setType(ImageTypeEnum.REPORT.getCode()); + images.add(image); + } + preventDangerImageService.saveBatch(images); + + + + int step = 1; + //保存隐患管理信息 + if (step == 1){ + int resultManage = preventDangerManageService.saveDangerManage(dangerManage); + if (resultManage < 1){ + throw new BusinessException(E.ADD_FAIL, "保存隐患管理信息失败"); + }else { + step = 2; + } + } + //保存隐患整改信息 + if (step == 2){ + int resultRectify = preventDangerRectifyService.saveDangerRectify(dangerRectify); + if (resultRectify < 1){ + throw new BusinessException(E.ADD_FAIL, "保存隐患整改信息失败"); + } + } + + return resultVO; + } + + /** + * 隐患管理清单-修改 + */ + @Transactional + @Override + public ResultVO<PreventDangerManage> updateDangerManage(Long userId, PreventDangerManageUpdateReqDTO manageUpdateReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (manageUpdateReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "传参非法"); + } + if (manageUpdateReqDTO.getDangerLevel() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患等级不能为空"); + } + if (manageUpdateReqDTO.getDangerType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患类型不能为空"); + } + if (manageUpdateReqDTO.getDangerSource() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患来源不能为空"); + } + if (manageUpdateReqDTO.getDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患所属部门不能为空"); + } + // 图片 + if (manageUpdateReqDTO.getReportImages() == null || manageUpdateReqDTO.getReportImages().size() < 1) { + throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空"); + } + for (String path : manageUpdateReqDTO.getReportImages()) { + if (StringUtils.isBlank(path)) { + throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空路径"); + } + } + // 图片 + if (manageUpdateReqDTO.getReportImages().size() > 3) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "图片上传不能超过三张"); + } + //校验部门是否存在 +// ResultVO<DepInfoRPCRespDTO> depInfoByDepId = accountDepartmentService.getDepInfoByDepId(userId, manageUpdateReqDTO.getDepId()); + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(manageUpdateReqDTO.getDepId()); + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + if (manageUpdateReqDTO.getRiskUnitId() != null){ + PreventRiskAnaUnit riskUnitById = preventRiskAnaUnitService.getRiskUnitById(manageUpdateReqDTO.getRiskUnitId()); + if(ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确的风险分析单元"); + } + } + if (manageUpdateReqDTO.getProduceDeviceId() != null){ + PreventProduceDevice deviceById = + preventProduceDeviceService.getDeviceById(manageUpdateReqDTO.getProduceDeviceId()); + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写正确的生产装置"); + } + PreventRiskAnaUnit riskUnitById = preventRiskAnaUnitService.getRiskUnitById(manageUpdateReqDTO.getRiskUnitId()); + if (!riskUnitById.getProduceDeviceId().equals(manageUpdateReqDTO.getProduceDeviceId())){ + throw new BusinessException(E.DATA_PARAM_NULL, "请填写生产装置对应的分析单元"); + } + } + if (manageUpdateReqDTO.getRectifyType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改类型不能为空"); + } + if (manageUpdateReqDTO.getLiablePersonId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改责任人不能为空"); + } + if (manageUpdateReqDTO.getRectifyDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改部门不能为空"); + } + //责任人信息 + ResultVO<UserRPCRespDTO> execUserResult = accountAuthService.getUserById(manageUpdateReqDTO.getLiablePersonId()); + UserRPCRespDTO liableUser = (UserRPCRespDTO)execUserResult.getData(); + + Date date = new Date(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装隐患管理参数 + PreventDangerRectify rectifyByManageId = preventDangerRectifyService.getRectifyByManageId(manageUpdateReqDTO.getId()); + PreventDangerManageUpdateParams updateParams = BeanCopyUtils.copyBean(manageUpdateReqDTO, PreventDangerManageUpdateParams.class); + updateParams.setLastEditUserName(userById.getRealName()); + updateParams.setGmtModitify(date); + //封装隐患整改参数 + //PreventDangerRectifyUpdateParams rectifyUpdateParams = new PreventDangerRectifyUpdateParams(); + PreventDangerRectifyUpdateParams rectifyUpdateParams = BeanCopyUtils.copyBean(manageUpdateReqDTO, PreventDangerRectifyUpdateParams.class); + rectifyUpdateParams.setLastEditUserName(userById.getRealName()); + rectifyUpdateParams.setGmtModitify(date); + rectifyUpdateParams.setLiablePerson(liableUser.getRealName()); + rectifyUpdateParams.setId(rectifyByManageId.getId()); + + //设置本条数据上报更新时间 + rectifyUpdateParams.setUpdateReportDataTime(date); + updateParams.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + rectifyUpdateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + updateParams.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + rectifyUpdateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + int rectifyResult = preventDangerRectifyService.updateDangerRectify(rectifyUpdateParams); + if (rectifyResult < 1){ + throw new BusinessException(E.UPDATE_FAIL, "修改隐患整改信息失败"); + } + preventDangerImageService.deleteImageByParentId(manageUpdateReqDTO.getId(), ImageTypeEnum.REPORT); + // 图片 + SnowFlow snowFlow = new SnowFlow(); + List<PreventDangerImage> images = new ArrayList<>(); + PreventDangerImage image; + for (String path : manageUpdateReqDTO.getReportImages()) { + image = new PreventDangerImage(); + image.setId(snowFlow.nextId()); + image.setImagePath(path); + image.setParentId(manageUpdateReqDTO.getId()); + image.setStatus(DataConvertEnum.DELETE_STATUS_USE.getCode()); + image.setType(ImageTypeEnum.REPORT.getCode()); + images.add(image); + } + preventDangerImageService.saveBatch(images); + + + int result = preventDangerManageService.updateDangerManage(updateParams); + if (rectifyResult < 1){ + throw new BusinessException(E.UPDATE_FAIL, "修改管理整改信息失败"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患治理清单-删除 + */ + @Override + public ResultVO<PreventDangerManage> deleteDangerManage(Long userId, PreventDangerManageDeleteReqDTO manageDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventDeleteParams deleteParams = new PreventDeleteParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (manageDeleteReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的删除内容"); + } + PreventDangerRectify rectifyByManageId = preventDangerRectifyService.getRectifyByManageId(manageDeleteReqDTO.getId()); + if (ObjectUtils.isNotEmpty(rectifyByManageId)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "需要先删除对应的隐患整改"); + } + //获取需要填充的信息 + Date date = new Date(); + //封装删除需要的参数 + deleteParams.setId(manageDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(date); + + int result = preventDangerManageService.deleteDangerManage(deleteParams); + + resultVO.setCount(result); + + return resultVO; + } + + //隐患整改清单 + /** + * 隐患整改清单-分页查询 + */ + @Override + public ResultVO<PreventDangerRectify> getDangerRectifyPage(Long userId, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerRectifyQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = rectifyQueryReqDTO.getPageIndex(); + Integer pageSize = rectifyQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //获取到所有符合条件的隐患治理清单信息 + Page pageInfo = new Page<>(pageIndex, pageSize); + pageInfo.setOptimizeCountSql(false); + IPage<PreventDangerRectify> page = + preventDangerRectifyService.getDangerRectifyPage(pageInfo, rectifyQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } +// //遍历结果集,封装数据 +// //List<PreventDangerRectifyQueryRespDTO> respDTO = BeanCopyUtils.copyBeanList(page.getRecords(), PreventDangerRectifyQueryRespDTO.class); +// for (PreventDangerRectify record : page.getRecords()) { +// PreventDangerRectifyQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerRectifyQueryRespDTO.class); +// PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(record.getDangerManagerId()); +// //添加部门名称 +// DepartmentInfo departmentInfo = departmentService.selectSafety(respDTO.getRectifyDepId()); +// respDTO.setRectifyDepName(departmentInfo.getDepartment()); +// respDTO.setDangerStatus(dangerManageById.getDangerStatus()); +// respDTO.setPageIndex((int) page.getCurrent()); +// respDTO.setPageSize((int) page.getSize()); +// respDTO.setDangerManagerId(dangerManageById.getId()); +// respDTO.setReportState(reportConfigById.getReportState()); +// respDTO.setReportType(reportConfigById.getReportType()); +// list.add(respDTO); +// } + //遍历结果集,封装数据 + for (PreventDangerRectify record : page.getRecords()) { + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(record.getDangerManagerId()); + + List<PreventDangerImage> images = preventDangerImageService.listImagesByParentId(record.getDangerManagerId()); + List<PreventDangerManageImageRespDTO> imageRespDTOs = new ArrayList<>(images.size()); + PreventDangerManageImageRespDTO reportImage; + if (images.size() > 0) { + for (PreventDangerImage image : images) { + reportImage = new PreventDangerManageImageRespDTO(); + reportImage.setId(image.getId()); + reportImage.setImagePath(image.getImagePath()); + reportImage.setParentId(image.getParentId()); + reportImage.setType(image.getType()); + imageRespDTOs.add(reportImage); + } + } + + if (rectifyQueryReqDTO.getDangerStatus() != null){ + if(dangerManageById.getDangerStatus().equals(rectifyQueryReqDTO.getDangerStatus())){ + PreventDangerManageTimeout timeoutResult = preventDangerManageTimeoutService.getByRectifyId(record.getId()); + PreventDangerRectifyQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerRectifyQueryRespDTO.class); + //添加部门名称 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(respDTO.getRectifyDepId()); + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + if (ObjectUtils.isNotEmpty(timeoutResult)){ + respDTO.setTimeoutStatus(timeoutResult.getTimeoutStatus()); + } + respDTO.setSerialCode(dangerManageById.getSerialCode()); + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + respDTO.setDangerStatus(dangerManageById.getDangerStatus()); + respDTO.setDangerManagerId(dangerManageById.getId()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setDangerCode(dangerManageById.getDangerCode()); + + List<String> reportList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.REPORT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> rectifyList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.RECTIFY.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> acceptList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.ACCEPT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + respDTO.setReportImages(reportList); + respDTO.setRectifyImages(rectifyList); + respDTO.setAcceptImages(acceptList); + + list.add(respDTO); + respDTO.setPageIndex(list.indexOf(respDTO)); + respDTO.setPageSize(pageSize); + } + }else { + PreventDangerManageTimeout timeoutResult = preventDangerManageTimeoutService.getByRectifyId(record.getId()); + PreventDangerRectifyQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerRectifyQueryRespDTO.class); + //添加部门名称 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(respDTO.getRectifyDepId()); + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + if (ObjectUtils.isNotEmpty(timeoutResult)){ + respDTO.setTimeoutStatus(timeoutResult.getTimeoutStatus()); + } + respDTO.setSerialCode(dangerManageById.getSerialCode()); + if (departmentInfo != null) { + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + } + respDTO.setDangerStatus(dangerManageById.getDangerStatus()); + respDTO.setPageIndex(pageSize); + respDTO.setPageSize((int) page.getCurrent()); + respDTO.setDangerManagerId(dangerManageById.getId()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + + List<String> reportList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.REPORT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> rectifyList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.RECTIFY.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> acceptList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.ACCEPT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + respDTO.setReportImages(reportList); + respDTO.setRectifyImages(rectifyList); + respDTO.setAcceptImages(acceptList); + list.add(respDTO); + resultVO.setCount((int) page.getTotal()); + } + } + + resultVO.setData(list); + resultVO.setCount((int) page.getTotal()); + + return resultVO; + } + + + /** + * 隐患整改清单-查询:待验收与已验收 + */ + @Override + public ResultVO<PreventDangerRectify> getRectifyOverPage(Long userId, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventDangerRectifyQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = rectifyOverQueryReqDTO.getPageIndex(); + Integer pageSize = rectifyOverQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (ObjectUtils.isEmpty(rectifyOverQueryReqDTO.getDangerStatus())){ + rectifyOverQueryReqDTO.setStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + }else { + rectifyOverQueryReqDTO.setStatus(null); + } + + //TODO 后续改为连表查询,现为临时用 + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + Page pageInfo = new Page<>(pageIndex, pageSize); + pageInfo.setOptimizeCountSql(false); + IPage<PreventDangerRectify> page = + preventDangerRectifyService.getDangerRectifyPageToOverRectify(pageInfo, rectifyOverQueryReqDTO); + for (PreventDangerRectify record : page.getRecords()) { + PreventDangerRectifyQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventDangerRectifyQueryRespDTO.class); + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(record.getDangerManagerId()); + PreventDangerManageTimeout timeoutResult = preventDangerManageTimeoutService.getByRectifyId(record.getId()); + //添加部门名称 + ResultVO<DepInfoRPCRespDTO> depInfoByDepId = accountDepartmentService.getDepInfoByDepId(userId, respDTO.getRectifyDepId()); + if (ObjectUtils.isNotEmpty(timeoutResult)){ + respDTO.setTimeoutStatus(timeoutResult.getTimeoutStatus()); + } + //添加部门名称 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(respDTO.getRectifyDepId()); + DepInfoRPCRespDTO data = (DepInfoRPCRespDTO)depInfoByDepId.getData(); + respDTO.setRectifyDepName(departmentInfo.getDepartment()); + respDTO.setSerialCode(dangerManageById.getSerialCode()); + respDTO.setDangerStatus(dangerManageById.getDangerStatus()); + respDTO.setDangerManagerId(record.getDangerManagerId()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + + List<PreventDangerImage> images = preventDangerImageService.listImagesByParentId(record.getDangerManagerId()); + List<PreventDangerManageImageRespDTO> imageRespDTOs = new ArrayList<>(images.size()); + PreventDangerManageImageRespDTO reportImage; + if (images.size() > 0) { + for (PreventDangerImage image : images) { + reportImage = new PreventDangerManageImageRespDTO(); + reportImage.setId(image.getId()); + reportImage.setImagePath(image.getImagePath()); + reportImage.setParentId(image.getParentId()); + reportImage.setType(image.getType()); + imageRespDTOs.add(reportImage); + } + } + List<String> reportList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.REPORT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> rectifyList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.RECTIFY.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + List<String> acceptList = imageRespDTOs.stream().filter(item -> item.getType().equals(ImageTypeEnum.ACCEPT.getCode())).map(PreventDangerManageImageRespDTO::getImagePath).collect(Collectors.toList()); + respDTO.setReportImages(reportList); + respDTO.setRectifyImages(rectifyList); + respDTO.setAcceptImages(acceptList); + + + list.add(respDTO); + } + + resultVO.setData(list); + resultVO.setCount(list.size()); + + return resultVO; + } + + /** + * 隐患整改清单-新增 ---不要了--20220727 + */ + @Override + public ResultVO<PreventDangerRectify> saveDangerRectify(Long userId, PreventDangerRectifySaveReqDTO rectifySaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (rectifySaveReqDTO.getDangerManagerId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患管理单不能为空"); + } + PreventDangerManage dangerManageById = + preventDangerManageService.getDangerManageById(rectifySaveReqDTO.getDangerManagerId()); + if (ObjectUtils.isEmpty(dangerManageById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请填写正确的隐患管理单"); + } + //每个隐患管理单,只能有一个整改清单 TODO + PreventDangerRectify rectifyByCode = + preventDangerRectifyService.getRectifyByCode(dangerManageById.getDangerCode()); + if (ObjectUtils.isNotEmpty(rectifyByCode)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "每个隐患管理单只能有一个整改任务单"); + } + if (rectifySaveReqDTO.getRectifyTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改期限不能为空"); + } + + if (rectifySaveReqDTO.getLiablePersonId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改责任人不能为空"); + } + //获取责任人信息 + ResultVO<UserRPCRespDTO> liablePersonResult = accountAuthService.getUserById(rectifySaveReqDTO.getLiablePersonId()); + UserRPCRespDTO liablePerson = (UserRPCRespDTO)liablePersonResult.getData(); + if (ObjectUtils.isEmpty(liablePerson)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请正确填写整改责任人"); + } + if (rectifySaveReqDTO.getRectifyDesc() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改内容说明"); + } + if (rectifySaveReqDTO.getRectifyTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改类型不能为空"); + } + + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long rectifyId = snowFlow.nextId(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装参数 + PreventDangerRectify dangerRectify = BeanCopyUtils.copyBean(rectifySaveReqDTO, PreventDangerRectify.class); + dangerRectify.setId(rectifyId); + dangerRectify.setUuid(uuid); + dangerRectify.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + + dangerRectify.setGmtCreate(date); + dangerRectify.setCreateByUserName(userById.getRealName()); + dangerRectify.setGmtModitify(date); + dangerRectify.setLastEditUserName(userById.getRealName()); + dangerRectify.setEnterpriseId((long) 1); + dangerRectify.setEnterpriseUuid("1564wq"); + dangerRectify.setCheckAcceptPerson(userById.getRealName()); + dangerRectify.setCheckAcceptPersonId(null); + dangerRectify.setRectifyDepId(null); + + dangerRectify.setDangerManagerUuid(dangerManageById.getUuid()); + dangerRectify.setDangerManagerId(rectifySaveReqDTO.getDangerManagerId()); + dangerRectify.setDangerCode(dangerManageById.getDangerCode()); + dangerRectify.setLiablePerson(liablePerson.getRealName()); + + //设置上报时间为空 + dangerRectify.setReportTime(null); + //设置本条数据上报更新时间 + dangerRectify.setUpdateReportDataTime(new Date()); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + //本模块是否上报,通过DangerManager表的配置进行管理 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + dangerRectify.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + dangerRectify.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + } + //不确定是否需要的字段 + dangerRectify.setCheckAcceptTime(null); + dangerRectify.setCheckAcceptDesc(null); + + int result = preventDangerRectifyService.saveDangerRectify(dangerRectify); + + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患整改--延期 + */ + @Override + public ResultVO<PreventDangerRectify> timeOutRectify(Long userId, PreventDangerRectifyUpdateReqDTO updateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("整改已延期"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (updateReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "传参非法"); + } + if (updateReqDTO.getDangerManagerId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患管理单不能为空"); + } + if (updateReqDTO.getRectifyTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "延期的时间不能为空"); + } + if (updateReqDTO.getTimeOutDesc() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "延期说明不能为空"); + } + PreventDangerRectify rectify = preventDangerRectifyService.getRectifyById(updateReqDTO.getId()); + if (updateReqDTO.getRectifyTime().getTime() - rectify.getRectifyTime().getTime() <= 0){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "延期时间必须大于整改期限"); + } + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(rectify.getDangerManagerId()); + if (ObjectUtils.isEmpty(dangerManageById)){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参错误"); + } + if (dangerManageById.getDangerStatus() == StatusEnum.DANGER_MANAGER_NOT_ACCEPT.getCode()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "超期未整改任务无法延期"); + } + + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装修改参数 + PreventDangerRectifyUpdateParams updateParams = new PreventDangerRectifyUpdateParams(); + updateParams.setId(updateReqDTO.getId()); + updateParams.setRectifyTime(updateReqDTO.getRectifyTime()); + updateParams.setLastEditUserName(userById.getRealName()); + updateParams.setGmtModitify(new Date()); + updateParams.setTimeOutDesc(updateReqDTO.getTimeOutDesc()); + + //设置本条数据上报更新时间 ,上报开关依赖于dangerManager + updateParams.setUpdateReportDataTime(new Date()); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + } + //整改单延期成功 + int resultRectify = preventDangerRectifyService.updateRectifyTime(updateParams); + if (resultRectify < 1){ + throw new BusinessException(E.UPDATE_FAIL, "延期操作失败"); + } + //管理单变更状态成功 + //封装修改参数 + UpdateRectifyResultParams updateRectifyParams = new UpdateRectifyResultParams(); + updateRectifyParams.setDangerStatus(StatusEnum.DANGER_MANAGER_TIMEOUT_RECTIFY.getCode()); + updateRectifyParams.setDangerManagerId(updateReqDTO.getDangerManagerId()); + updateRectifyParams.setUpdateReportDataTime(new Date()); + + int resultManager = preventDangerManageService.updateRectifyResult(updateRectifyParams); + if (resultManager < 1){ + throw new BusinessException(E.UPDATE_FAIL, "隐患管理状态变更失败"); + } + + return resultVO; + } + + /** + * 隐患整改清单-修改 + */ + @Override + public ResultVO<PreventDangerRectify> updateDangerRectify(Long userId, PreventDangerRectifyUpdateReqDTO rectifyUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + + if (rectifyUpdateReqDTO.getDangerManagerId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "参数非法"); + } + PreventDangerManage dangerManageById = + preventDangerManageService.getDangerManageById(rectifyUpdateReqDTO.getDangerManagerId()); + if (ObjectUtils.isEmpty(dangerManageById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请填写正确的隐患管理单"); + } + if (rectifyUpdateReqDTO.getRectifyTime() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改期限不能为空"); + } + if (rectifyUpdateReqDTO.getLiablePersonId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改责任人不能为空"); + } + //获取责任人信息 + ResultVO<UserRPCRespDTO> liablePersonResult = accountAuthService.getUserById(rectifyUpdateReqDTO.getLiablePersonId()); + UserRPCRespDTO liablePerson = (UserRPCRespDTO)liablePersonResult.getData(); + if (ObjectUtils.isEmpty(liablePerson)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请正确填写整改责任人"); + } + if (rectifyUpdateReqDTO.getRectifyDesc() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改内容说明不能为空"); + } + if (rectifyUpdateReqDTO.getRectifyType() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改类型不能为空"); + } + if (rectifyUpdateReqDTO.getCost() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改资金不能为空"); + } + + //获取需要填充的信息 + Date date = new Date(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装参数 + PreventDangerRectifyUpdateParams updateParams + = BeanCopyUtils.copyBean(rectifyUpdateReqDTO, PreventDangerRectifyUpdateParams.class); + + updateParams.setGmtModitify(date); + updateParams.setLastEditUserName(userById.getRealName()); + updateParams.setDangerManagerUuid(dangerManageById.getUuid()); + updateParams.setLiablePerson(liablePerson.getRealName()); + + //设置本条数据上报更新时间 ,上报开关依赖于dangerManager + updateParams.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + } + + int result = preventDangerRectifyService.updateDangerRectify(updateParams); + + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患整改清单-验收情况填报-整改 + */ + @Override + public ResultVO<PreventDangerRectify> applyReport(Long userId, PreventDangerReportRectifyReqDTO reportRectify) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("填报成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (reportRectify.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "参数为空"); + } + if (reportRectify.getRectifyImages() == null || reportRectify.getRectifyImages().size() < 1){ + throw new BusinessException(E.DATA_PARAM_NULL, "上传图片为空"); + } + // 图片 + if (reportRectify.getRectifyImages().size() > 3) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "图片上传不能超过三张"); + } + for (String path : reportRectify.getRectifyImages()) { + if (StringUtils.isBlank(path)) { + throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空路径"); + } + } + //获取验收责任人信息 +// ResultVO<UserRPCRespDTO> checkAcceptPersonResult = accountAuthService.getUserById(reportRectify.getCheckAcceptPersonId()); +// UserRPCRespDTO checkAcceptPerson = (UserRPCRespDTO)checkAcceptPersonResult.getData(); + + PreventDangerRectify rectifyById = preventDangerRectifyService.getRectifyById(reportRectify.getId()); + + if (!userId.equals(rectifyById.getLiablePersonId())){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "非整改责任人,无法操作"); + } + + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(reportRectify.getDangerManagerId()); + + if (dangerManageById.getDangerStatus().equals(StatusEnum.DANGER_MANAGER_NOT_ACCEPT.getCode()) + || dangerManageById.getDangerStatus().equals(StatusEnum.DANGER_MANAGER_WAIT_ACCEPT.getCode()) + || dangerManageById.getDangerStatus().equals(StatusEnum.DANGER_MANAGER_ACCEPT.getCode())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "该整改单不是整改中状态,只有在整改的单据才可以申请验收"); + } + if (reportRectify.getRectifyInfo() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "整改说明不能为空"); + } + + if (dangerManageById.getDangerReview() == StatusEnum.DANGER_RECTIFY_REVIEW.getCode()){ + throw new BusinessException(E.DATA_PARAM_NULL, "隐患已关闭,无法处理"); + } + + + + //获取需要填充的信息 + Date date = new Date(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装参数 + PreventDangerReportRectifyUpdayeParams reportParams + = BeanCopyUtils.copyBean(reportRectify, PreventDangerReportRectifyUpdayeParams.class); + + reportParams.setGmtModitify(date); + reportParams.setLastEditUserName(userById.getRealName()); + reportParams.setApplyTime(reportRectify.getApplyTime()); + reportParams.setRectifyInfo(reportRectify.getRectifyInfo()); + + //设置本条数据上报更新时间 ,上报开关依赖于dangerManager + reportParams.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + reportParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + reportParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + } + //提交数据 + int result = preventDangerRectifyService.applyReport(reportParams); + + if (result < 1) { + throw new BusinessException(E.UPDATE_FAIL, "提交验收失败"); + } + //封装修改参数 + UpdateRectifyResultParams updateParams = new UpdateRectifyResultParams(); + updateParams.setDangerStatus(StatusEnum.DANGER_MANAGER_WAIT_ACCEPT.getCode()); + updateParams.setDangerManagerId(reportRectify.getDangerManagerId()); + updateParams.setUpdateReportDataTime(date); + //设置为待验收 + int manageResult = preventDangerManageService.updateRectifyResult(updateParams); + if (manageResult < 1) { + throw new BusinessException(E.UPDATE_FAIL, "状态变更失败"); + } + // 图片 + List<PreventDangerImage> images = new ArrayList<>(); + PreventDangerImage image; + SnowFlow snowFlow = new SnowFlow(); + for (String path : reportRectify.getRectifyImages()) { + image = new PreventDangerImage(); + image.setId(snowFlow.nextId()); + image.setImagePath(path); + image.setParentId(reportRectify.getDangerManagerId()); + image.setStatus(DataConvertEnum.DELETE_STATUS_USE.getCode()); + image.setType(ImageTypeEnum.RECTIFY.getCode()); + images.add(image); + } + preventDangerImageService.saveBatch(images); + + + resultVO.setCount(result); + return resultVO; + } + /** + * 隐患管理-关闭隐患单 + */ + @Transactional + @Override + public ResultVO<PreventRiskAnaUnit> closeDanger(Long userId, PreventCloseDangerReqDTO closeDangerReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("关闭成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //TODO 只有没有处理过的隐患,才能关闭 + //封装参数 + CloseDangerParams closeDangerParams = BeanCopyUtils.copyBean(closeDangerReqDTO, CloseDangerParams.class); + + closeDangerParams.setDangerReview(StatusEnum.DANGER_RECTIFY_REVIEW.getCode()); + closeDangerParams.setGmtModitify(new Date()); + closeDangerParams.setLastEditUserName(userById.getRealName()); + closeDangerParams.setUpdateReportDataTime(new Date()); + + int resultManage = preventDangerManageService.closeDanger(closeDangerParams); + if (resultManage < 1){ + throw new BusinessException(E.UPDATE_FAIL, "关闭隐患管理信息失败"); + } + //当做删除-进行同步 + int resultRectify = preventDangerRectifyService.closeDanger(closeDangerParams); + if (resultRectify < 1){ + throw new BusinessException(E.UPDATE_FAIL, "关闭隐患整改信息失败"); + } + + resultVO.setCount(resultManage); + + return resultVO; + } + + /** + * 隐患整改清单--验收 + */ + @Override + public ResultVO<PreventDangerRectify> reportRectify(Long userId, PreventDangerReportRectifyReqDTO reportRectify) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("验收成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (reportRectify.getId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "参数为空"); + } + if (reportRectify.getDangerManagerId() == null ){ + throw new BusinessException(E.DATA_PARAM_NULL, "参数为空"); + } + if (reportRectify.getCheckAcceptDesc() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "验收意见不能为空"); + } + PreventDangerRectify rectifyById = preventDangerRectifyService.getRectifyById(reportRectify.getId()); + if(!rectifyById.getCheckAcceptPersonId().equals(userId)){ + throw new BusinessException(E.DATA_PARAM_NULL, "非验收人,无权操作"); + } +// if (reportRectify.getAcceptImages() == null || reportRectify.getAcceptImages().size() < 1) { +// throw new BusinessException(E.DATA_PARAM_NULL, "上传图片为空"); +// } + // 图片 +// if (reportRectify.getAcceptImages().size() > 3) { +// throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "图片上传不能超过三张"); +// } +// for (String path : reportRectify.getAcceptImages()) { +// if (StringUtils.isBlank(path)) { +// throw new BusinessException(E.DATA_PARAM_NULL, "图片上传不能为空路径"); +// } +// } + PreventDangerManage dangerManageById = preventDangerManageService.getDangerManageById(reportRectify.getDangerManagerId()); + if (dangerManageById.getDangerStatus() != StatusEnum.DANGER_MANAGER_WAIT_ACCEPT.getCode()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "该整改单不是待验收状态,只有待验收的单据才可以同意验收"); + } + + //获取需要填充的信息 + Date date = new Date(); + //读取上报主配置 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode()); + //封装参数 + PreventDangerReportRectifyUpdayeParams reportParams = new PreventDangerReportRectifyUpdayeParams(); + + reportParams.setId(reportRectify.getId()); + reportParams.setGmtModitify(date); + reportParams.setLastEditUserName(userById.getRealName()); + reportParams.setCheckAcceptTime(date); + reportParams.setCheckAcceptDesc(reportRectify.getCheckAcceptDesc()); + reportParams.setUpdateReportDataTime(date); + + //设置本条数据上报更新时间 ,上报开关依赖于dangerManager + reportParams.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + reportParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + reportParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + } + + int result = preventDangerRectifyService.reportRectify(reportParams); + if (result < 1) { + throw new BusinessException(E.UPDATE_FAIL, "验收信息提交失败"); + } + //封装修改参数 + UpdateRectifyResultParams updateParams = new UpdateRectifyResultParams(); + updateParams.setDangerStatus(StatusEnum.DANGER_MANAGER_ACCEPT.getCode()); + updateParams.setDangerManagerId(reportRectify.getDangerManagerId()); + updateParams.setUpdateReportDataTime(date); + //设置为待验收 + int RectifyResult= preventDangerManageService.updateRectifyResult(updateParams); + if (result < 1) { + throw new BusinessException(E.UPDATE_FAIL, "验收状态变更失败"); + } + // 图片 +// List<PreventDangerImage> images = new ArrayList<>(); +// PreventDangerImage image; +// SnowFlow snowFlow = new SnowFlow(); +// for (String path : reportRectify.getAcceptImages()) { +// image = new PreventDangerImage(); +// image.setId(snowFlow.nextId()); +// image.setImagePath(path); +// image.setParentId(reportRectify.getDangerManagerId()); +// image.setStatus(DataConvertEnum.DELETE_STATUS_USE.getCode()); +// image.setType(ImageTypeEnum.ACCEPT.getCode()); +// images.add(image); +// } +// preventDangerImageService.saveBatch(images); + resultVO.setCount(result); + return resultVO; + } + + /** + * 隐患整改清单-删除 + */ + @Override + public ResultVO<PreventDangerRectify> deleteDangerRectify(Long userId, PreventDangerRectifyDeleteReqDTO rectifyDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventDeleteParams deleteParams = new PreventDeleteParams(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数 + if (rectifyDeleteReqDTO.getId() == null ){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请选择正确的删除内容"); + } + //获取需要填充的信息 + Date date = new Date(); + //封装删除需要的参数 + deleteParams.setId(rectifyDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(date); + + int result = preventDangerRectifyService.deleteDangerRectify(deleteParams); + + resultVO.setCount(result); + return resultVO; + } + + + @Override + public ResultVO countDangerByDate(LocalDate date) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode(ResultCodes.OK.getCode()); + LocalDateTime startTime = LocalDateTime.of(date, LocalTime.of(0,0,0)); + LocalDateTime endTime = LocalDateTime.of(date, LocalTime.of(23,59,59)); + Date start = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()); + resultVO.setData(preventDangerManageService.countByCreateTime(start,end)); + return resultVO; + } + + @Override + public ResultVO<PreventDangerManageQueryRespDTO> findByDangerSerialCode(String serialCode) { + ResultVO<PreventDangerManageQueryRespDTO> resultVO = new ResultVO<>(); + resultVO.setCode(ResultCodes.OK.getCode()); + PreventDangerManage dangerManage = preventDangerManageService.findByDangerSerialCode(serialCode); + if(dangerManage != null){ + PreventDangerManageQueryRespDTO respDTO = new PreventDangerManageQueryRespDTO(); + BeanUtils.copyProperties(dangerManage,respDTO); + resultVO.setData(respDTO); + } + return resultVO; + } + + @Override + public SearchResultVO<List<PreventDangerCheckTaskRectifyRespDTO>> listOwnRectifyPage(ContextCacheUser currentUser, PageQuery<OwnRectifyPageQuery> pageQuery) { + + OwnRectifyPageDBQuery dbQuery = new OwnRectifyPageDBQuery(); + dbQuery.setCurrentUid(currentUser.getUid()); + Page<PreventDangerCheckTaskRectifyDO> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<PreventDangerCheckTaskRectifyDO> dbData = preventDangerManageService.listOwnRectifyPage(page, dbQuery); + List<PreventDangerCheckTaskRectifyRespDTO> result = new ArrayList<>(dbData.size()); + if (dbData.size() > 0) { + for (PreventDangerCheckTaskRectifyDO rectifyDO : dbData) { + PreventDangerCheckTaskRectifyRespDTO respDTO = new PreventDangerCheckTaskRectifyRespDTO(); + + respDTO.setManageId(rectifyDO.getManageId()); + respDTO.setManageUuid(rectifyDO.getManageUuid()); + respDTO.setRegisterTime(rectifyDO.getRegisterTime()); + respDTO.setDangerLevel(rectifyDO.getDangerLevel()); + respDTO.setDangerType(rectifyDO.getDangerType()); + respDTO.setDangerSource(rectifyDO.getDangerSource()); + respDTO.setDangerStatus(rectifyDO.getDangerStatus()); + respDTO.setRegistantId(rectifyDO.getRegistantId()); + respDTO.setProduceDeviceId(rectifyDO.getProduceDeviceId()); + respDTO.setDangerCode(rectifyDO.getDangerCode()); + respDTO.setRegistantName(rectifyDO.getRegistantName()); + respDTO.setDangerDesc(rectifyDO.getDangerDesc()); + respDTO.setDangerReason(rectifyDO.getDangerReason()); + respDTO.setDangerResult(rectifyDO.getDangerResult()); + respDTO.setDepId(rectifyDO.getDepId()); + respDTO.setRiskUnitId(rectifyDO.getRiskUnitId()); + respDTO.setDangerReview(rectifyDO.getDangerReview()); + respDTO.setDangerCloseReason(rectifyDO.getDangerCloseReason()); + respDTO.setRectifyId(rectifyDO.getRectifyId()); + respDTO.setRectifyType(rectifyDO.getRectifyType()); + respDTO.setRectifyTime(rectifyDO.getRectifyTime()); + respDTO.setLiablePersonId(rectifyDO.getLiablePersonId()); + respDTO.setCheckAcceptTime(rectifyDO.getCheckAcceptTime()); + respDTO.setCheckAcceptPersonId(rectifyDO.getCheckAcceptPersonId()); + respDTO.setLiablePerson(rectifyDO.getLiablePerson()); + respDTO.setCheckAcceptPerson(rectifyDO.getCheckAcceptPerson()); + respDTO.setRectifyDepId(rectifyDO.getRectifyDepId()); + respDTO.setRectifyDesc(rectifyDO.getRectifyDesc()); + respDTO.setCost(rectifyDO.getCost()); + respDTO.setRectifyApplyTime(rectifyDO.getRectifyApplyTime()); + respDTO.setTimeOutDesc(rectifyDO.getTimeOutDesc()); + respDTO.setRectifyInfo(rectifyDO.getRectifyInfo()); + result.add(respDTO); + } + } + + return new SearchResultVO<>( + true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + result, ResultCodes.OK); + } + + /** + * 生成隐患编码 + * @param time + * @param existCount + * @return + */ + private String generateDangerSerialCode(Date time,int existCount){ + LocalDateTime t = time.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + LocalDate d = t.toLocalDate(); + StringBuilder stringBuilder = new StringBuilder(""); + stringBuilder.append(d.getYear()); + int mon = d.getMonthValue(); + if(mon < 10){ + stringBuilder.append("0"); + stringBuilder.append(mon); + }else { + stringBuilder.append(mon); + } + stringBuilder.append(d.getDayOfMonth()); + stringBuilder.append('-'); + int nowSerial = 0; + if(existCount > 0) + nowSerial = existCount + 1; + else + nowSerial = 1; + if(nowSerial < 10000){ + if(nowSerial<10){ + stringBuilder.append("000"); + }else if(nowSerial>=10 && nowSerial<100){ + stringBuilder.append("00"); + }else if(nowSerial>=100 && nowSerial<1000){ + stringBuilder.append("0"); + } + stringBuilder.append(nowSerial); + }else { + stringBuilder.append(nowSerial); + } + return stringBuilder.toString(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/ReportServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/ReportServiceImpl.java new file mode 100644 index 0000000..498b9b0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/ReportServiceImpl.java @@ -0,0 +1,476 @@ +package com.gk.hotwork.doublePrevention.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.doublePrevention.utils.BeanCopyUtils; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.report.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.report.resp.*; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigLogQueryReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.PreventReportConfigUpdateReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventReportConfigLogQueryRespDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventReportConfigQueryRespDTO; +import com.gk.hotwork.doublePrevention.repository.param.PreventReportConfigUpdateParams; +import com.gk.hotwork.doublePrevention.service.ReportService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import org.apache.commons.lang3.ObjectUtils; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class ReportServiceImpl implements ReportService { + + @Autowired + private AccountAuthService accountAuthService; + + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private PreventReportConfigLogService preventReportConfigLogService; + @Autowired + private PreventReportRiskAnaUnitService riskAnaUnitService; + @Autowired + private PreventReportRiskEventService eventService; + @Autowired + private PreventReportRiskControlMeasureService measureService; + @Autowired + private PreventReportCheckTaskFromWorkService taskFromWorkService; + @Autowired + private PreventReportCheckRecordFromTaskService taskService; + @Autowired + private PreventReportDangerInfoService dangerInfoService; + + /** + * 数据上报配置-查询 + */ + @Override + public ResultVO<PreventReportConfig> getReportConfig(Long userId) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //查询配置 + List<PreventReportConfig> configList= preventReportConfigService.ListReportConfigs(); + //封装DTO + List<PreventReportConfigQueryRespDTO> respDTO = BeanCopyUtils.copyBeanList(configList, PreventReportConfigQueryRespDTO.class); + //封装返回数据 + resultVO.setCount(respDTO.size()); + resultVO.setData(respDTO); + + return resultVO; + } + + /** + * 数据上报配置-修改 + */ + @Transactional + @Override + public ResultVO<PreventReportConfig> updateReportConfig(Long userId, PreventReportConfigUpdateReqDTO updateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //封装修改参数 + PreventReportConfigUpdateParams updateParams = BeanCopyUtils.copyBean(updateReqDTO, PreventReportConfigUpdateParams.class); + updateParams.setGmtModitify(new Date()); + updateParams.setLastEditUserName(userById.getRealName()); + //按照id查询配置,并保存历史记录 + String updateInfo = null; + if (step ==1){ + PreventReportConfig oldReportConfigById = preventReportConfigService.getReportConfigById(updateReqDTO.getId()); + if (oldReportConfigById.getReportState().equals(updateReqDTO.getReportState()) + && oldReportConfigById.getReportType().equals(updateReqDTO.getReportType()) ){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同,无需修改"); + } + //取出数据,存入log表 + PreventReportConfigLog preventReportConfigLog = new PreventReportConfigLog(); + //封装log表参数 + preventReportConfigLog.setReportState(oldReportConfigById.getReportState()); + preventReportConfigLog.setReportType(oldReportConfigById.getReportType()); + preventReportConfigLog.setReportData(oldReportConfigById.getReportData()); + preventReportConfigLog.setReportDataName(oldReportConfigById.getReportDataName()); + preventReportConfigLog.setLastEditUserName(oldReportConfigById.getLastEditUserName()); + preventReportConfigLog.setGmtModitify(oldReportConfigById.getGmtModitify()); + //插入数据进log表 + int i = preventReportConfigLogService.insertOldReportConfig(preventReportConfigLog); + if (i < 1){ + throw new BusinessException(E.UPDATE_FAIL, "历史记录保存失败"); + } + step = 2; + } + //修改配置信息 + if (step == 2){ + int result = preventReportConfigService.updateReportConfig(updateParams); + if (result < 1){ + throw new BusinessException(E.UPDATE_FAIL, "修改配置失败"); + } + resultVO.setCount(result); + } + + return resultVO; + } + + /** + * 数据上报配置历史记录-查询 + */ + @Override + public ResultVO<PreventReportConfigLog> getReportConfigLogPage(Long userId, PreventReportConfigLogQueryReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + + //获取到所有符合条件任务 + IPage<PreventReportConfigLog> page = + preventReportConfigLogService.getReportConfigLogPage(new Page<>(queryReqDTO.getPageIndex(), queryReqDTO.getPageSize()), queryReqDTO); + //获取返回前端对象集合,封装DTO数据 + List<PreventReportConfigLogQueryRespDTO> list = new ArrayList<>(); + for (PreventReportConfigLog record : page.getRecords()) { + PreventReportConfigLogQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventReportConfigLogQueryRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + + /** + * 上报数据-风险分析单元-分页查询 + */ + @Override + public ResultVO<PreventReportRiskAnaUnit> getReportRiskUnitPage(ContextCacheUser currentUser, PreReportRiskUnitQueryReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreReportRiskUnitQueryRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportRiskAnaUnit> page = riskAnaUnitService.getReportRiskUnitPage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportRiskAnaUnit record : page.getRecords()) { + PreReportRiskUnitQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreReportRiskUnitQueryRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } + + /** + * 上报数据-事件-分页查询 + */ + @Override + public ResultVO<PreventReportRiskEvent> getReportEventPage(ContextCacheUser currentUser, PreReportRiskEventQueryReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreReportRiskEventQueryRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportRiskEvent> page = eventService.getReportRiskEventPage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportRiskEvent record : page.getRecords()) { + PreReportRiskEventQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreReportRiskEventQueryRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } + + /** + * 上报数据-管控措施-分页查询 + */ + @Override + public ResultVO<PreventReportRiskControlMeasure> getReportMeasurePage(ContextCacheUser currentUser, PreventReportRiskControlMeasureReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventReportRiskControlMeasureRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportRiskControlMeasure> page = measureService.getReportMeasurePage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportRiskControlMeasure record : page.getRecords()) { + PreventReportRiskControlMeasureRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventReportRiskControlMeasureRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } + + /** + * 上报数据-任务配置-分页查询 + */ + @Override + public ResultVO<PreventReportCheckTaskFromWork> getReportTaskFromWorkPage(ContextCacheUser currentUser, PreventReportCheckTaskFromWorkReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventReportCheckTaskFromWorkRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportCheckTaskFromWork> page = taskFromWorkService.getReportTaskFromWorkPage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportCheckTaskFromWork record : page.getRecords()) { + PreventReportCheckTaskFromWorkRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventReportCheckTaskFromWorkRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } + + /** + * 上报数据-任务记录-分页查询 + */ + @Override + public ResultVO<PreventReportCheckRecordFromTask> getRecordFromTaskPage(ContextCacheUser currentUser, PreventReportCheckRecordFromTaskReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventReportCheckRecordFromTaskRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportCheckRecordFromTask> page = taskService.getReportTaskFromWorkPage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportCheckRecordFromTask record : page.getRecords()) { + PreventReportCheckRecordFromTaskRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventReportCheckRecordFromTaskRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } + + /** + * 上报数据-隐患信息-分页查询 + */ + @Override + public ResultVO<PreventReportDangerInfo> getReportDangerInfoPage(ContextCacheUser currentUser, PreventReportDangerInfoReqDTO queryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + Integer pageIndex = queryReqDTO.getPageIndex(); + Integer pageSize = queryReqDTO.getPageSize(); + int step = 1; + //获取用户信息,校验 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventReportDangerInfoRespDTO> list = new ArrayList<>(); + //分页查询 + IPage<PreventReportDangerInfo> page = dangerInfoService.getReportDangerInfoPage(new Page<>(pageIndex, pageSize), queryReqDTO); + for (PreventReportDangerInfo record : page.getRecords()) { + PreventReportDangerInfoRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventReportDangerInfoRespDTO.class); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + return resultVO; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RiskServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RiskServiceImpl.java new file mode 100644 index 0000000..1c9af36 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/RiskServiceImpl.java @@ -0,0 +1,2184 @@ +package com.gk.hotwork.doublePrevention.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.DepartmentInfo; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.dto.UserRPCRespDTO; +import com.gk.hotwork.Service.DepartmentService; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.doublePrevention.entity.dto.PreventRiskControlMeasureListDO; +import com.gk.hotwork.doublePrevention.utils.BeanCopyUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.entity.*; +import com.gk.hotwork.doublePrevention.entity.dto.req.*; +import com.gk.hotwork.doublePrevention.entity.dto.resp.*; +import com.gk.hotwork.doublePrevention.enums.DeviceStatusEnum; +import com.gk.hotwork.doublePrevention.enums.StatusEnum; +import com.gk.hotwork.doublePrevention.enums.SyncEnum; +import com.gk.hotwork.doublePrevention.repository.param.*; +import com.gk.hotwork.doublePrevention.service.RiskService; +import com.gk.hotwork.doublePrevention.service.baseService.*; +import com.gk.hotwork.doublePrevention.utils.SnowFlow; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.ObjectUtils; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.util.*; + +@Service +public class RiskServiceImpl implements RiskService { + + @Autowired + private AccountAuthService accountAuthService; + + @Autowired + private AccountDepartmentService accountDepartmentService; + + @Autowired + private PreventProduceDeviceService preventProduceDeviceService; + @Autowired + private PreventRiskMapService preventRiskMapService; + @Autowired + private PreventRiskAnaUnitService preventRiskUnitService; + @Autowired + private PreventRiskEventService preventRiskEventService; + @Autowired + private PreventRiskControlMeasureService preventRiskControlMeasureService; + @Autowired + private PreventDangerCheckContentService preventDangerCheckContentService; + @Autowired + private PreventRiskControlTemplateService preventRiskControlTemplateService; + @Autowired + private PreventReportConfigService preventReportConfigService; + @Autowired + private DepartmentService departmentService; + @Autowired + private PreventTaskUnitAndMeasureService preventTaskUnitAndMeasureService; + @Autowired + private PreventDangerCheckTaskUnitService preventDangerCheckTaskUnitService; + + + //生产装置 + /** + * 生产装置-分页查询 + * */ + @Override + public ResultVO<PreventProduceDevice> getDevicePage(PreventProduceDeviceQueryReqDTO deviceReqDto) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + List<PreventProduceDeviceQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = deviceReqDto.getPageIndex(); + Integer pageSize = deviceReqDto.getPageSize(); + //封装查询参数 + PreventProduceDeviceQueryParams queryParams = new PreventProduceDeviceQueryParams(); + if (ObjectUtils.isEmpty(deviceReqDto)){ + throw new BusinessException(E.DATA_PARAM_NULL, "数据传参为空"); + } + if (deviceReqDto.getRiskLevel() != null ){ + queryParams.setRiskLevel(deviceReqDto.getRiskLevel()); + } + if (deviceReqDto.getStatus() != null ){ + queryParams.setStatus(deviceReqDto.getStatus()); + } + if (deviceReqDto.getDepId() != null ){ + queryParams.setDepId(deviceReqDto.getDepId()); + } + if (deviceReqDto.getProduceDeviceName() != null && deviceReqDto.getProduceDeviceName() != ""){ + queryParams.setProduceDeviceName(deviceReqDto.getProduceDeviceName()); + }else if( deviceReqDto.getProduceDeviceName() != "") { + queryParams.setProduceDeviceName(null); + } + + //分页查询,获取到所有符合条件的数据 + IPage<PreventProduceDevice> page = + preventProduceDeviceService.getDevicePage(new Page<>(pageIndex, pageSize), queryParams); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + for (PreventProduceDevice record : page.getRecords()) { + PreventProduceDeviceQueryRespDTO respDto = BeanCopyUtils.copyBean(record, PreventProduceDeviceQueryRespDTO.class); + //校验部门是否存在 + respDto.setPageIndex((int) page.getCurrent()); + respDto.setPageSize((int) page.getSize()); + list.add(respDto); + } + resultVO.setCount((int) page.getTotal()); + + resultVO.setMsg("查询成功"); + resultVO.setData(list); + + return resultVO; + } + + /** + * 生产装置- 查询生产装置列表 + */ + @Override + public ResultVO<PreventProduceDevice> getListDevices(Long valueOf) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventProduceDevice> listDevices = preventProduceDeviceService.getListDevices(); + if (ObjectUtils.isEmpty(listDevices)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + List<PreventProduceDeviceListsQueryRespDTO> respDTOS = + BeanCopyUtils.copyBeanList(listDevices, PreventProduceDeviceListsQueryRespDTO.class); + + resultVO.setData(respDTOS); + + return resultVO; + } + + /** + * 生产装置-根绝风险等级查询 + * */ + @Override + public ResultVO<PreventProduceDevice> getByLevel(PreventProduceDeviceQueryReqDTO deviceReqDto) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + PreventProduceDevice byLevel = preventProduceDeviceService.getByLevel(deviceReqDto.getRiskLevel()); + resultVO.setData(byLevel); + return resultVO; + } + /** + * 生产装置-新增 + * */ + @Override + public ResultVO<PreventProduceDevice> saveDevice(Long userId, PreventProduceDeviceSaveReqDTO deviceSaveReqDto) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("添加成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + //参数校验 + if (ObjectUtils.isEmpty(userById.getRealName())){ + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + if (ObjectUtils.isEmpty(deviceSaveReqDto)){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (deviceSaveReqDto.getProduceDeviceName() == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"生产装置名称不能为空"); + } + //查找是否存在同名设备 + PreventProduceDevice deviceByName = preventProduceDeviceService.getDeviceByName(deviceSaveReqDto.getProduceDeviceName()); + if(!ObjectUtils.isEmpty(deviceByName)){ + throw new BusinessException(E.DATA_DATABASE_DUPLICATED, "生产装置已存在,请检查装置名称是否正确,或为装置名称添加编号"); + } + if (deviceSaveReqDto.getLocation() == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"生产装置所在位置不能为空"); + } + if (deviceSaveReqDto.getRiskLevel() == null){ + throw new RuntimeException("生产装置风险等级不能为空"); + } + if (deviceSaveReqDto.getDepId() == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"生产装置责任部门不能为空"); + } + //校验部门是否存在 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(deviceSaveReqDto.getDepId()); + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + + //获取填充信息 + Date date = new Date(); + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + //封装参数 + PreventProduceDevice device = BeanCopyUtils.copyBean(deviceSaveReqDto, PreventProduceDevice.class); + device.setId( snowFlow.nextId()); + device.setUuid(uuid); + device.setStatus(DeviceStatusEnum.DEVICE_USE.getCode()); + device.setEnterpriseId((long) 1); + device.setEnterpriseUuid("111"); + + device.setDepId(deviceSaveReqDto.getDepId()); + device.setDepName(departmentInfo.getDepartment()); + device.setDepUuid(null); + device.setCreateByUserName(userById.getRealName()); + device.setGmtCreate(date); + device.setLastEditUserName(userById.getRealName()); + device.setGmtModitify(date); + device.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + //执行插入 + int result = preventProduceDeviceService.saveDevice(device); + + resultVO.setCount(result); + + return resultVO; + } + /** + * 生产装置-删除 + * @param deviceDeleteReqDTO + * @return 查询结果 + */ + @Override + public ResultVO<PreventProduceDevice> deleteOne(Long userId, PreventProduceDeviceDeleteReqDTO deviceDeleteReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + PreventProduceDeviceDeleteParams param = new PreventProduceDeviceDeleteParams(); + Date date = new Date(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + if (ObjectUtils.isEmpty(deviceDeleteReqDTO)){ + throw new RuntimeException("请检查是否正确选择删除项"); + } + PreventProduceDevice device = preventProduceDeviceService.getDeviceById(deviceDeleteReqDTO.getId()); + if (ObjectUtils.isEmpty(device)){ + throw new RuntimeException("请检查该项是否已经被删除"); + } + //检查生产装置的分析单元是否存在 + List<PreventRiskAnaUnit> unitList = preventRiskUnitService.getRiskUnitByDeviceId(device.getId()); + if (unitList.size() > 0){ + throw new RuntimeException("请先删除生产装置对应的分析单元"); + } + //封装删除参数 + param.setId(deviceDeleteReqDTO.getId()); + param.setGmtModitify(date); + param.setLastEditUserName(userById.getRealName()); + //执行删除 + int result = preventProduceDeviceService.deleteById(param); + + resultVO.setCount(result); + return resultVO; + } + + /** + * 生产装置-修改 + */ + @Override + public ResultVO<PreventProduceDevice> updateOneById(Long userId, PreventProduceDeviceUpdateReqDTO deviceUpdateReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + Date date = new Date(); + if (ObjectUtils.isEmpty(deviceUpdateReqDTO)){ + throw new BusinessException(E.DATA_PARAM_NULL, "修改参数不能为空"); + } + if (deviceUpdateReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "请检查生产装置是否存在"); + } + //检查修改信息的装置是否存在 + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(deviceUpdateReqDTO.getId()); + if(ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "生产装置不存在或已删除"); + } + //检查要修改的名称,是否被占用 + PreventProduceDevice deviceByName = preventProduceDeviceService.getDeviceByName(deviceUpdateReqDTO.getProduceDeviceName()); + //如果查询结果不为空,且修改设备的id与查询到的设备id不同,名称已经被占用 + if(!ObjectUtils.isNotEmpty(deviceByName) && !deviceByName.getId().equals(deviceUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "生产装置已存在,请检查装置名称是否正确,或为装置名称添加编号"); + } + if (deviceUpdateReqDTO.getRiskLevel() == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "风险等级设置错误,请设置为以下之一:“低风险、一般风险、较大风险、重大风险"); + } + //校验部门是否存在 + if (deviceUpdateReqDTO.getDepId() == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"生产装置责任部门不能为空"); + } + //校验部门是否存在 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(deviceUpdateReqDTO.getDepId()); + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + + if (deviceUpdateReqDTO.getProduceDeviceName() == null || deviceUpdateReqDTO.getProduceDeviceName() ==""){ + throw new BusinessException(E.DATA_PARAM_NULL, "生产装置名称不能设置为空"); + } + if (deviceUpdateReqDTO.getLocation() == null || deviceUpdateReqDTO.getLocation() ==""){ + throw new BusinessException(E.DATA_PARAM_NULL, "生产装置所在地不能为空"); + } + //封装修改参数 + PreventProduceDeviceUpdateParams updateParams = new PreventProduceDeviceUpdateParams(); + + updateParams.setId(deviceUpdateReqDTO.getId()); + updateParams.setRiskLevel(deviceUpdateReqDTO.getRiskLevel()); + updateParams.setStatus((byte) 1); + updateParams.setProduceDeviceName(deviceUpdateReqDTO.getProduceDeviceName()); + updateParams.setLocation(deviceUpdateReqDTO.getLocation()); + + updateParams.setDepId(deviceUpdateReqDTO.getDepId()); + updateParams.setDepName(departmentInfo.getDepartment()); + updateParams.setDepUuid(null); + + updateParams.setGmtModitify(date); + updateParams.setLastEditUserName(userById.getRealName()); + //执行修改 + int result = preventProduceDeviceService.updateProduceDevice(updateParams); + + resultVO.setCount(result); + + return resultVO; + } + + //风险分布图 + /** + * 风险分布图-分页查询详细信息 + */ + @Override + public ResultVO<PreventRiskMap> getMapPage(PreventRiskMapQueryReqDTO riskMapQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + List<PreventRiskMapQueryRespDTO> list = new ArrayList<>(); + + //获取流 + FileInputStream inputStream = null; + String base64Str = ""; + + + Integer pageIndex = riskMapQueryReqDTO.getPageIndex(); + Integer pageSize = riskMapQueryReqDTO.getPageSize(); + //执行查询 + IPage<PreventRiskMap> page = preventRiskMapService.getMapPage(new Page<>(pageIndex, pageSize)); + for (PreventRiskMap record : page.getRecords()) { + PreventRiskMapQueryRespDTO reqDto = BeanCopyUtils.copyBean(record, PreventRiskMapQueryRespDTO.class); + reqDto.setPageIndex((int) page.getCurrent()); + reqDto.setPageSize((int) page.getSize()); + //处理图片 + try { + Base64.Encoder encoder = Base64.getEncoder(); + String filePath = "F:/img/"+record.getImgPath(); + inputStream = new FileInputStream(filePath); + int available = inputStream.available(); + byte[] bytes = new byte[available]; + inputStream.read(bytes); + base64Str = encoder.encodeToString(bytes); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + inputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + reqDto.setImg(base64Str); + //封装数据 + list.add(reqDto); + } + //封装返回数据 + resultVO.setData(list); + resultVO.setCount((int) page.getTotal()); + + return resultVO; + } + + /** + * 风险分布图-新增 + */ + @Override + public ResultVO<PreventRiskMap> saveRiskMap(Long userId, PreventRiskMapSaveReqDTO riskMapSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + PreventRiskMap riskMap = new PreventRiskMap(); + MultipartFile image = riskMapSaveReqDTO.getImg(); + + //校验参数 + if (image == null) { + resultVO.setCode("300"); + resultVO.setMsg("请选择要上传的图片"); + return resultVO; + } + if (image.getSize() > 1024 * 1024 * 10) { + resultVO.setCode("300"); + resultVO.setMsg("文件大小不能大于10M"); + return resultVO; + } + //获取文件后缀 + String suffix = image.getOriginalFilename().substring(image.getOriginalFilename().lastIndexOf(".") + 1, image.getOriginalFilename().length()); + if (!"jpg,jpeg,gif,png".toUpperCase().contains(suffix.toUpperCase())) { + resultVO.setCode("300"); + resultVO.setMsg("请选择jpg,jpeg,gif,png格式的图片"); + return resultVO; + } + //处理图片 + String savePath = "F:/img/"; + File savePathFile = new File(savePath); + if (!savePathFile.exists()) { + //若不存在该目录,则创建目录 + savePathFile.mkdir(); + } + //通过UUID生成唯一文件名 + String filename = UUID.randomUUID().toString().replaceAll("-","") + "." + suffix; + try { + //将文件保存指定目录 + //file.transferTo(new File(savePath + filename)); + //File file1 = new File(file.getOriginalFilename()); + FileUtils.copyInputStreamToFile(image.getInputStream(),new File(savePath + filename)); + } catch (Exception e) { + e.printStackTrace(); + resultVO.setCode("300"); + resultVO.setMsg("保存文件异常"); + return resultVO; + } + //获取id与uuid + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + //封装数据 + riskMap.setId(snowFlow.nextId()); + riskMap.setUuid(uuid); + riskMap.setImgPath(filename); + riskMap.setDescInfo(riskMapSaveReqDTO.getDescInfo()); + riskMap.setEnterpriseId((long) 1); + riskMap.setEnterpriseUuid("111"); + riskMap.setCreateByUserName(userById.getRealName()); + riskMap.setGmtCreate(date); + riskMap.setLastEditUserName(userById.getRealName()); + riskMap.setGmtModitify(date); + riskMap.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + //执行插入 + int result = preventRiskMapService.saveRiskMap(riskMap); + + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险分布图-删除 + */ + @Override + public ResultVO<PreventRiskMap> deleteRiskMap(Long userId, PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + //获取用户信息 + + if (riskMapDeleteReqDTO.getId() == null){ + throw new RuntimeException("请选择删除内容"); + } + //执行删除 + int result = preventRiskMapService.deleteRiskMap(riskMapDeleteReqDTO.getId()); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险分布图-修改 + */ + @Override + public ResultVO<PreventRiskMap> updateRiskMap(Long userId, PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + PreventRiskMapUpdateParams params = new PreventRiskMapUpdateParams(); + Date date = new Date(); + //封装修改参数 + params.setId(riskMapUpdateReqDTO.getId()); + params.setDescInfo(riskMapUpdateReqDTO.getDescInfo()); + params.setGmtModitify(date); + params.setLastEditUserName(userById.getRealName()); + //修改 + int result = preventRiskMapService.updateRiskMap(params); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + resultVO.setCount(result); + return resultVO; + } + + //风险分析单元 + /** + * 风险分析单元-分页查询 + */ + @Override + public ResultVO<PreventRiskAnaUnit> getRiskUnitPage(Long userId, PreventRiskAnaUnitQueryReqDTO riskAnaUnitQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + List<PreventRiskAnaUnitQueryRespDTO> list = new ArrayList<>(); + Integer pageIndex = riskAnaUnitQueryReqDTO.getPageIndex(); + Integer pageSize = riskAnaUnitQueryReqDTO.getPageSize(); + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //分页查询 + IPage<PreventRiskAnaUnit> page = preventRiskUnitService.getRiskUnitPage(new Page<>(pageIndex, pageSize), riskAnaUnitQueryReqDTO); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + for (PreventRiskAnaUnit record : page.getRecords()) { + PreventRiskAnaUnitQueryRespDTO respDto = BeanCopyUtils.copyBean(record, PreventRiskAnaUnitQueryRespDTO.class); + //封装设备名称 + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(record.getProduceDeviceId()); + respDto.setPageIndex((int) page.getCurrent()); + respDto.setPageSize((int) page.getSize()); + respDto.setProduceDeviceName(deviceById.getProduceDeviceName()); + //封装上报配置信息 + respDto.setReportState(reportConfigById.getReportState()); + respDto.setReportType(reportConfigById.getReportType()); + list.add(respDto); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + /** + * 风险分析单元-新增 + */ + @Override + public ResultVO<PreventRiskAnaUnit> saveRiskAnaUnit(Long userId, PreventRiskAnaUnitSaveReqDTO riskAnaUnitSaveReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + PreventRiskMap riskMap = new PreventRiskMap(); + + //校验参数 + if (ObjectUtils.isEmpty(riskAnaUnitSaveReqDTO)){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (riskAnaUnitSaveReqDTO.getRiskCode() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析编码不能为空"); + } + if (riskAnaUnitSaveReqDTO.getRiskUnitName() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析单元名称不能为空"); + } + //判断是否存在同名单元 + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitByName(riskAnaUnitSaveReqDTO.getRiskUnitName()); + if (!ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_DATABASE_DUPLICATED, "存在同名单元,请修改名称,或为单元添加编号"); + } + //判断是否存在同名编码 +// PreventRiskAnaUnit riskUnitByCode = preventRiskUnitService.getRiskUnitByCode(riskAnaUnitSaveReqDTO.getRiskCode()); +// if (!ObjectUtils.isEmpty(riskUnitByCode)){ +// throw new BusinessException(E.DATA_DATABASE_DUPLICATED, "存在同名风险编码,请修改编码"); +// } + if (riskAnaUnitSaveReqDTO.getLiableDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "责任部门不能为空"); + } + //校验部门是否存在 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(riskAnaUnitSaveReqDTO.getLiableDepId()); + +// ResultVO<DepInfoRPCRespDTO> depInfoByDepId = accountDepartmentService.getDepInfoByDepId(userId, riskAnaUnitSaveReqDTO.getLiableDepId()); +// DepInfoRPCRespDTO dep = (DepInfoRPCRespDTO)depInfoByDepId.getData(); + + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + + if (riskAnaUnitSaveReqDTO.getLiablePersonId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "责任人不能为空"); + } + + if (riskAnaUnitSaveReqDTO.getProduceDeviceId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "生产装置不能为空"); + } + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(riskAnaUnitSaveReqDTO.getProduceDeviceId()); + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "未找到对应的生产装置"); + } + + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + ResultVO<UserRPCRespDTO> liablePersonResult = accountAuthService.getUserById(riskAnaUnitSaveReqDTO.getLiablePersonId()); + UserRPCRespDTO liablePerson = (UserRPCRespDTO)liablePersonResult.getData(); + //封装参数 + PreventRiskAnaUnit riskAnaUnit = BeanCopyUtils.copyBean(riskAnaUnitSaveReqDTO, PreventRiskAnaUnit.class); + + riskAnaUnit.setId(snowFlow.nextId()); + riskAnaUnit.setUuid(uuid); + riskAnaUnit.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + + riskAnaUnit.setEnterpriseId((long) 1); + riskAnaUnit.setProduceDeviceId(deviceById.getId()); + riskAnaUnit.setProduceDeviceUuid(deviceById.getUuid()); + riskAnaUnit.setEnterpriseUuid("111"); + riskAnaUnit.setLiablePerson(liablePerson.getRealName()); + riskAnaUnit.setLiablePersonUuid(liablePerson.getUuid()); + riskAnaUnit.setLiableDep(departmentInfo.getDepartment()); + riskAnaUnit.setLiableDepUuid(null); + + riskAnaUnit.setGmtModitify(date); + riskAnaUnit.setGmtCreate(date); + riskAnaUnit.setCreateByUserName(userById.getRealName()); + riskAnaUnit.setLastEditUserName(userById.getRealName()); + + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //设置上报时间为空 + riskAnaUnit.setReportTime(null); + //设置本条数据上报更新时间 + riskAnaUnit.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + riskAnaUnit.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + riskAnaUnit.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + riskAnaUnit.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + riskAnaUnit.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + int result = preventRiskUnitService.saveRiskAnaUnit(riskAnaUnit); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险分析单元-修改 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitById(Long userId, PreventRiskAnaUnitUpdateReqDTO riskAnaUnitUpdateReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + PreventRiskMap riskMap = new PreventRiskMap(); + PreventRiskAnaUnitUpdateParams params = new PreventRiskAnaUnitUpdateParams(); + Date date = new Date(); + + //校验参数 + if (ObjectUtils.isEmpty(riskAnaUnitUpdateReqDTO)){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (riskAnaUnitUpdateReqDTO.getRiskCode() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析编码不能为空"); + } + if (riskAnaUnitUpdateReqDTO.getRiskUnitName() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析单元名称不能为空"); + } + //判断是否存在同名单元 + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitByName(riskAnaUnitUpdateReqDTO.getRiskUnitName()); + //如果查询结果不为空,且查询到的id与请求的id不同——被占用 + if (ObjectUtils.isNotEmpty(riskUnitById) && !riskUnitById.getId().equals(riskAnaUnitUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_DATABASE_DUPLICATED, "存在同名单元,请修改名称,或为单元添加编号"); + } + //判断是否存在同名编码 +// PreventRiskAnaUnit riskUnitByCode = preventRiskUnitService.getRiskUnitByCode(riskAnaUnitUpdateReqDTO.getRiskCode()); +// if (ObjectUtils.isNotEmpty(riskUnitByCode) && !riskUnitByCode.getId().equals(riskAnaUnitUpdateReqDTO.getId())){ +// throw new BusinessException(E.DATA_DATABASE_DUPLICATED, "存在同名风险编码,请修改编码"); +// } + if (riskAnaUnitUpdateReqDTO.getLiableDepId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "责任部门不能为空"); + } + //校验部门是否存在 + DepartmentInfo departmentInfo = departmentService.getDepartmentInfoById(riskAnaUnitUpdateReqDTO.getLiableDepId()); + if(ObjectUtils.isEmpty(departmentInfo)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任部门"); + } + + if (riskAnaUnitUpdateReqDTO.getLiablePersonId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "责任人不能为空"); + } + //获取责任人信息 + ResultVO<UserRPCRespDTO> liablePersonResult = accountAuthService.getUserById(riskAnaUnitUpdateReqDTO.getLiablePersonId()); + UserRPCRespDTO liablePerson = (UserRPCRespDTO)liablePersonResult.getData(); + if(ObjectUtils.isEmpty(liablePerson)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"请输入正确责任人"); + } + + if (riskAnaUnitUpdateReqDTO.getProduceDeviceId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "生产装置不能为空"); + } + PreventProduceDevice deviceByName = preventProduceDeviceService.getDeviceById(riskAnaUnitUpdateReqDTO.getProduceDeviceId()); + if (ObjectUtils.isEmpty(deviceByName)){ + throw new BusinessException(E.DATA_PARAM_NULL, "未找到对应的生产装置"); + } + + //封装修改参数 + params.setId(riskAnaUnitUpdateReqDTO.getId()); + params.setRiskUnitName(riskAnaUnitUpdateReqDTO.getRiskUnitName()); + params.setRiskCode(riskAnaUnitUpdateReqDTO.getRiskCode()); + params.setProduceDeviceId(deviceByName.getId()); + params.setProduceDeviceUuid(deviceByName.getUuid()); + params.setLiableDepId(riskAnaUnitUpdateReqDTO.getLiableDepId()); + params.setLiablePersonId(riskAnaUnitUpdateReqDTO.getLiablePersonId()); + params.setLiablePersonUuid(liablePerson.getUuid()); + params.setLiableDepUuid(null); + params.setLiablePerson(liablePerson.getRealName()); + params.setLiableDep(departmentInfo.getDepartment()); + params.setUpdateReportDataTime(date); + params.setGmtModitify(date); + params.setLastEditUserName(userById.getRealName()); + params.setUpdateReportDataTime(date); + + //获取上报主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //设置本条数据上报更新时间 + params.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + params.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + params.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + params.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + params.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + int result = preventRiskUnitService.updateRiskAnaUnitById(params); + //结果校验 + if (result == 0){ + throw new BusinessException(E.UPDATE_FAIL, "修改失败"); + } + resultVO.setCount(result); + + return resultVO; + } + + /** + * 安全风险分析单元-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateRiskAnaUnitReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + int result ; + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitById(preventHandReportConfigReqDTO.getId()); + //配置相同 + if (riskUnitById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_ANA_UNIT.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventRiskUnitService.updateRiskAnaUnitReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险分析单元-删除 + */ + @Override + public ResultVO<PreventRiskAnaUnit> deleteRiskAnaUnitById(Long userId, PreventRiskAnaUnitDeleteReqDTO riskAnaUnitDeleteReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + PreventRiskMap riskMap = new PreventRiskMap(); + PreventRiskAnaUnitDeleteParams deleteParams = new PreventRiskAnaUnitDeleteParams(); + + Date date = new Date(); + //校验参数 + if (ObjectUtils.isEmpty(riskAnaUnitDeleteReqDTO)) { + throw new BusinessException(E.DATA_PARAM_NULL, "请选择删除内容"); + } + //检查风险分析单元对应的风险事件是否全部删除 + List<PreventRiskEvent> eventList = preventRiskEventService.getRiskEventNameByRiskUnitId(riskAnaUnitDeleteReqDTO.getId()); + if (eventList.size() > 0){ + throw new BusinessException(E.NOT_DELETE, "请先删除风险分析单元对应的风险事件"); + } + //封装参数 + deleteParams.setId(riskAnaUnitDeleteReqDTO.getId()); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(date); + //删除 + int result = preventRiskUnitService.deleteRiskAnaUnitById(deleteParams); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + resultVO.setCount(result); + + return resultVO; + } + + /** + * 风险单元list查询 + */ + @Override + public ResultVO<PreventRiskEvent> listRiskUnits(Long userId) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + //List<PreventRiskEventQueryRespDTO> list = new ArrayList<>(); + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //校验用户信息 + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventRiskAnaUnit> riskAnaUnits = preventRiskUnitService.listRiskUnits(); + if (ObjectUtils.isEmpty(riskAnaUnits)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //List<PreventRiskEventListRiskUnitsRespDTO> respDTOS = BeanCopyUtils.copyBeanList(riskAnaUnits, PreventRiskEventListRiskUnitsRespDTO.class); + List<PreventRiskEventListRiskUnitsRespDTO> list = new ArrayList<>(); + for (PreventRiskAnaUnit riskAnaUnit : riskAnaUnits) { + PreventRiskEventListRiskUnitsRespDTO respDTO = BeanCopyUtils.copyBean(riskAnaUnit, PreventRiskEventListRiskUnitsRespDTO.class); + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(respDTO.getProduceDeviceId()); + respDTO.setProduceDeviceName(deviceById.getProduceDeviceName()); + list.add(respDTO); + } + + resultVO.setData(list); + + return resultVO; + } + + //风险事件 + /** + * 风险事件-分页查询 + */ + @Override + public ResultVO<PreventRiskEvent> getRiskEventPage(Long userId, PreventRiskEventQueryReqDTO riskEventQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + List<PreventRiskEventQueryRespDTO> list = new ArrayList<>(); + PreventRiskEventQueryParams queryParams = new PreventRiskEventQueryParams(); + Integer pageIndex = riskEventQueryReqDTO.getPageIndex(); + Integer pageSize = riskEventQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //校验参数 + //如果风险单元条件不为空 + if (riskEventQueryReqDTO.getRiskUnitId() != null ){ + queryParams.setRiskUnitId(riskEventQueryReqDTO.getRiskUnitId()); + } + if (riskEventQueryReqDTO.getRiskEventName() != null && riskEventQueryReqDTO.getRiskEventName() != ""){ + queryParams.setRiskEventName(riskEventQueryReqDTO.getRiskEventName()); + }else{ + queryParams.setRiskEventName(null); + } + //获取事件上报配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + //获取到所有符合条件的事件 + IPage<PreventRiskEvent> page = preventRiskEventService.getRiskEventPage(new Page<>(pageIndex, pageSize), queryParams); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //遍历集合,为符合条件的事件添加单元名称 + for (PreventRiskEvent record : page.getRecords()) { + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitById(record.getRiskUnitId()); + PreventRiskEventQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventRiskEventQueryRespDTO.class); + respDTO.setRiskUnitName(riskUnitById.getRiskUnitName()); + respDTO.setRiskUnitId(riskUnitById.getId()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setPageSize((int) page.getSize()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + list.add(respDTO); + } + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + /** + * 风险事件-新增 + */ + @Override + public ResultVO<PreventRiskEvent> saveRiskEvent(Long userId, PreventRiskEventSaveReqDTO riskEventSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + PreventRiskEvent riskEvent = new PreventRiskEvent(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + //校验参数 + if (riskEventSaveReqDTO.getRiskEventName() == null && riskEventSaveReqDTO.getRiskEventName() != ""){ + throw new BusinessException(E.DATA_PARAM_NULL, "事件不能为空"); + } + //检查是否已经存在同名参数 + PreventRiskEvent riskEventByName = preventRiskEventService.getRiskEventByName(riskEventSaveReqDTO.getRiskEventName()); + if (!ObjectUtils.isEmpty(riskEventByName)){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "存在同名事件,为新事件改名或添加编号"); + } + + if (riskEventSaveReqDTO.getRiskUnitId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析单元不能为空"); + } + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitById(riskEventSaveReqDTO.getRiskUnitId()); + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择正确的风险分析单元"); + } + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + //封装参数 + riskEvent.setId(snowFlow.nextId()); + riskEvent.setUuid(uuid); + riskEvent.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + riskEvent.setRiskEventName(riskEventSaveReqDTO.getRiskEventName()); + + riskEvent.setRiskUnitId(riskUnitById.getId()); + riskEvent.setRiskUnitUuid(riskUnitById.getUuid()); + + riskEvent.setEnterpriseId((long) 1); + riskEvent.setEnterpriseUuid("111"); + riskEvent.setGmtModitify(date); + riskEvent.setGmtCreate(date); + riskEvent.setCreateByUserName(userById.getRealName()); + riskEvent.setLastEditUserName(userById.getRealName()); + riskEvent.setUpdateReportDataTime(null); + riskEvent.setReportTime(null); + riskEvent.setEventResult(riskEventSaveReqDTO.getEventResult()); + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + //设置上报时间为空 + riskEvent.setReportTime(null); + //设置本条数据上报更新时间 + riskEvent.setUpdateReportDataTime(date); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + riskEvent.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + riskEvent.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + riskEvent.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + riskEvent.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + int result = preventRiskEventService.saveRiskEvent(riskEvent); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "新增失败"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险事件-修改 + */ + @Override + public ResultVO<PreventRiskEvent> updateRiskEvent(Long userId, PreventRiskEventUpdateReqDTO riskEventUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + PreventRiskEventUpdateParams updateParams = new PreventRiskEventUpdateParams(); + Date data = new Date(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + //校验参数 + if (riskEventUpdateReqDTO.getRiskEventName() == null && riskEventUpdateReqDTO.getRiskEventName() != ""){ + throw new BusinessException(E.DATA_PARAM_NULL, "事件不能为空"); + } + //检查是否已经存在同名参数 + PreventRiskEvent riskEventByName = preventRiskEventService.getRiskEventByName(riskEventUpdateReqDTO.getRiskEventName()); + //如果查询结果不为空,且查询到的id与请求的id不同——被占用 + if (!ObjectUtils.isEmpty(riskEventByName) && !riskEventByName.getId().equals(riskEventUpdateReqDTO.getId())){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "存在同名事件,轻为新事件改名或添加编号"); + } + + if (riskEventUpdateReqDTO.getRiskUnitId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险分析单元不能为空"); + } + PreventRiskAnaUnit riskUnitById = preventRiskUnitService.getRiskUnitById(riskEventUpdateReqDTO.getRiskUnitId()); + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择正确的风险分析单元"); + } + + //获取需要填充的信息 + updateParams.setId(riskEventUpdateReqDTO.getId()); + updateParams.setRiskEventName(riskEventUpdateReqDTO.getRiskEventName()); + updateParams.setRiskUnitId(riskUnitById.getId()); + updateParams.setRiskUnitUuid(riskUnitById.getUuid()); + updateParams.setGmtModitify(data); + updateParams.setLastEditUserName(userById.getRealName()); + updateParams.setEventResult(riskEventUpdateReqDTO.getEventResult()); + + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(data); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能,且设置为自动上报,开启上报相关配置 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + updateParams.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //其他情况默认不开启上报数据,如果是手动上报,可对单条数据进行操作 + }else { + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + } + + int result = preventRiskEventService.updateRiskEvent(updateParams); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "修改失败"); + } + resultVO.setCount(result); + + return resultVO; + } + + /** + * 安全风险事件-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateRiskEventReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventRiskEvent riskEventNameById = preventRiskEventService.getRiskEventNameById(preventHandReportConfigReqDTO.getId()); + //配置相同,做处理 + if (riskEventNameById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + int result ; + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_EVENT.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventRiskEventService.updateRiskEventReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 风险事件-事件list + */ + @Override + public ResultVO<PreventRiskEvent> getListEvents(Long userId) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //校验用户信息 + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + List<PreventRiskEvent> preventRiskEvents = preventRiskEventService.getListEvents(); + List<PreventRiskEventsListQueryRespDTO> respDTOS + = BeanCopyUtils.copyBeanList(preventRiskEvents, PreventRiskEventsListQueryRespDTO.class); + + resultVO.setData(respDTOS); + resultVO.setCount(respDTOS.size()); + return resultVO; + } + + /** + * 风险事件-删除 + */ + @Override + public ResultVO<PreventRiskEvent> deleteRiskEvent(Long userId, PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + PreventRiskEvent riskEvent = new PreventRiskEvent(); + Date data = new Date(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + PreventDeleteParams deleteParams = new PreventDeleteParams(); + //校验参数 + if (riskEventDeleteReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择要删除的内容"); + } + //检查风险事件对应的管控措施 + List<PreventRiskControlMeasure> measureList = + preventRiskControlMeasureService.getRiskControlMeasureByRiskEventId(riskEventDeleteReqDTO.getId()); + if (measureList.size() > 0){ + throw new BusinessException(E.NOT_DELETE, "请先删除风险事件对应的风险管控措施"); + } + //封装参数 + deleteParams.setId(riskEventDeleteReqDTO.getId()); + deleteParams.setGmtModitify(data); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(data); + int result = preventRiskEventService.deleteRiskEventById(deleteParams); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + resultVO.setCount(result); + return resultVO; + } + + //管控措施 + /** + * 管控措施-分页查询 + */ + @Override + public ResultVO<PreventRiskControlMeasure> getRiskControlMeasurePage(Long userId, PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + List<PreventRiskControlMeasureQueryRespDTO> list = new ArrayList<>(); + PreventRiskControlMeasureQueryParams queryParams = new PreventRiskControlMeasureQueryParams(); + Integer pageIndex = measureQueryReqDTO.getPageIndex(); + Integer pageSize = measureQueryReqDTO.getPageSize(); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //校验参数 + if (measureQueryReqDTO.getControlType() != null) { + queryParams.setControlType(measureQueryReqDTO.getControlType()); + } + if (measureQueryReqDTO.getRiskEventId() != null) { + queryParams.setRiskEventId(measureQueryReqDTO.getRiskEventId()); + } + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //获取到所有符合条件的措施 + IPage<PreventRiskControlMeasure> page = + preventRiskControlMeasureService.getRiskControlMeasurePage(new Page<>(pageIndex, pageSize), queryParams); + if (ObjectUtils.isEmpty(page)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + //遍历集合,为符合条件的措施添加事件名称 + for (PreventRiskControlMeasure record : page.getRecords()) { + PreventRiskControlMeasureQueryRespDTO respDTO = BeanCopyUtils.copyBean(record, PreventRiskControlMeasureQueryRespDTO.class); + //为措施添加事件名称 + PreventRiskEvent riskEventNameById = preventRiskEventService.getRiskEventNameById(record.getRiskEventId()); + respDTO.setRiskEventName(riskEventNameById.getRiskEventName()); + //为措施添加隐患排查内容 + PreventDangerCheckContent checkContent = preventDangerCheckContentService.getCheckContentByMeasureId(record.getId()); + respDTO.setCheckContent(checkContent.getCheckContent()); + respDTO.setPageSize((int) page.getSize()); + respDTO.setPageIndex((int) page.getCurrent()); + respDTO.setReportState(reportConfigById.getReportState()); + respDTO.setReportType(reportConfigById.getReportType()); + list.add(respDTO); + } + resultVO.setData(list); + resultVO.setCount((int) page.getTotal()); + return resultVO; + } + + /** + * 生产装置ID- 查询单元 + */ + @Override + public ResultVO<PreventRiskAnaUnit> getRiskAnaUnitByDeviceId(Long uid, Long deviceId) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + + //获取用户信息 + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(uid); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + List<PreventRiskAnaUnit> riskUnitByDeviceId = preventRiskUnitService.getRiskUnitByDeviceId(deviceId); + if (ObjectUtils.isEmpty(riskUnitByDeviceId)){ + resultVO.setMsg("查询成功,无数据"); + return resultVO; + } + PreventProduceDevice deviceById = preventProduceDeviceService.getDeviceById(deviceId); + + List<PreventGetAnaUnitByDeviceIdRespDTO> list = new ArrayList<>(); + for (PreventRiskAnaUnit preventRiskAnaUnit : riskUnitByDeviceId) { + PreventGetAnaUnitByDeviceIdRespDTO respDTO = BeanCopyUtils.copyBean(preventRiskAnaUnit, PreventGetAnaUnitByDeviceIdRespDTO.class); + respDTO.setProduceDeviceName(deviceById.getProduceDeviceName()); + list.add(respDTO); + } + resultVO.setData(list); + + return resultVO; + } + + /** + * 安全风险事件-手工上报-配置 + */ + @Override + public ResultVO<PreventRiskAnaUnit> updateMeasuresReport(Long userId, PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + if (preventHandReportConfigReqDTO.getId() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + if (preventHandReportConfigReqDTO.getReportSwitch() == null){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "传参非法"); + } + //查询当前隐患的配置 + PreventRiskControlMeasure controlMeasureById = preventRiskControlMeasureService.getControlMeasureById(preventHandReportConfigReqDTO.getId()); + //配置相同,做处理 + if (controlMeasureById.getReportSwitch() == preventHandReportConfigReqDTO.getReportSwitch()){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "与当前配置相同"); + } + int result ; + //读取主配置信息 + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //只有当开启上报,且类型为手动上报时,可以修改 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode() + && reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + result = preventRiskControlMeasureService.updateMeasuresReport(preventHandReportConfigReqDTO); + + }else { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "当前上报配置,不支持对单条数据操作"); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 管控措施-新增 + */ + @Transactional + @Override + public ResultVO<PreventRiskControlMeasure> saveRiskControlMeasure(Long userId, PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("新增成功"); + PreventDangerCheckContent checkContent = new PreventDangerCheckContent(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + //校验参数 + if (measureSaveReqDTO.getRiskEventId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险事件不能为空"); + } + PreventRiskEvent riskEventById = preventRiskEventService.getRiskEventNameById(measureSaveReqDTO.getRiskEventId()); + if (ObjectUtils.isEmpty(riskEventById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请检查风险事件是否正确"); + } + if (measureSaveReqDTO.getControlType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式不能为空,或设置有误"); + } + if (measureSaveReqDTO.getClassify1() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式分类1不能为空,或设置有误"); + } + if (measureSaveReqDTO.getClassify2() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式分类2不能为空,或设置有误"); + } + if (measureSaveReqDTO.getControlMeasureCode() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控措施编码不能为空"); + } + PreventRiskControlMeasure riskControlMeasureByCode = + preventRiskControlMeasureService.getRiskControlMeasureByCodeAndEventId(riskEventById.getId(), measureSaveReqDTO.getControlMeasureCode()); + if (ObjectUtils.isNotEmpty(riskControlMeasureByCode)){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "本事件已经存在同编码的管控措施,请修改名称或添加编号"); + } + if (measureSaveReqDTO.getCheckContent() == null && measureSaveReqDTO.getCheckContent() == ""){ + throw new BusinessException(E.DATA_PARAM_NULL, "检查内容不能为空"); + } + + //获取需要填充的信息 + SnowFlow snowFlow = new SnowFlow();//雪花算法生成器 + String uuid = UUID.randomUUID().toString(); + Date date = new Date(); + long measureId = snowFlow.nextId(); + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //封装管控措施参数 + PreventRiskControlMeasure controlMeasure = BeanCopyUtils.copyBean(measureSaveReqDTO, PreventRiskControlMeasure.class); + controlMeasure.setId(measureId); + controlMeasure.setUuid(uuid); + controlMeasure.setControlMeasureCode(measureSaveReqDTO.getControlMeasureCode()); + controlMeasure.setRiskEventId(riskEventById.getId()); + controlMeasure.setRiskEventUuid(riskEventById.getUuid()); + controlMeasure.setEnterpriseId((long) 1); + controlMeasure.setEnterpriseUuid("123"); + controlMeasure.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode()); + controlMeasure.setGmtModitify(date); + controlMeasure.setGmtCreate(date); + controlMeasure.setCreateByUserName(userById.getRealName()); + controlMeasure.setLastEditUserName(userById.getRealName()); + + //创建管控措施不需要的字段填充 + controlMeasure.setCheckTaskUnitId(null); + controlMeasure.setCheckTaskUnitUuid(null); + controlMeasure.setCheckWorkId(null); + controlMeasure.setCheckWorkUuid(null); + controlMeasure.setCheckTaskId(null); + controlMeasure.setCheckTaskUuid(null); + + controlMeasure.setReportTime(null); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + controlMeasure.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + controlMeasure.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + controlMeasure.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + controlMeasure.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + controlMeasure.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + controlMeasure.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + controlMeasure.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + controlMeasure.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + controlMeasure.setUpdateReportDataTime(date); + } + + //封装隐患检查内容的参数 + checkContent.setControlMeasureId(measureId); + checkContent.setControlMeasureUuid(uuid); + checkContent.setCheckContent(measureSaveReqDTO.getCheckContent()); + + + //执行措施插入 + int measureResult = preventRiskControlMeasureService.saveRiskControlMeasure(controlMeasure); + //执行隐患检查内容插入 + int checkContentResult = preventDangerCheckContentService.saveDangerCheckContent(checkContent); + + resultVO.setCount(measureResult); + return resultVO; + } + + /** + * 管控措施-修改 + */ + @Transactional + @Override + public ResultVO<PreventRiskControlMeasure> updateRiskControlMeasure(Long userId, PreventRiskControlMeasureUpdateReqDTO measureUpdateReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("修改成功"); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + PreventRiskAnaUnitUpdateParams params = new PreventRiskAnaUnitUpdateParams(); + PreventDangerCheckContent checkContent = new PreventDangerCheckContent(); + Date date = new Date(); + + //校验参数 + if (measureUpdateReqDTO.getRiskEventId() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "风险事件不能为空"); + } + //根据事件名称查询信息 + PreventRiskEvent riskEventById = preventRiskEventService.getRiskEventNameById(measureUpdateReqDTO.getRiskEventId()); + if (ObjectUtils.isEmpty(riskEventById)){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "请检查风险事件是否正确"); + } + if (measureUpdateReqDTO.getControlType() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式不能为空,或设置有误"); + } + if (measureUpdateReqDTO.getClassify1() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式分类1不能为空,或设置有误"); + } + if (measureUpdateReqDTO.getClassify2() == null){ + throw new BusinessException(E.DATA_PARAM_NULL, "管控方式分类2不能为空,或设置有误"); + } + //根据措施编码与事件id查询 + PreventRiskControlMeasure riskControlMeasureById + = preventRiskControlMeasureService.getRiskControlMeasureByCodeAndEventId(riskEventById.getId(), measureUpdateReqDTO.getControlMeasureCode()); + //如果查询结果不为空,且查询到的id与请求的id不同——被占用 + if (ObjectUtils.isNotEmpty(riskControlMeasureById) && !measureUpdateReqDTO.getId().equals(riskControlMeasureById.getId())){ + throw new BusinessException(E.DATA_DATABASE_EXIST, "本事件已经存在同编码的管控措施,请修改名称或添加编号"); + } + if (measureUpdateReqDTO.getCheckContent() == null && measureUpdateReqDTO.getCheckContent() == ""){ + throw new BusinessException(E.DATA_PARAM_NULL, "检查内容不能为空"); + } + + //封装修改参数 + PreventRiskControlMeasureUpdateParams updateParams = + BeanCopyUtils.copyBean(measureUpdateReqDTO, PreventRiskControlMeasureUpdateParams.class); + + updateParams.setRiskEventId(riskEventById.getId()); + updateParams.setRiskEventUuid(riskEventById.getUuid()); + updateParams.setGmtModitify(date); + updateParams.setLastEditUserName(userById.getRealName()); + PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_RISK_MEASURE.getCode()); + //读取上报主配置,进行任务记录上报配置,如果开启上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_ON.getCode()){ + //自动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_HAND_EXEC_CONFIG.getCode()){ + //设置上报状态为-等待上报 + updateParams.setReportStatus(SyncEnum.SYNC_WAIT_EXEC.getCode()); + //设置本条数据上报开关为-开启 + updateParams.setReportSwitch(SyncEnum.REPORT_ON.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + //手动上报 + if (reportConfigById.getReportType() == SyncEnum.REPORT_AUTO_EXEC_CONFIG.getCode()){ + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + } + //如果主配置关闭上报功能 + if (reportConfigById.getReportState() == SyncEnum.REPORT_OFF.getCode()){ + //设置上报状态为-不上报 + updateParams.setReportStatus(SyncEnum.SYNC_NOT_EXEC.getCode()); + //设置本条数据上报开关为-关闭 + updateParams.setReportSwitch(SyncEnum.REPORT_OFF.getCode()); + //设置本条数据上报更新时间 + updateParams.setUpdateReportDataTime(date); + } + + //执行内容修改 + preventDangerCheckContentService.updateDangerCheckContent(measureUpdateReqDTO.getId(), measureUpdateReqDTO.getCheckContent()); + //执行措施修改 + int result = preventRiskControlMeasureService.updateRiskControlMeasure(updateParams); + if (result == 0){ + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + resultVO.setCount(result); + return resultVO; + } + + /** + * 管控措施- 管控措施模板 + */ + @Override + public ResultVO<PreventRiskControlMeasure> listMeasures(Long userId) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + //获取用户信息 + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + + List<PreventRiskControlTemplate> listMeasureTemplates = preventRiskControlTemplateService.listMeasureTemplates(); + + List<PreventRiskMeasureTemplatesListQueryRespDTO> respDTOS + = BeanCopyUtils.copyBeanList(listMeasureTemplates, PreventRiskMeasureTemplatesListQueryRespDTO.class); + + resultVO.setCount(respDTOS.size()); + resultVO.setData(respDTOS); + return resultVO; + } + /** + * 管控措施- 管控措施列表 + */ + @Override + public ResultVO<PreventRiskControlMeasure> listControlMeasure(ContextCacheUser currentUser, PreventRiskControlMeasureListQueryReqDTO listQueryReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("查询成功"); + //获取用户信息 + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(currentUser.getUid()); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + List<PreventRiskControlMeasureListRespDTO> list = new ArrayList<>(); + + Integer pageIndex = listQueryReqDTO.getPageIndex(); + Integer pageSize = listQueryReqDTO.getPageSize(); + //分页查询,获取到所有符合条件的数据 + IPage<PreventRiskControlMeasureListDO> page = + preventRiskControlMeasureService.listControlMeasurePage(new Page<>(pageIndex, pageSize), listQueryReqDTO); + if (ObjectUtils.isEmpty(page.getRecords())){ + resultVO.setMsg("查询成功"); + return resultVO; + } + for (PreventRiskControlMeasureListDO controlMeasure : page.getRecords()) { + PreventDangerCheckContent checkContentByMeasureId = preventDangerCheckContentService.getCheckContentByMeasureId(controlMeasure.getId()); + PreventRiskControlMeasureListRespDTO respDTO = BeanCopyUtils.copyBean(controlMeasure, PreventRiskControlMeasureListRespDTO.class); + respDTO.setCheckContent(checkContentByMeasureId.getCheckContent()); + list.add(respDTO); + } + +// 不分页查询列表,排查内容内容过多,暂时屏蔽掉 +// List<PreventRiskControlMeasure> riskControlMeasureList = preventRiskControlMeasureService.listControlMeasure(); +// List<PreventRiskControlMeasureListRespDTO> respDTOS = BeanCopyUtils.copyBeanList(riskControlMeasureList, PreventRiskControlMeasureListRespDTO.class); +// resultVO.setCount(respDTOS.size()); +// resultVO.setData(respDTOS); + resultVO.setCount((int) page.getTotal()); + resultVO.setData(list); + + return resultVO; + } + + /** + * 管控措施-删除 + */ + @Override + public ResultVO<PreventRiskControlMeasure> deleteRiskControlMeasure(Long userId, PreventRiskControlMeasureDeleteReqDTO measureDeleteReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + PreventRiskControlMeasureDeleteParams deleteParams = new PreventRiskControlMeasureDeleteParams(); + Date date = new Date(); + + ResultVO<UserRPCRespDTO> rpcResult = accountAuthService.getUserById(userId); + if (rpcResult == null) { + throw new BusinessException(ResultCodes.RPC_RESULT_NULL); + } + if (!ResultCodes.OK.getCode().equals(rpcResult.getCode())) { + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + if (rpcResult.getData() == null) { + throw new BusinessException(ResultCodes.RPC_DATA_NULL); + } + if (!(rpcResult.getData() instanceof UserRPCRespDTO)) { + throw new BusinessException(ResultCodes.RPC_DATA_TYPE_NOT_MATCH); + } + UserRPCRespDTO userById = (UserRPCRespDTO)rpcResult.getData(); + //如果有任务单元采用了措施,措施不应该被删除 + List<PreventTaskUnitAndMeasure> listByMeasureId = preventTaskUnitAndMeasureService.getListByMeasureId(measureDeleteReqDTO.getId()); + if (listByMeasureId != null && listByMeasureId.size() > 0){ + StringBuilder taskUnitName = new StringBuilder(); + //拼接多个单元名称 + for (PreventTaskUnitAndMeasure taskUnitAndMeasure : listByMeasureId) { + PreventDangerCheckTaskUnit taskUnitById = preventDangerCheckTaskUnitService.getTaskUnitById(taskUnitAndMeasure.getTaskUnitId()); + taskUnitName.append(taskUnitById.getTaskUnitName() + ";"); + } + throw new BusinessException(E.DATA_PARAM_NULL, "该措施已被" + taskUnitName + "单元引用,无法删除。"); + } + if (ObjectUtils.isEmpty(userById)) { + throw new BusinessException(ResultCodes.CLIENT_IDENTITY_CHECK_ERROR); + } + //校验参数,封装id + if (measureDeleteReqDTO.getId() != null){ + deleteParams.setId(measureDeleteReqDTO.getId()); + } + PreventRiskControlMeasure controlMeasure + = preventRiskControlMeasureService.getControlMeasureById(measureDeleteReqDTO.getId()); + //封装措施修改参数 + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(userById.getRealName()); + deleteParams.setUpdateReportDataTime(date); + + int result = preventRiskControlMeasureService.deleteRiskControlMeasure(deleteParams); + //校验结果 + if (result == 0) { + throw new BusinessException(E.NOT_DELETE, "删除失败"); + } + + resultVO.setCount(result); + return resultVO; + } + + /** + * 生产装置-批量删除 + */ + @Transactional + @Override + public ResultVO<PreventProduceDevice> deleteBatchDevice(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + int i = 0; + Date date = new Date(); + + if (ObjectUtils.isEmpty(deleteBatchReqDTO)){ + throw new RuntimeException("请检查是否正确选择删除项"); + } + + for (Long id : deleteBatchReqDTO.getIdList()) { + PreventProduceDevice device = preventProduceDeviceService.getDeviceById(id); + if (ObjectUtils.isEmpty(device)){ + throw new RuntimeException("请检查该项是否已经被删除"); + } + //检查生产装置的分析单元是否存在 + List<PreventRiskAnaUnit> unitList = preventRiskUnitService.getRiskUnitByDeviceId(device.getId()); + if (unitList.size() > 0){ + throw new RuntimeException("请先删除生产装置对应的分析单元"); + } + PreventProduceDeviceDeleteParams deleteParams = new PreventProduceDeviceDeleteParams(); + //封装删除参数 + deleteParams.setId(id); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(currentUser.getRealName()); + + //执行删除 + int result = preventProduceDeviceService.deleteById(deleteParams); + i++; + } + + resultVO.setCount(i); + return resultVO; + } + /** + * 风险分析单元-批量删除 + */ + @Transactional + @Override + public ResultVO<PreventRiskAnaUnit> deleteBatchRiskAnaUnit(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + //校验参数 + if (ObjectUtils.isEmpty(deleteBatchReqDTO)) { + throw new BusinessException(E.DATA_PARAM_NULL, "请选择删除内容"); + } + + Date date = new Date(); + int i = 0; + for (Long id : deleteBatchReqDTO.getIdList()) { + //检查风险分析单元对应的风险事件是否全部删除 + List<PreventRiskEvent> eventList = preventRiskEventService.getRiskEventNameByRiskUnitId(id); + if (eventList.size() > 0){ + throw new BusinessException(E.NOT_DELETE, "请先删除风险分析单元对应的风险事件"); + } + + PreventRiskAnaUnitDeleteParams deleteParams = new PreventRiskAnaUnitDeleteParams(); + //封装参数 + deleteParams.setId(id); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(currentUser.getRealName()); + deleteParams.setUpdateReportDataTime(date); + //删除 + int result = preventRiskUnitService.deleteRiskAnaUnitById(deleteParams); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + i ++; + } + + resultVO.setCount(i); + + return resultVO; + } + /** + * 风险事件-批量删除 + */ + @Transactional + @Override + public ResultVO<PreventRiskEvent> deleteBatchRiskEvent(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO) { + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + Date data = new Date(); + int i = 0; + + //校验参数 + if (ObjectUtils.isEmpty(deleteBatchReqDTO)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择要删除的内容"); + } + for (Long id : deleteBatchReqDTO.getIdList()) { + //检查风险事件对应的管控措施是否存在 + List<PreventRiskControlMeasure> measureList = + preventRiskControlMeasureService.getRiskControlMeasureByRiskEventId(id); + if (measureList.size() > 0){ + throw new BusinessException(E.NOT_DELETE, "请先删除风险事件对应的风险管控措施"); + } + PreventDeleteParams deleteParams = new PreventDeleteParams(); + //封装参数 + deleteParams.setId(id); + deleteParams.setGmtModitify(data); + deleteParams.setLastEditUserName(currentUser.getRealName()); + deleteParams.setUpdateReportDataTime(data); + int result = preventRiskEventService.deleteRiskEventById(deleteParams); + //结果校验 + if (result == 0){ + throw new BusinessException(E.DATA_STATUS_NOT_EXIST, "删除失败"); + } + i++; + } + + resultVO.setCount(i); + return resultVO; + } + /** + * 管控措施-批量删除 + */ + @Override + public ResultVO<PreventRiskControlMeasure> deleteBatchRiskControlMeasure(ContextCacheUser currentUser, DeleteBatchReqDTO deleteBatchReqDTO) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("删除成功"); + + if (ObjectUtils.isEmpty(deleteBatchReqDTO)){ + throw new BusinessException(E.DATA_PARAM_NULL, "请选择要删除的内容"); + } + + Date date = new Date(); + int i = 0; + for (Long id : deleteBatchReqDTO.getIdList()) { + //如果有任务单元采用了措施,措施不应该被删除 + List<PreventTaskUnitAndMeasure> listByMeasureId = preventTaskUnitAndMeasureService.getListByMeasureId(id); + if (listByMeasureId != null && listByMeasureId.size() > 0){ + StringBuilder taskUnitName = new StringBuilder(); + //拼接多个单元名称 + for (PreventTaskUnitAndMeasure taskUnitAndMeasure : listByMeasureId) { + PreventDangerCheckTaskUnit taskUnitById = preventDangerCheckTaskUnitService.getTaskUnitById(taskUnitAndMeasure.getTaskUnitId()); + taskUnitName.append(taskUnitById.getTaskUnitName() + ";"); + } + throw new BusinessException(E.DATA_PARAM_NULL, "该措施已被" + taskUnitName + "单元引用,无法删除。"); + } + + PreventRiskControlMeasureDeleteParams deleteParams = new PreventRiskControlMeasureDeleteParams(); + //封装措施修改参数 + deleteParams.setId(id); + deleteParams.setGmtModitify(date); + deleteParams.setLastEditUserName(currentUser.getRealName()); + deleteParams.setUpdateReportDataTime(date); + + int result = preventRiskControlMeasureService.deleteRiskControlMeasure(deleteParams); + //校验结果 + if (result == 0) { + throw new BusinessException(E.NOT_DELETE, "删除失败"); + } + i++; + } + + resultVO.setCount(i); + return resultVO; + } + + /** + * 风险分布图-图 + */ + @Override + public ResultVO<PreventRiskMap> getMapImage(Long id) { + + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode("200"); + resultVO.setMsg("成功"); + + + FileInputStream inputStream = null; + String base64Str = ""; + try { + Base64.Encoder encoder = Base64.getEncoder(); + + PreventRiskMap mapById = preventRiskMapService.getById(id); + String filePath = "F:/img/"+mapById.getImgPath(); + + inputStream = new FileInputStream(filePath); + int available = inputStream.available(); + byte[] bytes = new byte[available]; + inputStream.read(bytes); + base64Str = encoder.encodeToString(bytes); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + inputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + resultVO.setData(base64Str); + + return resultVO; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/service/impl/StatisticsServiceImpl.java b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/StatisticsServiceImpl.java new file mode 100644 index 0000000..fd17597 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/service/impl/StatisticsServiceImpl.java @@ -0,0 +1,211 @@ +package com.gk.hotwork.doublePrevention.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Vo.PageInfoExtension; +import com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskRectifyDO; +import com.gk.hotwork.doublePrevention.entity.PreventProduceDevice; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionCompletedReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionTaskReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectorReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsPreventDangerPageReqDTO; +import com.gk.hotwork.doublePrevention.entity.dto.resp.PreventDangerCheckTaskRectifyRespDTO; +import com.gk.hotwork.doublePrevention.service.StatisticsService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerCheckTaskService; +import com.gk.hotwork.doublePrevention.service.baseService.PreventProduceDeviceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.*; + + +@Service("statisticsService") +public class StatisticsServiceImpl implements StatisticsService { + + @Autowired + private PreventDangerCheckTaskService preventDangerCheckTaskService; + @Autowired + private PreventProduceDeviceService preventProduceDeviceService; + + @Override + public List<Map> selectInspectorsStatistics(StatisticsInspectorReqDTO reqDTO) { + LocalDateTime startTime = null; + LocalDateTime endTime = null; + if (reqDTO.getStartTime() != null) { + startTime = LocalDateTime.ofInstant(reqDTO.getStartTime().toInstant(), ZoneId.systemDefault()); + } + if (reqDTO.getEndTime() != null) { + endTime = LocalDateTime.ofInstant(reqDTO.getEndTime().toInstant(), ZoneId.systemDefault()); + } + Long depId = reqDTO.getDepId(); + Calendar instance = Calendar.getInstance(); + instance.setTime(new Date()); + if (endTime == null) { + endTime = LocalDate.now().atTime(23, 59, 59); + } + if (startTime == null) { + startTime = LocalDate.now().minusDays(7).atStartOfDay(); + } + List<String> list = new ArrayList<>(); + // 解析出每天 + LocalDateTime loopTime = startTime.plusDays(0); + while(loopTime.isBefore(endTime)){//当明天不在结束时间之前是终止循环 + list.add(loopTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + loopTime = loopTime.plusDays(1L); + } + + return preventDangerCheckTaskService.selectInspectorsStatistics(depId,list, startTime, endTime); + } + + @Override + public List<Map> selectInspectionCompleted(StatisticsInspectionCompletedReqDTO reqDTO) { + LocalDateTime startTime = null; + LocalDateTime endTime = null; + if (reqDTO.getStartTime() != null) { + startTime = LocalDateTime.ofInstant(reqDTO.getStartTime().toInstant(), ZoneId.systemDefault()); + } + if (reqDTO.getEndTime() != null) { + endTime = LocalDateTime.ofInstant(reqDTO.getEndTime().toInstant(), ZoneId.systemDefault()); + } + Long depId = reqDTO.getDepId(); + Calendar instance = Calendar.getInstance(); + instance.setTime(new Date()); + if (endTime == null) { + endTime = LocalDate.now().atTime(23, 59, 59); + } + if (startTime == null) { + startTime = LocalDate.now().minusDays(7).atStartOfDay(); + } + List<String> list = new ArrayList<>(); + // 解析出每天 + LocalDateTime loopTime = startTime.plusDays(0); + while(loopTime.isBefore(endTime)){//当明天不在结束时间之前是终止循环 + list.add(loopTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + loopTime = loopTime.plusDays(1L); + } + return preventDangerCheckTaskService.selectInspectionCompleted(depId,reqDTO.getStatus(),list, startTime, endTime); + } + + @Override + public Map<String,List<Map>> selectInspectionTask(StatisticsInspectionTaskReqDTO reqDTO) { + LocalDateTime startTime = null; + LocalDateTime endTime = null; + if (reqDTO.getStartTime() != null) { + startTime = LocalDateTime.ofInstant(reqDTO.getStartTime().toInstant(), ZoneId.systemDefault()); + } + if (reqDTO.getEndTime() != null) { + endTime = LocalDateTime.ofInstant(reqDTO.getEndTime().toInstant(), ZoneId.systemDefault()); + } + Long depId = reqDTO.getDepId(); + Calendar instance = Calendar.getInstance(); + instance.setTime(new Date()); + if (endTime == null) { + endTime = LocalDate.now().atTime(23, 59, 59); + } + if (startTime == null) { + startTime = LocalDate.now().minusDays(7).atStartOfDay(); + } + List<String> list = new ArrayList<>(); + // 解析出每天 + LocalDateTime loopTime = startTime.plusDays(0); + while(loopTime.isBefore(endTime)){//当明天不在结束时间之前是终止循环 + list.add(loopTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + loopTime = loopTime.plusDays(1L); + } + // 当日已认领 + List<Map> claimedData = preventDangerCheckTaskService.selectInspectionClaimedTask(depId, list, startTime, endTime); + // 巡检完成数量 + List<Map> completedData = preventDangerCheckTaskService.selectInspectionCompletedTask(depId, list, startTime, endTime); + // 巡检领取未完成数量 + List<Map> uncompletedData = preventDangerCheckTaskService.selectInspectionUnCompletedTask(depId, list, startTime, endTime); + Map<String, List<Map>> result = new HashMap<>(); + result.put("claimed", claimedData); + result.put("completed", completedData); + result.put("uncompleted", uncompletedData); + return result; + } + + @Override + public PageInfoExtension<Map> selectPreventDangerPage(StatisticsPreventDangerPageReqDTO reqDTO) { + + if (reqDTO.getPageIndex() == null) { + reqDTO.setPageIndex(0); + } + if (reqDTO.getPageSize() == null || reqDTO.getPageSize() > 500) { + reqDTO.setPageSize(500); + } + Page<PreventDangerCheckTaskRectifyDO> page = new Page<>(reqDTO.getPageIndex(), reqDTO.getPageSize()); + + Map<String, Object> params = new HashMap<>(); + params.put("serialCode", reqDTO.getSerialCode()); + params.put("dangerLevel", reqDTO.getDangerLevel()); + params.put("dangerType", reqDTO.getDangerType()); + params.put("dangerSource", reqDTO.getDangerSource()); + params.put("dangerStatus", reqDTO.getDangerStatus()); + params.put("acceptPersonName", reqDTO.getAcceptPersonName()); + params.put("liablePersonName", reqDTO.getLiablePersonName()); + params.put("registantName", reqDTO.getRegistantName()); + List<PreventDangerCheckTaskRectifyDO> dbData = preventDangerCheckTaskService.selectPreventDangerPage(page, params); + List<PreventDangerCheckTaskRectifyRespDTO> result = new ArrayList<>(dbData.size()); + if (dbData.size() > 0) { + for (PreventDangerCheckTaskRectifyDO rectifyDO : dbData) { + PreventDangerCheckTaskRectifyRespDTO respDTO = new PreventDangerCheckTaskRectifyRespDTO(); + + respDTO.setManageId(rectifyDO.getManageId()); + respDTO.setManageUuid(rectifyDO.getManageUuid()); + respDTO.setRegisterTime(rectifyDO.getRegisterTime()); + respDTO.setDangerLevel(rectifyDO.getDangerLevel()); + respDTO.setDangerType(rectifyDO.getDangerType()); + respDTO.setDangerSource(rectifyDO.getDangerSource()); + respDTO.setDangerStatus(rectifyDO.getDangerStatus()); + respDTO.setRegistantId(rectifyDO.getRegistantId()); + respDTO.setProduceDeviceId(rectifyDO.getProduceDeviceId()); + respDTO.setDangerCode(rectifyDO.getDangerCode()); + respDTO.setRegistantName(rectifyDO.getRegistantName()); + respDTO.setDangerDesc(rectifyDO.getDangerDesc()); + respDTO.setDangerReason(rectifyDO.getDangerReason()); + respDTO.setDangerResult(rectifyDO.getDangerResult()); + respDTO.setDepId(rectifyDO.getDepId()); + respDTO.setRiskUnitId(rectifyDO.getRiskUnitId()); + respDTO.setDangerReview(rectifyDO.getDangerReview()); + respDTO.setDangerCloseReason(rectifyDO.getDangerCloseReason()); + respDTO.setRectifyId(rectifyDO.getRectifyId()); + respDTO.setRectifyType(rectifyDO.getRectifyType()); + respDTO.setRectifyTime(rectifyDO.getRectifyTime()); + respDTO.setLiablePersonId(rectifyDO.getLiablePersonId()); + respDTO.setCheckAcceptTime(rectifyDO.getCheckAcceptTime()); + respDTO.setCheckAcceptPersonId(rectifyDO.getCheckAcceptPersonId()); + respDTO.setLiablePerson(rectifyDO.getLiablePerson()); + respDTO.setCheckAcceptPerson(rectifyDO.getCheckAcceptPerson()); + respDTO.setRectifyDepId(rectifyDO.getRectifyDepId()); + respDTO.setRectifyDesc(rectifyDO.getRectifyDesc()); + respDTO.setCost(rectifyDO.getCost()); + respDTO.setRectifyApplyTime(rectifyDO.getRectifyApplyTime()); + respDTO.setTimeOutDesc(rectifyDO.getTimeOutDesc()); + respDTO.setRectifyInfo(rectifyDO.getRectifyInfo()); + result.add(respDTO); + + } + } + Page<PreventDangerCheckTaskRectifyRespDTO> resultPage = new Page<>(); + resultPage.setRecords(result); + resultPage.setTotal(page.getTotal()); + resultPage.setSize(page.getSize()); + resultPage.setCurrent(page.getCurrent()); + resultPage.setPages(page.getPages()); + PageInfoExtension<Map> extension = new PageInfoExtension<>(resultPage); + + // 1. 待整改数量 + Map<String, Integer> extensionData = preventDangerCheckTaskService.selectRectifyNum(); + extension.setExtension(extensionData); + return extension; + } + + @Override + public Map countDeviceEveryLevel() { + return preventProduceDeviceService.countDeviceEveryLevel(); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/AesGcm256Util.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/AesGcm256Util.java new file mode 100644 index 0000000..5e7b40a --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/AesGcm256Util.java @@ -0,0 +1,139 @@ +package com.gk.hotwork.doublePrevention.utils; + +import org.bouncycastle.crypto.DataLengthException; +import org.bouncycastle.crypto.InvalidCipherTextException; +import org.bouncycastle.crypto.engines.AESFastEngine; +import org.bouncycastle.crypto.modes.GCMBlockCipher; +import org.bouncycastle.crypto.params.AEADParameters; +import org.bouncycastle.crypto.params.KeyParameter; + +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.util.Base64; + +/** +* AES-GCM-256 工具类 +* 加解密方法中已调用 Base64 方法 +*/ +public class AesGcm256Util { + private static final SecureRandom SECURE_RANDOM = new +SecureRandom(); + public static final int NONCE_BIT_SIZE = 128; + public static final int MAC_BIT_SIZE = 128; + public static final int KEY_BIT_SIZE = 256; + private AesGcm256Util() { + } + /** + * 创建密钥 + * + * @return 密钥 + */ + public static byte[] key() { + byte[] key = new byte[KEY_BIT_SIZE / 8]; + SECURE_RANDOM.nextBytes(key); + return key; + } + /** + * 创建向量 + * + * @return 向量 + */ +//双重预防机制接口技术文档 + public static byte[] iv() { + byte[] iv = new byte[NONCE_BIT_SIZE / 8]; + SECURE_RANDOM.nextBytes(iv); + return iv; + } + /** + * 编码 + * + * @param hexStr 文本 + * @return 字节数组 + */ + public static byte[] hexToByte(String hexStr) { + int len = hexStr.length(); + byte[] data = new byte[len / 2]; + for (int i = 0; i < len; i += 2) { + data[i / 2] = (byte) ((Character.digit(hexStr.charAt(i), 16) << 4) + + Character.digit(hexStr.charAt(i + 1), 16)); + } + return data; + } + /** + * 转为十六进制 + * + * @param data 字节数组 + * @return 转换结果 + */ + public static String toHex(byte[] data) { + StringBuilder ret = new StringBuilder(); + for (byte datum : data) { + String hex = Integer.toHexString(datum & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + ret.append(hex.toUpperCase()); + } + return ret.toString(); + } + /** + * 加密 + * @param plainText 明文文本 +双重预防机制接口技术文档 + * @param key 密钥 + * @param iv 向量 + * @return 加密字符串 + */ + public static String encrypt(String plainText, byte[] key, byte[] iv) { + String sr; + try { + byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8); + GCMBlockCipher cipher = new GCMBlockCipher(new + AESFastEngine()); + AEADParameters parameters = + new AEADParameters(new KeyParameter(key), +MAC_BIT_SIZE, iv, null); + cipher.init(true, parameters); + byte[] encryptedBytes = new +byte[cipher.getOutputSize(plainBytes.length)]; + int retLen = cipher.processBytes(plainBytes, 0, plainBytes.length, +encryptedBytes, 0); + cipher.doFinal(encryptedBytes, retLen); + sr = Base64.getEncoder().encodeToString(encryptedBytes); + } catch (Exception ex) { + throw new RuntimeException(ex.getMessage()); + } + return sr; + } + /** + * 解密 + * + * @param encryptedText 已加密文本 + * @param key 密钥 + * @param iv 向量 + * @return 已解密文本 + */ + public static String decrypt(String encryptedText, byte[] key, byte[] iv) { + String sr; + try { + byte[] encryptedBytes = Base64.getDecoder().decode(encryptedText); + GCMBlockCipher cipher = new GCMBlockCipher(new + AESFastEngine()); +//双重预防机制接口技术文档 + AEADParameters parameters = + new AEADParameters(new KeyParameter(key), +MAC_BIT_SIZE, iv, null); + cipher.init(false, parameters); + byte[] plainBytes = new +byte[cipher.getOutputSize(encryptedBytes.length)]; + int retLen = cipher.processBytes + (encryptedBytes, 0, encryptedBytes.length, plainBytes, 0); + cipher.doFinal(plainBytes, retLen); + sr = new String(plainBytes, StandardCharsets.UTF_8); + } catch (IllegalArgumentException | IllegalStateException | + DataLengthException | InvalidCipherTextException ex) { + throw new RuntimeException(ex.getMessage()); + } + return sr; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/BeanCopyUtils.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/BeanCopyUtils.java new file mode 100644 index 0000000..4aa56ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/BeanCopyUtils.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.doublePrevention.utils; + +import org.springframework.beans.BeanUtils; + +import java.util.List; +import java.util.stream.Collectors; + +public class BeanCopyUtils { + + private BeanCopyUtils() { + } + + /**练习 + public static Object copyBean(Object source, Class clazz) { + //创建目标对象 + Object result = null; + try { + result = clazz.newInstance(); + //实现属性copy + BeanUtils.copyProperties(source, result); + + } catch (Exception e) { + e.printStackTrace(); + } + //返回结果 + return result; + }*/ + + public static <V> V copyBean(Object source,Class<V> clazz) { + //创建目标对象 + V result = null; + try { + result = clazz.newInstance(); + //实现属性copy + BeanUtils.copyProperties(source, result); + } catch (Exception e) { + e.printStackTrace(); + } + //返回结果 + return result; + } + + /**练习 + * public static <V> List<V> copyBeanList(List<Object> list, Class<V> clazz){ + return list.stream() + .map(o -> copyBean(o, clazz)) + .collect(Collectors.toList()); + }*/ + + public static <O,V> List<V> copyBeanList(List<O> list, Class<V> clazz){ + return list.stream() + .map(o -> copyBean(o, clazz)) + .collect(Collectors.toList()); + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/CacheUserTransfer.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/CacheUserTransfer.java new file mode 100644 index 0000000..e214ef1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/CacheUserTransfer.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.doublePrevention.utils; + +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.co.ContextCacheUser; + +public class CacheUserTransfer { + + + public static ContextCacheUser transfer(UserInfo userInfo) { + ContextCacheUser contextCacheUser = new ContextCacheUser(); + contextCacheUser.setUid(userInfo.getId()); + contextCacheUser.setUsername(userInfo.getUsername()); + contextCacheUser.setPhone(userInfo.getUsername()); + contextCacheUser.setDepId(userInfo.getDepartment()); + contextCacheUser.setDepName(userInfo.getDepartmentname()); + contextCacheUser.setRealName(userInfo.getRealname()); + return contextCacheUser; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/CalcuteDelayLevelUtils.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/CalcuteDelayLevelUtils.java new file mode 100644 index 0000000..10b3bd9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/CalcuteDelayLevelUtils.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.doublePrevention.utils; + +public class CalcuteDelayLevelUtils { + + public static int calcuteDelayLevel(Long delaySeconds){ + if(delaySeconds >= 7200L) + return 18; + else if(delaySeconds >= 3600L) + return 17; + else if(delaySeconds >= 1800L) + return 16; + else if(delaySeconds >= 1200L) + return 15; + else if(delaySeconds >= 600L) + return 14; + else if(delaySeconds >= 540L) + return 13; + else if(delaySeconds >= 480L) + return 12; + else if(delaySeconds >= 420L) + return 11; + else if(delaySeconds >= 360L) + return 10; + else if(delaySeconds >= 300L) + return 9; + else if(delaySeconds >= 240L) + return 8; + else if(delaySeconds >= 180L) + return 7; + else if(delaySeconds >= 120L) + return 6; + else if(delaySeconds >= 60L) + return 5; + else if(delaySeconds >= 30L) + return 4; + else if(delaySeconds >= 10L) + return 3; + else if(delaySeconds >= 5L) + return 2; + else if(delaySeconds >= 1L) + return 1; + else return 1; + } + +// public static void main(String[] args) { +// Date date = new Date(); +// int i = CalcuteDelayLevelUtils.calcuteDelayLevel(date.getTime()/1000000000); +// +// System.out.println(date.getTime()); +// System.out.println(i); +// } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonDateDeserializer.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonDateDeserializer.java new file mode 100644 index 0000000..c8671bb --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonDateDeserializer.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.doublePrevention.utils; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class JsonDateDeserializer extends JsonDeserializer<Date> { + @Override + public Date deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + String date = p.getText(); + try { + return format.parse(date); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonUtils.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonUtils.java new file mode 100644 index 0000000..1ae88e0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/JsonUtils.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.doublePrevention.utils; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gk.hotwork.Domain.Utils.JacksonObjectMapper; + +import java.io.IOException; + + +public final class JsonUtils { + private JsonUtils() {} + + /** + * 将对象序列化成json字符串 + * @param object javaBean + * @return jsonString json字符串 + */ + public static String toJson(Object object) { + try { + return getInstance().writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + /** + * 将json反序列化成对象 + * @param jsonString jsonString + * @param valueType class + * @param <T> T 泛型标记 + * @return Bean + */ + public static <T> T parse(String jsonString, Class<T> valueType) { + try { + return getInstance().readValue(jsonString, valueType); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static ObjectMapper getInstance() { + return JacksonHolder.INSTANCE; + } + + private static class JacksonHolder { + private static ObjectMapper INSTANCE = new JacksonObjectMapper(); + } + +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/SearchParams.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/SearchParams.java new file mode 100644 index 0000000..466812f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/SearchParams.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.doublePrevention.utils; + + +import java.util.Map; + +public class SearchParams { + + + private Long pageIndex; + + private Long pageSize; + + private Map<String, Object> params; + + + public Long getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Long pageIndex) { + this.pageIndex = pageIndex; + } + + public Long getPageSize() { + return pageSize; + } + + public void setPageSize(Long pageSize) { + this.pageSize = pageSize; + } + + public Map<String, Object> getParams() { + return params; + } + + public void setParams(Map<String, Object> params) { + this.params = params; + } +} diff --git a/src/main/java/com/gk/hotwork/doublePrevention/utils/SnowFlow.java b/src/main/java/com/gk/hotwork/doublePrevention/utils/SnowFlow.java new file mode 100644 index 0000000..e6b307f --- /dev/null +++ b/src/main/java/com/gk/hotwork/doublePrevention/utils/SnowFlow.java @@ -0,0 +1,158 @@ +package com.gk.hotwork.doublePrevention.utils; + +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.NetworkInterface; + +/** + * @program: simple_tools + * @description: 雪花算法代码实现 + **/ +public class SnowFlow { + + // 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动) 2022-01-01 00:00:00 + private final static long twepoch = 1640966400000L; + // 机器标识位数 + private final static long workerIdBits = 5L; + // 数据中心标识位数 + private final static long datacenterIdBits = 5L; + // 机器ID最大值 + private final static long maxWorkerId = -1L ^ (-1L << workerIdBits); + // 数据中心ID最大值 + private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); + // 毫秒内自增位 + private final static long sequenceBits = 12L; + // 机器ID偏左移12位 + private final static long workerIdShift = sequenceBits; + // 数据中心ID左移17位 + private final static long datacenterIdShift = sequenceBits + workerIdBits; + // 时间毫秒左移22位 + private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; + + private final static long sequenceMask = -1L ^ (-1L << sequenceBits); + /* 上次生产id时间戳 */ + private static long lastTimestamp = -1L; + // 0,并发控制 + private long sequence = 0L; + + private final long workerId; + // 数据标识id部分 + private final long datacenterId; + + public SnowFlow(){ + this.datacenterId = getDatacenterId(maxDatacenterId); + this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); + } + /** + * @param workerId + * 工作机器ID + * @param datacenterId + * 序列号 + */ + public SnowFlow(long workerId, long datacenterId) { + if (workerId > maxWorkerId || workerId < 0) { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + } + if (datacenterId > maxDatacenterId || datacenterId < 0) { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + } + this.workerId = workerId; + this.datacenterId = datacenterId; + } + /** + * 获取下一个ID + * + * @return + */ + public synchronized long nextId() { + long timestamp = timeGen(); + if (timestamp < lastTimestamp) { + throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); + } + + if (lastTimestamp == timestamp) { + // 当前毫秒内,则+1 + sequence = (sequence + 1) & sequenceMask; + if (sequence == 0) { + // 当前毫秒内计数满了,则等待下一秒 + timestamp = tilNextMillis(lastTimestamp); + } + } else { + sequence = 0L; + } + lastTimestamp = timestamp; + // ID偏移组合生成最终的ID,并返回ID + long nextId = ((timestamp - twepoch) << timestampLeftShift) + | (datacenterId << datacenterIdShift) + | (workerId << workerIdShift) | sequence; + + return nextId; + } + + private long tilNextMillis(final long lastTimestamp) { + long timestamp = this.timeGen(); + while (timestamp <= lastTimestamp) { + timestamp = this.timeGen(); + } + return timestamp; + } + + private long timeGen() { + return System.currentTimeMillis(); + } + + //TODO 两段中心id,一段使用数据中心id,一段使用模块定义的常量 + /** + * <p> + * 获取 maxWorkerId + * </p> + */ + protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) { + StringBuffer mpid = new StringBuffer(); + mpid.append(datacenterId); + String name = ManagementFactory.getRuntimeMXBean().getName(); + if (!name.isEmpty()) { + /* + * GET jvmPid + */ + mpid.append(name.split("@")[0]); + } + /* + * MAC + PID 的 hashcode 获取16个低位 + */ + return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); + } + + /** + * <p> + * 数据标识id部分 + * </p> + */ + protected static long getDatacenterId(long maxDatacenterId) { + long id = 0L; + try { + InetAddress ip = InetAddress.getLocalHost(); + NetworkInterface network = NetworkInterface.getByInetAddress(ip); + if (network == null) { + id = 1L; + } else { + byte[] mac = network.getHardwareAddress(); + id = ((0x000000FF & (long) mac[mac.length - 1]) + | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6; + id = id % (maxDatacenterId + 1); + } + } catch (Exception e) { + System.out.println(" getDatacenterId: " + e.getMessage()); + } + return id; + } + +/* //测试 + public static void main(String[] args) { + SnowFlow snowFlow = new SnowFlow(); +// for (int i = 0; i < 5; i++) { +// System.out.println(snowFlow.nextId()); +// } + System.out.println(snowFlow.nextId()); + }*/ +} diff --git a/src/main/java/com/gk/hotwork/specialWork/common/RocketMQSpecialWorkTemplateHelper.java b/src/main/java/com/gk/hotwork/specialWork/common/RocketMQSpecialWorkTemplateHelper.java new file mode 100644 index 0000000..ab9d03c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/common/RocketMQSpecialWorkTemplateHelper.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.specialWork.common; + +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.transaction.support.TransactionSynchronizationAdapter; + +@Component +public class RocketMQSpecialWorkTemplateHelper { + @Autowired + private RocketMQTemplate rocketMQTemplate; + + /** + * 事务提交后发送MQ + * @param message + * @param <T> + */ + public <T> void syncSend(String destination, T message) { + // 是否开启事务判断 + if (org.springframework.transaction.support.TransactionSynchronizationManager.isSynchronizationActive()) { + org.springframework.transaction.support.TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override + public void afterCommit() { + SendResult sendResult = rocketMQTemplate.syncSend(destination, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("【特殊作业】发送MQ的消息失败"+message); + } + } + }); + } else { + SendResult sendResult = rocketMQTemplate.syncSend(destination, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("【特殊作业】发送MQ的消息失败"+message); + } + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/RuleController.java b/src/main/java/com/gk/hotwork/specialWork/controller/RuleController.java new file mode 100644 index 0000000..61b045f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/RuleController.java @@ -0,0 +1,65 @@ +package com.gk.hotwork.specialWork.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery; +import com.gk.hotwork.specialWork.service.RuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/rule") +public class RuleController extends BaseController { + + @Autowired + private RuleService ruleService; + + /** + * 创建一条规则 + */ + @RequestMapping(value = "/save",method = RequestMethod.POST) + public ResultVO save(Authentication authentication, @Validated @RequestBody ApprovalRuleAddReqDTO ruleAddReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleService.save(currentUser,ruleAddReqDTO); + } + + /** + * 修改规则 + */ + @RequestMapping(value = "/update",method = RequestMethod.POST) + public ResultVO update(Authentication authentication, @Validated @RequestBody ApprovalRuleModReqDTO ruleModReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleService.update(currentUser,ruleModReqDTO); + } + + /** + * 删除 + */ + @RequestMapping(value = "/del",method = RequestMethod.POST) + public ResultVO removeByRuleIds(Authentication authentication, @Validated @RequestBody DeleteForm deleteForm){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleService.removeBatchRule(deleteForm); + } + + + /** + * 列表-分页 + */ + @RequestMapping(value = "/listByPage",method = RequestMethod.POST) + public ResultVO listRuleByPage(Authentication authentication, @RequestBody PageQuery<ApprovalRuleListDbQuery> query){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleService.listRuleByPage(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemController.java b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemController.java new file mode 100644 index 0000000..a90c97e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemController.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.specialWork.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemListRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemPageRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemPageQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemQuery; +import com.gk.hotwork.specialWork.service.RuleItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/work/ruleItem") +public class RuleItemController extends BaseController { + + @Autowired + private RuleItemService ruleItemService; + + + @RequestMapping(value = "/page/list",method = RequestMethod.POST) + public ResultVO<List<ApprovalRuleUnitItemPageRespDTO>> ruleItemPageList(Authentication authentication, @RequestBody PageQuery<ApprovalRuleItemPageQuery> pageQuery) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return ruleItemService.listRuleItemByPage(currentUser, pageQuery); + } + + + @RequestMapping(value = "/list",method = RequestMethod.POST) + public ResultVO<List<ApprovalRuleUnitItemListRespDTO>> ruleItemList(Authentication authentication, @RequestBody ApprovalRuleItemQuery query) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + List<ApprovalRuleUnitItemListRespDTO> data = ruleItemService.listRuleItem(currentUser, query); + return new ResultVO<>(ResultCodes.OK,data); + } + + + @RequestMapping(value = "/save",method = RequestMethod.POST) + public ResultVO<String> ruleItemSave(Authentication authentication, @RequestBody ApprovalRuleItemAddReqDTO addReqDTO) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleItemService.saveRuleItem(currentUser,addReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + + + @RequestMapping(value = "/update",method = RequestMethod.POST) + public ResultVO<String> ruleItemUpdate(Authentication authentication, @RequestBody ApprovalRuleItemModReqDTO modReqDTO) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleItemService.updateRuleItem(currentUser, modReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + + + @RequestMapping(value = "/delete",method = RequestMethod.POST) + public ResultVO<String> ruleItemDelete(Authentication authentication, @RequestBody DeleteForm deleteForm) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleItemService.deleteRuleItem(currentUser, deleteForm); + return new ResultVO<>(ResultCodes.OK); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemMeasureController.java b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemMeasureController.java new file mode 100644 index 0000000..7acf73b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemMeasureController.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.specialWork.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasurePageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasureRespDTO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; +import com.gk.hotwork.specialWork.service.RuleMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("rule/measure") +public class RuleItemMeasureController extends BaseController { + + @Autowired + private RuleMeasureService ruleMeasureService; + /** + * 新增 + */ + @RequestMapping(value = "/save",method = RequestMethod.POST) + public ResultVO save(Authentication authentication, @Validated @RequestBody ApprovalRuleItemMeasureAddReqDTO addReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + + return ruleMeasureService.saveMeasure(currentUser, addReqDTO); + } + /** + * 修改 + */ + @RequestMapping(value = "/mod",method = RequestMethod.POST) + public ResultVO update(Authentication authentication, @Validated @RequestBody ApprovalRuleItemMeasureModReqDTO modReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleMeasureService.modMeasure(currentUser,modReqDTO); + } + /** + * 删除-批量 + */ + @RequestMapping(value = "/delete",method = RequestMethod.POST) + public ResultVO delete(Authentication authentication, @Validated @RequestBody DeleteForm deleteForm){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleMeasureService.deleteByIds(currentUser,deleteForm); + } + /** + * 列表 + */ + + @RequestMapping(value = "/list",method = RequestMethod.POST) + public ResultVO<List<ApprovalRuleMeasureRespDTO>> listRuleStand(Authentication authentication, @RequestBody ApprovalRuleItemMeasureQuery query){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + return ruleMeasureService.listMeasure(currentUser,query); + } + + /** + * 分页 + * @param authentication + * @param query + * @return + */ + + @RequestMapping(value = "/page/list",method = RequestMethod.POST) + public SearchResultVO<List<ApprovalRuleMeasurePageRespDTO>> listRuleStandByPage(Authentication authentication, @RequestBody PageQuery<ApprovalRuleItemMeasureQuery> query){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(query); + return ruleMeasureService.listMeasureByPage(currentUser,query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemStandController.java b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemStandController.java new file mode 100644 index 0000000..957f6a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/RuleItemStandController.java @@ -0,0 +1,89 @@ +package com.gk.hotwork.specialWork.controller; + +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleItemStandPageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleStandListRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandListQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandPageQuery; +import com.gk.hotwork.specialWork.service.RuleStandService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** +* @Description: 审批项标准 +*/ +@RestController +@RequestMapping("work/ruleItemStand") +public class RuleItemStandController extends BaseController { + + @Autowired + private RuleStandService ruleStandService; + /** + * 新增 + */ + @RequestMapping(value = "/save",method = RequestMethod.POST) + public ResultVO save(Authentication authentication, @Validated @RequestBody ApprovalRuleStandAddReqDTO addReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleStandService.saveRuleStand(currentUser, addReqDTO); + return new ResultVO(ResultCodes.OK); + } + /** + * 修改 + */ + @RequestMapping(value = "/update",method = RequestMethod.POST) + public ResultVO update(Authentication authentication, @Validated @RequestBody ApprovalRuleStandModReqDTO modReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleStandService.updateRuleStand(currentUser,modReqDTO); + return new ResultVO(ResultCodes.OK); + } + /** + * 删除-批量 + */ + @RequestMapping(value = "/delete",method = RequestMethod.POST) + public ResultVO delete(Authentication authentication, @RequestBody DeleteForm deleteForm){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + ruleStandService.deleteRuleStand(currentUser,deleteForm); + return new ResultVO(ResultCodes.OK); + } + /** + * 列表 + */ + + @RequestMapping(value = "/list",method = RequestMethod.POST) + public ResultVO<List<ApprovalRuleStandListRespDTO>> listRuleStand(Authentication authentication, @RequestBody ApprovalRuleStandListQuery query){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + List<ApprovalRuleStandListRespDTO> data = ruleStandService.listRuleStand(currentUser,query); + return new ResultVO<>(ResultCodes.OK, data); + } + + /** + * 分页 + * @param authentication + * @param query + * @return + */ + + @RequestMapping(value = "/page/list",method = RequestMethod.POST) + public SearchResultVO<List<ApprovalRuleItemStandPageRespDTO>> listRuleStandByPage(Authentication authentication, @RequestBody PageQuery<ApprovalRuleStandPageQuery> query){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(query); + return ruleStandService.listRuleStandByPage(currentUser,query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/SpecialWorkMinoController.java b/src/main/java/com/gk/hotwork/specialWork/controller/SpecialWorkMinoController.java new file mode 100644 index 0000000..85e0823 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/SpecialWorkMinoController.java @@ -0,0 +1,59 @@ +//package com.gk.hotwork.specialWork.controller; +// +//import com.alibaba.fastjson.JSONObject; +//import com.gk.hotwork.Domain.Vo.ResultVO; +//import com.gk.hotwork.specialWork.service.SpecialWorkMinoService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.RequestBody; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RequestMethod; +//import org.springframework.web.bind.annotation.RestController; +// +///** +// * 特殊作业文件 +// */ +//@RestController +//@RequestMapping("specialWork/file") +//public class SpecialWorkMinoController { +// +// @Autowired +// private SpecialWorkMinoService specialWorkMinoService; +// +// +// +// /** +// * 获取上传路径 +// */ +// @RequestMapping(value = "/getPresignUrl",method = RequestMethod.POST) +// public ResultVO getPresignUrl(@RequestBody JSONObject json) { +// String suffixName = json.getString("suffixName"); +// return specialWorkMinoService.getPresignUrl(suffixName); +// } +// +// /** +// * 查看下载 +// */ +// @RequestMapping(value = "/viewFile",method = RequestMethod.POST) +// public ResultVO viewFile(@RequestBody JSONObject json) { +// String fileName = json.getString("fileName"); +// return specialWorkMinoService.viewFile(fileName); +// } +// +// /** +// * 删除 +// */ +// @RequestMapping(value = "/deleteFile",method = RequestMethod.POST) +// public ResultVO deleteFile(@RequestBody JSONObject json) { +// String fileName = json.getString("fileName"); +// return specialWorkMinoService.deleteFile(fileName); +// } +// /** +// * 批量获取图片路劲 +// */ +//// @RequestMapping(value = "/viewFiles",method = RequestMethod.POST) +//// public String viewFiles(@RequestBody JSONObject json) { +//// String fileNames = json.getString("fileNames"); +//// return specialWorkMinoService.viewFiles(fileNames); +//// } +// +//} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/WorkApplyController.java b/src/main/java/com/gk/hotwork/specialWork/controller/WorkApplyController.java new file mode 100644 index 0000000..6f616a5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/WorkApplyController.java @@ -0,0 +1,233 @@ +package com.gk.hotwork.specialWork.controller; + +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.*; +import com.gk.hotwork.specialWork.model.query.AllWorkApplyPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyApplyingPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyPendingPageQuery; +import com.gk.hotwork.specialWork.service.WorkApplyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@RestController +@RequestMapping("/work") +public class WorkApplyController extends BaseController { + + @Autowired + private WorkApplyService workApplyService; + + /** + * @Description: 动火作业申请 + */ + @RequestMapping(value = "/apply/hot",method = RequestMethod.POST) + public ResultVO<String> workApplyHot(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyHotReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + + /** + * @Description: 受限空间作业申请 + */ + @RequestMapping(value = "/apply/confinedspace",method = RequestMethod.POST) + public ResultVO<String> workApplyConfinedSpace(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyConfinedSpaceReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 盲板抽堵作业申请 + */ + @RequestMapping(value = "/apply/blindPlatePlugging",method = RequestMethod.POST) + public ResultVO<String> workApplyBlindPlatePlugging(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyBlindPlatePluggingReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 高处安全作业申请 + */ + @RequestMapping(value = "/apply/height",method = RequestMethod.POST) + public ResultVO<String> workApplyHeight(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyAtHighReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 断路作业申请 + */ + @RequestMapping(value = "/apply/brokenCircuit",method = RequestMethod.POST) + public ResultVO<String> workApplyBrokenCircuit(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyBrokenCircuitReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 吊装作业申请 + */ + @RequestMapping(value = "/apply/hoisting",method = RequestMethod.POST) + public ResultVO<String> workApplyHoisting(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyHoistingReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 临时用电作业申请 + */ + @RequestMapping(value = "/apply/temporaryPower",method = RequestMethod.POST) + public ResultVO<String> workApplyTemporaryPower(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyTemporaryPowerReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + /** + * @Description: 动土作业申请 + */ + @RequestMapping(value = "/apply/groundBreaking",method = RequestMethod.POST) + public ResultVO<String> workApplyGroundBreaking(Authentication authentication, @RequestBody WorkApplyReqDTO<WorkApplyGroundBreakingReqDTO> applyReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.workApply(currentUser, applyReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + + /** + * @Description: 取消申请 + */ + @RequestMapping(value = "/apply/cancel",method = RequestMethod.POST) + public ResultVO<String> workApplyCancel(Authentication authentication, @RequestBody JSONObject json){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + Long workApplyId = json.getLong("workApplyId"); + workApplyService.cancelWorkApply(currentUser, workApplyId); + return new ResultVO<>(ResultCodes.OK); + } + + + + + /** + * @Description: 申请中的作业 + */ + @RequestMapping(value = "/apply/applying/page/list",method = RequestMethod.POST) + public ResultVO<List<WorkApplyPageRespDTO>> workApplyApplyingPageList(Authentication authentication, @RequestBody PageQuery<WorkApplyApplyingPageQuery> pageQuery){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return workApplyService.listApplyingWorkApplyByPage(currentUser, pageQuery); + } + + /** + * @Description: 已经审批的进度(申请人) + */ + @RequestMapping(value = "/apply/applicant/approved/view",method = RequestMethod.POST) + public ResultVO<ApplicantWorkApprovedApplyDetailRespDTO> workApplyApplyingViewForApplicant(Authentication authentication, @RequestBody JSONObject json){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + Long workApplyId = json.getLong("workApplyId"); + ApplicantWorkApprovedApplyDetailRespDTO data = workApplyService.getApprovedApplyDetailForApplicant(currentUser, workApplyId); + return new ResultVO<>(ResultCodes.OK,data); + } + + + /** + * @Description: 已经审批的进度(审批人) + */ + @RequestMapping(value = "/apply/approver/approved/view",method = RequestMethod.POST) + public ResultVO<ApproverWorkApprovedApplyDetailRespDTO> workApplyApplyingViewForApprover(Authentication authentication, @RequestBody JSONObject json){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + Long workApplyId = json.getLong("workApplyId"); + ApproverWorkApprovedApplyDetailRespDTO data = workApplyService.getApprovedApplyDetailForApprover(currentUser, workApplyId); + return new ResultVO<>(ResultCodes.OK,data); + } + + /** + * @Description: 获取当前层级审批数据(审批人) + */ + @RequestMapping(value = "/approval/pending/data",method = RequestMethod.POST) + public ResultVO<ApproverWorkPendingApprovalDataRespDTO> getPendingApprovalData(Authentication authentication, @RequestBody JSONObject json){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + Long workApplyId = json.getLong("workApplyId"); + ApproverWorkPendingApprovalDataRespDTO data = workApplyService.getPendingApprovalData(currentUser, workApplyId); + return new ResultVO<>(ResultCodes.OK,data); + } + + + /** + * @Description: 待审批的作业(给work所出层级的每个单元) + */ + @RequestMapping(value = "/apply/pending/page/list",method = RequestMethod.POST) + public ResultVO<List<WorkApplyPendingPageRespDTO>> workApplyPendingPageList(Authentication authentication, @RequestBody PageQuery<WorkApplyPendingPageQuery> pageQuery){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return workApplyService.listPendingWorkApplyByPage(currentUser, pageQuery); + } + + /** + * @Description: 审批 + */ + + @RequestMapping(value = "/apply/approve",method = RequestMethod.POST) + public ResultVO<String> workApplyApprove(Authentication authentication, @RequestBody ApprovalItemDataReqDTO approvalItemData){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.approveItem(currentUser, approvalItemData); + return new ResultVO<>(ResultCodes.OK); + } + + + @RequestMapping(value = "/apply/abord",method = RequestMethod.POST) + public ResultVO<String> workApplyAbord(Authentication authentication, @RequestBody ApprovalItemAbordDataReqDTO abordDataReqDTO){ + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.abordItem(currentUser, abordDataReqDTO); + return new ResultVO<>(ResultCodes.OK); + } + + + /** + * + * 作业票导出 + * @param authentication + * @param json + * @param response + */ + @RequestMapping(value = "/apply/printing",method = RequestMethod.POST) + public void workApplyPrinting(Authentication authentication, @RequestBody JSONObject json, HttpServletResponse response){ + Long applyWorkId = json.getLong("applyWorkId"); + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workApplyService.printing(currentUser,applyWorkId,response); + } + + + /** + * @Description: 所有申请记录 非仅对申请人查看 + */ + @RequestMapping(value = "/apply/all/page/list",method = RequestMethod.POST) + public ResultVO<List<AllWorkApplyPageRespDTO>> workApplyAllPageList(Authentication authentication, @RequestBody PageQuery<AllWorkApplyPageQuery> pageQuery) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return workApplyService.listAllWorkApply(currentUser, pageQuery); + } + + /** + * @Description: 所有申请记录的 单条记录详情查询 + */ + @RequestMapping(value = "/apply/others/view",method = RequestMethod.POST) + public ResultVO<OthersWorkApprovedApplyDetailRespDTO> workApplyApplyingViewForOthers(Authentication authentication, @RequestBody JSONObject json) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + Long workApplyId = json.getLong("workApplyId"); + OthersWorkApprovedApplyDetailRespDTO detail = workApplyService.getWorkApplyDetailForOthers(currentUser, workApplyId); + return new ResultVO<>(ResultCodes.OK, detail); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/WorkProcessController.java b/src/main/java/com/gk/hotwork/specialWork/controller/WorkProcessController.java new file mode 100644 index 0000000..34ce1ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/WorkProcessController.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.specialWork.controller; + + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.gk.hotwork.Config.Oauth2.RedisKeyEnum; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Domain.Utils.CommonUtil; +import com.gk.hotwork.Domain.Utils.PageUtils; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer; +import com.gk.hotwork.specialWork.model.dto.req.WorkProcessDetectionReqDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyReportableRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkProcessDetectionInfoRespDTO; +import com.gk.hotwork.specialWork.model.query.WorkProcessDetectionPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkProcessWorkApplyQuery; +import com.gk.hotwork.specialWork.service.WorkProcessService; +import org.apache.tomcat.util.net.openssl.ciphers.Authentication; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("work/process") +public class WorkProcessController extends BaseController { + + @Autowired + private WorkProcessService workProcessService; + + + + /** + * @Description: 查询可上传的作业信息 + */ + @RequestMapping(value = "/workApply/list", method = RequestMethod.POST) + public ResultVO<List<WorkApplyReportableRespDTO>> workApplyList(Authentication authentication, @RequestBody WorkProcessWorkApplyQuery query) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + List<WorkApplyReportableRespDTO> result = workProcessService.listReportableWorkApply(currentUser, query); + return new ResultVO<>(ResultCodes.OK, result); + } + + + /** + * @Description: 检测上报 + */ + @RequestMapping(value = "/detection/report", method = RequestMethod.POST) + public ResultVO detectionReport(Authentication authentication, @RequestBody WorkProcessDetectionReqDTO reqDTO) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + workProcessService.detectionReport(currentUser, reqDTO); + return new ResultVO(ResultCodes.OK); + } + + + /** + * @Description: 检测分页 + */ + @RequestMapping(value = "/detection/page/list", method = RequestMethod.POST) + public ResultVO<List<WorkProcessDetectionInfoRespDTO>> detectionPageList(Authentication authentication, @RequestBody PageQuery<WorkProcessDetectionPageQuery> pageQuery) { + ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser()); + PageUtils.checkCheck(pageQuery); + return workProcessService.listDetectionByPage(currentUser, pageQuery); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/controller/WorkStatisticController.java b/src/main/java/com/gk/hotwork/specialWork/controller/WorkStatisticController.java new file mode 100644 index 0000000..caa51dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/controller/WorkStatisticController.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.specialWork.controller; + +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkDepStatisticRespDTO; +import com.gk.hotwork.specialWork.service.WorkStatisticService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/specialWork/statistic") +public class WorkStatisticController { + @Autowired + private WorkStatisticService workStatisticService; + @RequestMapping(value = "/getCountByDep",method = RequestMethod.POST) + public ResultVO<List<WorkDepStatisticRespDTO>> getWorkApplyCountByDep(Authentication authentication){ + return workStatisticService.getWorkApplyCountByDep(); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRule.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRule.java new file mode 100644 index 0000000..7f2af95 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRule.java @@ -0,0 +1,159 @@ +package com.gk.hotwork.specialWork.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批规则 + */ +@TableName("approval_rule") +public class ApprovalRule implements Serializable { + + private static final long serialVersionUID = 995929669060725337L; + /** 规则ID **/ + @TableId(type = IdType.AUTO) + private Long ruleId; + + //规则名称 + private String ruleName; + + /** 企业ID **/ + private Long eid; + + /** 部门ID **/ + private Long depId; + + /** 规则状态 **/ + private Byte status; + + /** 作业类型 **/ + private Byte workType; + + //作业等级 + private Byte workLevel; + + /** 创建时间 **/ + private LocalDateTime gmtCreate; + + /** 修改时间 **/ + private LocalDateTime gmtModified; + + /** 创建人ID **/ + private Long createUid; + + /** 创建人姓名 **/ + private String createUname; + + private Long modifiedUid; + + private String modifiedUname; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasure.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasure.java new file mode 100644 index 0000000..66dc8cd --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasure.java @@ -0,0 +1,140 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@TableName("approval_rule_item_measure") +public class ApprovalRuleItemMeasure implements Serializable { + + private static final long serialVersionUID = -631244722545114532L; + //ID,主键 + @TableId(type = IdType.AUTO) + private Long id; + + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //安全措施状态 + private Byte status; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasureDO.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasureDO.java new file mode 100644 index 0000000..cd9b4af --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemMeasureDO.java @@ -0,0 +1,75 @@ +package com.gk.hotwork.specialWork.entity; + +import java.io.Serializable; + +public class ApprovalRuleItemMeasureDO implements Serializable { + + private static final long serialVersionUID = 870000560954158778L; + //ID,主键 + private Long id; + + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //安全措施状态 + private Byte status; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStand.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStand.java new file mode 100644 index 0000000..0ac5d8d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStand.java @@ -0,0 +1,198 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 审批规则--填报事项标准 + */ +@TableName("approval_rule_item_stand") +public class ApprovalRuleItemStand implements Serializable { + + private static final long serialVersionUID = 957318531983481233L; + //标准ID + @TableId(type = IdType.AUTO) + private Long id; + + //标准类型 压力 温度.... + private Byte type; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + private String title; + + //描述信息 + private String info; + //状态 + private Byte status; + + private LocalDateTime gmtCreate; + + private Long createUid; + + private String createUname; + + private LocalDateTime gmtModified; + + private Long modifiedUid; + + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStandDO.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStandDO.java new file mode 100644 index 0000000..6f8ef1b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleItemStandDO.java @@ -0,0 +1,134 @@ +package com.gk.hotwork.specialWork.entity; + + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 审批规则--填报事项标准 + */ +public class ApprovalRuleItemStandDO implements Serializable { + + private static final long serialVersionUID = -5102256461690831563L; + //标准ID + private Long id; + + //标准类型 压力 温度.... + private Byte type; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + private String title; + + //描述 + private String info; + + //状态 + private Byte status; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleStep.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleStep.java new file mode 100644 index 0000000..b2f12e3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleStep.java @@ -0,0 +1,215 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批规则 - 层级 + */ +@TableName("approval_rule_step") +public class ApprovalRuleStep implements Serializable { + + private static final long serialVersionUID = 6998846947389029013L; + /** 层级ID **/ + @TableId(type = IdType.AUTO) + private Long stepId; + + /** + * 层级名称 + */ + private String stepName; + + /** 所属规则ID **/ + private Long ruleId; + + /** 层级规则状态 **/ + private Byte status; + + /** 层级所在顺序 **/ + private Integer stepSerial; + + /** 层级内部有序标识 **/ + private Boolean enableOrder; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + //审批环节有效时间 + private Integer continueTime; + + //审批环节有效时间单位 + private Byte continueTimeUnit; + + //前一个节点 + private Long preStepId; + + //下一个节点 + private Long nextStepId; + + private LocalDateTime gmtCreate; + + private LocalDateTime gmtModified; + + /** 创建人ID **/ + private Long createUid; + + /** 创建人姓名 **/ + private String createUname; + + private Long modifiedUid; + + private String modifiedUname; + + /** + * 审核(0 单审,1 会审) + */ + private Byte auditType; + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public Boolean getEnableOrder() { + return enableOrder; + } + + public void setEnableOrder(Boolean enableOrder) { + this.enableOrder = enableOrder; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Integer getContinueTime() { + return continueTime; + } + + public void setContinueTime(Integer continueTime) { + this.continueTime = continueTime; + } + + public Byte getContinueTimeUnit() { + return continueTimeUnit; + } + + public void setContinueTimeUnit(Byte continueTimeUnit) { + this.continueTimeUnit = continueTimeUnit; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnit.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnit.java new file mode 100644 index 0000000..f5c2649 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnit.java @@ -0,0 +1,175 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批规则 - 层级 - 单元 + */ +@TableName("approval_rule_unit") +public class ApprovalRuleUnit implements Serializable { + + private static final long serialVersionUID = 6632336106003849335L; + /** 单元规则ID **/ + @TableId(type = IdType.AUTO) + private Long unitId; + + /** 所属规则ID **/ + private Long ruleId; + + /** 层级ID **/ + private Long stepId; + + /** 单元规则状态 **/ + private Byte status; + + /** 单元所在顺序 **/ + private Integer unitSerial; + + /** 绑定部门ID **/ + private Long bindDepId; + + private String bindDepName; + + /** 绑定人员ID **/ + private Long bindUid; + + private String bindUname; + + private LocalDateTime gmtCreate; + + private LocalDateTime gmtModified; + + /** 创建人ID **/ + private Long createUid; + + /** 创建人姓名 **/ + private String createUname; + + private Long modifiedUid; + + private String modifiedUname; + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getUnitSerial() { + return unitSerial; + } + + public void setUnitSerial(Integer unitSerial) { + this.unitSerial = unitSerial; + } + + public Long getBindDepId() { + return bindDepId; + } + + public void setBindDepId(Long bindDepId) { + this.bindDepId = bindDepId; + } + + public Long getBindUid() { + return bindUid; + } + + public void setBindUid(Long bindUid) { + this.bindUid = bindUid; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getBindDepName() { + return bindDepName; + } + + public void setBindDepName(String bindDepName) { + this.bindDepName = bindDepName; + } + + public String getBindUname() { + return bindUname; + } + + public void setBindUname(String bindUname) { + this.bindUname = bindUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItem.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItem.java new file mode 100644 index 0000000..706bc5c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItem.java @@ -0,0 +1,187 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批规则 - 填报项 + */ +@TableName("approval_rule_item") +public class ApprovalRuleUnitItem implements Serializable { + + private static final long serialVersionUID = 5444442938244807805L; + //审批规则 - 填报项ID + @TableId(type = IdType.AUTO) + private Long id; + + //填报项名称 + private String itemName; + //所属规则ID + private Long ruleId; + + //所属规则层级ID + private Long stepId; + + //所属审批规则审批单元ID + private Long unitId; + + //该审批项类型 + //填报类型 数值、选项、填空... + private Byte type; + + //类型为安全措施(选项、填空)时不为null,否则为null + private Long measureId; + + //类型为数值时不为null,否则为null + //适应审批项填报标准ID + private Long standId; + + //区分标准和措施项 + private Byte smType; + + private Byte status; + + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public Byte getSmType() { + return smType; + } + + public void setSmType(Byte smType) { + this.smType = smType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItemDO.java b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItemDO.java new file mode 100644 index 0000000..d4f5f4e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/ApprovalRuleUnitItemDO.java @@ -0,0 +1,97 @@ +package com.gk.hotwork.specialWork.entity; + +import java.io.Serializable; + +/** + * 审批规则 - 填报项 + */ +public class ApprovalRuleUnitItemDO implements Serializable { + + private static final long serialVersionUID = -7526204862183195818L; + //审批规则 - 填报项ID + private Long id; + + //填报项名称 + private String itemName; + //所属规则ID + private Long ruleId; + + //所属规则层级ID + private Long stepId; + + //所属审批规则审批单元ID + private Long unitId; + + //该审批项类型 + private Byte type; + + //适应审批项填报标准ID + private Long standId; + + private Byte status; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyCountDO.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyCountDO.java new file mode 100644 index 0000000..1f22ec5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyCountDO.java @@ -0,0 +1,34 @@ +package com.gk.hotwork.specialWork.entity; + +public class WorkApplyCountDO { + //部门id + private Long depId; + //数量 + private Integer count; + //作业类型 + private Byte workType; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyInfo.java new file mode 100644 index 0000000..65d3066 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyInfo.java @@ -0,0 +1,295 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 通用特殊作业信息 + */ +@TableName("work_apply") +public class WorkApplyInfo implements Serializable { + + private static final long serialVersionUID = 6581627675660013530L; + //作业ID + @TableId(type = IdType.AUTO) + private Long id; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + private String depName; + + //申请人员ID + private Long applyUid; + + private String applyUname; + + //作业类型 + private Byte workType; + + //作业等级 + private Byte workLevel; + + //作业状态 + private Byte status; + + //当前所处审批流程层级 + private Integer approvalStep; + + private Long approvalStepId; + + //申请时间 + private LocalDateTime applyTime; + + //预期作业开始进行时间 + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + private LocalDateTime expEndTime; + + private LocalDateTime gmtCreate; + + private LocalDateTime gmtModified; + + //作业证编号 + private String workPermitNo; + + //作业人 + private Long operatorUid; + //作业人 + private String operatorUname; + + private String operatorUnames; + + private String operatorCompanys; + + //作业人编号 + private String operatorCertificate; + // 作业内容 + private String workContent; + + // 作业地点 + private String workLocation; + + // 危害辨识 + private String hazardIdentification; + + // 八大作业id + private Long workDetailId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public Long getApprovalStepId() { + return approvalStepId; + } + + public void setApprovalStepId(Long approvalStepId) { + this.approvalStepId = approvalStepId; + } + + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public Long getWorkDetailId() { + return workDetailId; + } + + public void setWorkDetailId(Long workDetailId) { + this.workDetailId = workDetailId; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyOperatorInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyOperatorInfo.java new file mode 100644 index 0000000..069e866 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyOperatorInfo.java @@ -0,0 +1,82 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("work_apply_operator") +public class WorkApplyOperatorInfo implements Serializable { + + private static final long serialVersionUID = -8636087653753639806L; + + private Long id; + + private Long operatorUid; + + private Long workApplyId; + + private String operatorUname; + + private String operatorCertificate; + + private String operatorPhone; + + private String operatorIdentify; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public String getOperatorPhone() { + return operatorPhone; + } + + public void setOperatorPhone(String operatorPhone) { + this.operatorPhone = operatorPhone; + } + + public String getOperatorIdentify() { + return operatorIdentify; + } + + public void setOperatorIdentify(String operatorIdentify) { + this.operatorIdentify = operatorIdentify; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyRecordInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyRecordInfo.java new file mode 100644 index 0000000..05b5c2a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyRecordInfo.java @@ -0,0 +1,118 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@TableName("work_apply_record") +public class WorkApplyRecordInfo implements Serializable { + + private static final long serialVersionUID = -6231491035008625071L; + + @TableId(type = IdType.AUTO) + private Long id; + + private Long workApplyId; + + private Long stepId; + + private String stepName; + + private Long operatorUid; + + private String operatorUname; + + private LocalDateTime operationTime; + // 是否是系统操作 + private Boolean systen; + + private Integer operation; + + private String content; + //填报数据项 氮气浓度 12 PPM/M3 + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Integer getOperation() { + return operation; + } + + public void setOperation(Integer operation) { + this.operation = operation; + } + + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Boolean getSysten() { + return systen; + } + + public void setSysten(Boolean systen) { + this.systen = systen; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyReportableDO.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyReportableDO.java new file mode 100644 index 0000000..ddb7a61 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApplyReportableDO.java @@ -0,0 +1,116 @@ +package com.gk.hotwork.specialWork.entity; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyReportableDO implements Serializable { + + private static final long serialVersionUID = 8647991114166026383L; + + private Long id; + + //作业类型 + private Byte workType; + + //作业等级 + private Byte workLevel; + + //作业证编号 + private String workPermitNo; + + private String workContent; + + // 作业地点 + private String workLocation; + + // 危害辨识 + private String hazardIdentification; + + + private LocalDateTime expStartTime; + + private LocalDateTime expEndTime; + + private Byte status; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalFilledItemInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalFilledItemInfo.java new file mode 100644 index 0000000..e54fc7b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalFilledItemInfo.java @@ -0,0 +1,106 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; + +@TableName("work_approval_filled_item") +public class WorkApprovalFilledItemInfo implements Serializable { + + private static final long serialVersionUID = -2041475980387285234L; + + @TableId(type = IdType.AUTO) + private Long id; + + private Long unitId; + + private Long itemId; + + private BigDecimal val; + + private Long workApplyId; + + private Byte measureVal; + + private String measureText; + + private String analysisLocation; + + // 0不涉及,1涉及 + private Byte fillType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public BigDecimal getVal() { + return val; + } + + public void setVal(BigDecimal val) { + this.val = val; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getMeasureVal() { + return measureVal; + } + + public void setMeasureVal(Byte measureVal) { + this.measureVal = measureVal; + } + + public String getMeasureText() { + return measureText; + } + + public void setMeasureText(String measureText) { + this.measureText = measureText; + } + + public String getAnalysisLocation() { + return analysisLocation; + } + + public void setAnalysisLocation(String analysisLocation) { + this.analysisLocation = analysisLocation; + } + + public Byte getFillType() { + return fillType; + } + + public void setFillType(Byte fillType) { + this.fillType = fillType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemInfo.java new file mode 100644 index 0000000..0458cd6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemInfo.java @@ -0,0 +1,125 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +/** + * 审批填报项 + */ +@TableName("work_approval_item") +public class WorkApprovalItemInfo implements Serializable { + + private static final long serialVersionUID = 2026819456276498677L; + //填报项ID + @TableId(type = IdType.AUTO) + private Long id; + + //填报项名称 + private String itemName; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + //适用标准ID + private Long standId; + + private Long measureId; + +// //填报数值 +// private BigDecimal val; +// +// //安全措施选项值 +// private Byte measureVal; +// +// //安全措施文字填空 +// private String measureText; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemMeasureInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemMeasureInfo.java new file mode 100644 index 0000000..0e973ba --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemMeasureInfo.java @@ -0,0 +1,81 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("work_approval_item_measure") +public class WorkApprovalItemMeasureInfo implements Serializable { + + private static final long serialVersionUID = -1086685019556260448L; + //ID,主键 + @TableId(type = IdType.AUTO) + private Long id; + + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private Long workApplyId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemStandInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemStandInfo.java new file mode 100644 index 0000000..f64e624 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalItemStandInfo.java @@ -0,0 +1,126 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; + +@TableName("work_approval_item_stand") +public class WorkApprovalItemStandInfo implements Serializable { + + private static final long serialVersionUID = 7274625007060066231L; + + private Long id; + + private Byte type; + + private Long eid; + + private Long depId; + + private String depName; + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + private String title; + + private Long workApplyId; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRecord.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRecord.java new file mode 100644 index 0000000..f4e9e8c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRecord.java @@ -0,0 +1,25 @@ +package com.gk.hotwork.specialWork.entity; + +import java.time.LocalDateTime; + +public class WorkApprovalRecord { + + private Long id; + + private Long workId; + + private Long stepId; + + private Long unitId; + + private Long approvalUid; + + private String approvalUname; + + private LocalDateTime execTime; + + private Byte execType; + + private String record; + //填报数据项 氮气浓度 12 PPM/M3 +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRuleInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRuleInfo.java new file mode 100644 index 0000000..e498ace --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalRuleInfo.java @@ -0,0 +1,101 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; + +@TableName("work_approval_rule") +public class WorkApprovalRuleInfo implements Serializable { + + private static final long serialVersionUID = 2156933119667521022L; + + private Long id; + + private Long eid; + + private Long depId; + + private String depName; + + private Byte workType; + + private Byte workLevel; + + private String approvalRuleName; + + private Long approvalRuleId; + + private Long workApplyId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public String getApprovalRuleName() { + return approvalRuleName; + } + + public void setApprovalRuleName(String approvalRuleName) { + this.approvalRuleName = approvalRuleName; + } + + public Long getApprovalRuleId() { + return approvalRuleId; + } + + public void setApprovalRuleId(Long approvalRuleId) { + this.approvalRuleId = approvalRuleId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalStepInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalStepInfo.java new file mode 100644 index 0000000..313642a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalStepInfo.java @@ -0,0 +1,177 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 作业审批层级 + */ +@TableName("work_approval_step") +public class WorkApprovalStepInfo implements Serializable { + + private static final long serialVersionUID = -3614353693742791338L; + //审批层级ID + private Long id; + + //所属作业ID + private Long workApplyId; + + private Byte auditType; + + private String stepName; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + //审批结果 + private Byte approvalResult; + + //审批层级序号 + private Integer stepSerial; + + //开始审批时间 + private LocalDateTime startApprovalTime; + + //预期结束时间 + private LocalDateTime expFinishApprovalTime; + + //结束审批时间 + private LocalDateTime finishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + @TableField(value = "is_contain_item") + private Boolean containItem; + + private Integer continueTime; + + private Byte continueTimeUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getApprovalResult() { + return approvalResult; + } + + public void setApprovalResult(Byte approvalResult) { + this.approvalResult = approvalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + + public LocalDateTime getStartApprovalTime() { + return startApprovalTime; + } + + public void setStartApprovalTime(LocalDateTime startApprovalTime) { + this.startApprovalTime = startApprovalTime; + } + + public LocalDateTime getExpFinishApprovalTime() { + return expFinishApprovalTime; + } + + public void setExpFinishApprovalTime(LocalDateTime expFinishApprovalTime) { + this.expFinishApprovalTime = expFinishApprovalTime; + } + + public LocalDateTime getFinishApprovalTime() { + return finishApprovalTime; + } + + public void setFinishApprovalTime(LocalDateTime finishApprovalTime) { + this.finishApprovalTime = finishApprovalTime; + } + + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + + public Integer getContinueTime() { + return continueTime; + } + + public void setContinueTime(Integer continueTime) { + this.continueTime = continueTime; + } + + public Byte getContinueTimeUnit() { + return continueTimeUnit; + } + + public void setContinueTimeUnit(Byte continueTimeUnit) { + this.continueTimeUnit = continueTimeUnit; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalUnitInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalUnitInfo.java new file mode 100644 index 0000000..4799e83 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkApprovalUnitInfo.java @@ -0,0 +1,135 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批单元 + */ +@TableName("work_approval_unit") +public class WorkApprovalUnitInfo implements Serializable { + + private static final long serialVersionUID = 8519642535315428440L; + + //审批单元ID + private Long id; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //审批人ID + private Long approvalUid; + + private String approvalUname; + + //审批类型 + private Byte type; + + //审批结果 + private Byte result; + + //审批开始时间 + private LocalDateTime approvalStartTime; + + //审批截止时间 + private LocalDateTime approvalEndTime; + + //实际审批时间 + private LocalDateTime approvalActualTime; + + private String fillContent; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public LocalDateTime getApprovalStartTime() { + return approvalStartTime; + } + + public void setApprovalStartTime(LocalDateTime approvalStartTime) { + this.approvalStartTime = approvalStartTime; + } + + public LocalDateTime getApprovalEndTime() { + return approvalEndTime; + } + + public void setApprovalEndTime(LocalDateTime approvalEndTime) { + this.approvalEndTime = approvalEndTime; + } + + public LocalDateTime getApprovalActualTime() { + return approvalActualTime; + } + + public void setApprovalActualTime(LocalDateTime approvalActualTime) { + this.approvalActualTime = approvalActualTime; + } + + public String getApprovalUname() { + return approvalUname; + } + + public void setApprovalUname(String approvalUname) { + this.approvalUname = approvalUname; + } + + public String getFillContent() { + return fillContent; + } + + public void setFillContent(String fillContent) { + this.fillContent = fillContent; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkAtHeightInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkAtHeightInfo.java new file mode 100644 index 0000000..53f7d16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkAtHeightInfo.java @@ -0,0 +1,151 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 高空作业 + */ +@TableName("work_at_height") +public class WorkAtHeightInfo implements Serializable { + + private static final long serialVersionUID = -80486501760063250L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //作业单位 + private Long operationDepId; + //作业单位名称 + private String operationDepName; + //作业高度 + private BigDecimal operationHeight; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getOperationDepName() { + return operationDepName; + } + + public void setOperationDepName(String operationDepName) { + this.operationDepName = operationDepName; + } + + public BigDecimal getOperationHeight() { + return operationHeight; + } + + public void setOperationHeight(BigDecimal operationHeight) { + this.operationHeight = operationHeight; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkBlindPlatePluggingInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkBlindPlatePluggingInfo.java new file mode 100644 index 0000000..468b336 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkBlindPlatePluggingInfo.java @@ -0,0 +1,221 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 盲板抽堵作业 + */ +@TableName("work_blind_plate_plugging") +public class WorkBlindPlatePluggingInfo implements Serializable { + + private static final long serialVersionUID = 170884362269685250L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //盲板编号 + private String bpCode; + //主要介质 + private String mainMedia; + //温度 + private BigDecimal temperature; + //压力 + private BigDecimal pressure; + //盲板材质 + private String bpMaterialQuality; + //盲板规格 + private String bpSpecification; + //盲板位置 + private String bpLocation; + //盲板位置图路径 + private String bpLocationMapPath; + //装盲板时间 + private LocalDateTime installBpTime; + //拆盲板时间 + private LocalDateTime uninstallBpTime; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getBpCode() { + return bpCode; + } + + public void setBpCode(String bpCode) { + this.bpCode = bpCode; + } + + public String getMainMedia() { + return mainMedia; + } + + public void setMainMedia(String mainMedia) { + this.mainMedia = mainMedia; + } + + public BigDecimal getTemperature() { + return temperature; + } + + public void setTemperature(BigDecimal temperature) { + this.temperature = temperature; + } + + public BigDecimal getPressure() { + return pressure; + } + + public void setPressure(BigDecimal pressure) { + this.pressure = pressure; + } + + public String getBpMaterialQuality() { + return bpMaterialQuality; + } + + public void setBpMaterialQuality(String bpMaterialQuality) { + this.bpMaterialQuality = bpMaterialQuality; + } + + public String getBpSpecification() { + return bpSpecification; + } + + public void setBpSpecification(String bpSpecification) { + this.bpSpecification = bpSpecification; + } + + public String getBpLocation() { + return bpLocation; + } + + public void setBpLocation(String bpLocation) { + this.bpLocation = bpLocation; + } + + public String getBpLocationMapPath() { + return bpLocationMapPath; + } + + public void setBpLocationMapPath(String bpLocationMapPath) { + this.bpLocationMapPath = bpLocationMapPath; + } + + public LocalDateTime getInstallBpTime() { + return installBpTime; + } + + public void setInstallBpTime(LocalDateTime installBpTime) { + this.installBpTime = installBpTime; + } + + public LocalDateTime getUninstallBpTime() { + return uninstallBpTime; + } + + public void setUninstallBpTime(LocalDateTime uninstallBpTime) { + this.uninstallBpTime = uninstallBpTime; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkBrokenCircuitInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkBrokenCircuitInfo.java new file mode 100644 index 0000000..120a377 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkBrokenCircuitInfo.java @@ -0,0 +1,170 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 断路作业 + */ +@TableName("work_broken_circuit") +public class WorkBrokenCircuitInfo implements Serializable { + + private static final long serialVersionUID = -51281284707193626L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //作业单位 + private Long operationDepId; + //作业单位名称 + private String operationDepName; + //断路原因 + private String bcReason; + //断路地段图片路径 + private String bcPath; + //断路地段说明 + private String bcExplain; + //作业申请id + private Long workApplyId; + //涉及相关部门 + private String involvedDepIds; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getOperationDepName() { + return operationDepName; + } + + public void setOperationDepName(String operationDepName) { + this.operationDepName = operationDepName; + } + + public String getBcReason() { + return bcReason; + } + + public void setBcReason(String bcReason) { + this.bcReason = bcReason; + } + + public String getBcPath() { + return bcPath; + } + + public void setBcPath(String bcPath) { + this.bcPath = bcPath; + } + + public String getBcExplain() { + return bcExplain; + } + + public void setBcExplain(String bcExplain) { + this.bcExplain = bcExplain; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getInvolvedDepIds() { + return involvedDepIds; + } + + public void setInvolvedDepIds(String involvedDepIds) { + this.involvedDepIds = involvedDepIds; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkConfinedSpaceInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkConfinedSpaceInfo.java new file mode 100644 index 0000000..c4e2e38 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkConfinedSpaceInfo.java @@ -0,0 +1,160 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 受限空间作业 + */ +@TableName("work_confined_space") +public class WorkConfinedSpaceInfo implements Serializable { + + private static final long serialVersionUID = 422161871038970696L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //受限空间所属单位id + private Long csDepId; + //受限空间所属单位名称 + private String csDepName; + //受限空间名称 + private String csName; + //受限空间内原有介质名称 + private String csOriginalName; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCsDepId() { + return csDepId; + } + + public void setCsDepId(Long csDepId) { + this.csDepId = csDepId; + } + + public String getCsDepName() { + return csDepName; + } + + public void setCsDepName(String csDepName) { + this.csDepName = csDepName; + } + + public String getCsName() { + return csName; + } + + public void setCsName(String csName) { + this.csName = csName; + } + + public String getCsOriginalName() { + return csOriginalName; + } + + public void setCsOriginalName(String csOriginalName) { + this.csOriginalName = csOriginalName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkGroundBreakingInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkGroundBreakingInfo.java new file mode 100644 index 0000000..1beccdd --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkGroundBreakingInfo.java @@ -0,0 +1,170 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 动土作业 + */ +@TableName("work_ground_breaking") +public class WorkGroundBreakingInfo implements Serializable { + + private static final long serialVersionUID = -34064447694417633L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //作业单位 + private Long operationDepId; + //作业单位名称 + private String operationDepName; + //动土范围 + private String gbScope; + //动土方式 + private String gbMethod; + //图片路径 + private String gbPath; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getOperationDepName() { + return operationDepName; + } + + public void setOperationDepName(String operationDepName) { + this.operationDepName = operationDepName; + } + + public String getGbScope() { + return gbScope; + } + + public void setGbScope(String gbScope) { + this.gbScope = gbScope; + } + + public String getGbMethod() { + return gbMethod; + } + + public void setGbMethod(String gbMethod) { + this.gbMethod = gbMethod; + } + + public String getGbPath() { + return gbPath; + } + + public void setGbPath(String gbPath) { + this.gbPath = gbPath; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkHoistingInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkHoistingInfo.java new file mode 100644 index 0000000..ea4c3a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkHoistingInfo.java @@ -0,0 +1,131 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 吊装作业 + */ +@TableName("work_hoisting") +public class WorkHoistingInfo implements Serializable { + + private static final long serialVersionUID = -71074699091052073L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //吊装工具名称 + private String hoistingToolName; + //起吊物体质量 + private BigDecimal weightMass; + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getHoistingToolName() { + return hoistingToolName; + } + + public void setHoistingToolName(String hoistingToolName) { + this.hoistingToolName = hoistingToolName; + } + + public BigDecimal getWeightMass() { + return weightMass; + } + + public void setWeightMass(BigDecimal weightMass) { + this.weightMass = weightMass; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkHotInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkHotInfo.java new file mode 100644 index 0000000..3650cac --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkHotInfo.java @@ -0,0 +1,131 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 动火作业信息 + */ +@TableName("work_hot") +public class WorkHotInfo implements Serializable { + private static final long serialVersionUID = 2007659579659777392L; + //主键 + @TableId(type = IdType.AUTO) + private Long id; + + //动火方式 + private String hotMethod; + + //申请作业id + private Long workApplyId; + + //涉及其他作业 + private String otherSpecialWork; + + //状态 + private byte status; + + private LocalDateTime gmtCreate; + + private Long createUid; + + private String createUname; + + private LocalDateTime gmtModified; + + private Long modifiedUid; + + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getHotMethod() { + return hotMethod; + } + + public void setHotMethod(String hotMethod) { + this.hotMethod = hotMethod; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public byte getStatus() { + return status; + } + + public void setStatus(byte status) { + this.status = status; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessDetectionInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessDetectionInfo.java new file mode 100644 index 0000000..8bb4638 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessDetectionInfo.java @@ -0,0 +1,178 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@TableName("work_process_detection") +public class WorkProcessDetectionInfo implements Serializable { + + private static final long serialVersionUID = 5897364901480801285L; + + @TableId(type = IdType.AUTO) + private Long id; + + private Long workApplyId; + + private String workPermitNo; + + private Byte workType; + + private Byte workLevel; + + private LocalDateTime operationTime; + + private Long operatorUid; + + private String operatorUname; + + private String info; + + private BigDecimal combustible; + + private BigDecimal oxygen; + + private BigDecimal carbonMonoxide; + + private BigDecimal hydrogenSulfide; + // 数据状态 + private Byte status; + // 检测结果 0-正常 1-异常 + private Byte result; + + private Byte source; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public BigDecimal getCombustible() { + return combustible; + } + + public void setCombustible(BigDecimal combustible) { + this.combustible = combustible; + } + + public BigDecimal getOxygen() { + return oxygen; + } + + public void setOxygen(BigDecimal oxygen) { + this.oxygen = oxygen; + } + + public BigDecimal getCarbonMonoxide() { + return carbonMonoxide; + } + + public void setCarbonMonoxide(BigDecimal carbonMonoxide) { + this.carbonMonoxide = carbonMonoxide; + } + + public BigDecimal getHydrogenSulfide() { + return hydrogenSulfide; + } + + public void setHydrogenSulfide(BigDecimal hydrogenSulfide) { + this.hydrogenSulfide = hydrogenSulfide; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessWarningInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessWarningInfo.java new file mode 100644 index 0000000..0f4c252 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkProcessWarningInfo.java @@ -0,0 +1,160 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@TableName("work_process_warning") +public class WorkProcessWarningInfo implements Serializable { + + private static final long serialVersionUID = -5145088653001307910L; + + @TableId(type = IdType.AUTO) + private Long id; + + private Long workApplyId; + + private String workPermitNo; + + private String warningContent; + + private Byte warningType; + + private String warningInfo; + + private Long operatorUid; + + private String operatorUname; + + private LocalDateTime operationTime; + + private Byte status; + + private Byte source; + + private Byte workType; + + private Byte workLevel; + + private Long originalId; + + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public String getWarningContent() { + return warningContent; + } + + public void setWarningContent(String warningContent) { + this.warningContent = warningContent; + } + + public Byte getWarningType() { + return warningType; + } + + public void setWarningType(Byte warningType) { + this.warningType = warningType; + } + + public String getWarningInfo() { + return warningInfo; + } + + public void setWarningInfo(String warningInfo) { + this.warningInfo = warningInfo; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Long getOriginalId() { + return originalId; + } + + public void setOriginalId(Long originalId) { + this.originalId = originalId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/entity/WorkTemporaryPowerInfo.java b/src/main/java/com/gk/hotwork/specialWork/entity/WorkTemporaryPowerInfo.java new file mode 100644 index 0000000..135d0f4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/entity/WorkTemporaryPowerInfo.java @@ -0,0 +1,141 @@ +package com.gk.hotwork.specialWork.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 临时用电 + */ +@TableName("work_temporary_power") +public class WorkTemporaryPowerInfo implements Serializable { + + private static final long serialVersionUID = 304253688606329864L; + + //主键 + @TableId(type = IdType.AUTO) + private Long id; + //电源接入点 + private String powerAccessPoint; + //工作电压 + private BigDecimal workingVoltage; + //作业申请id + private Long workApplyId; + //用电设备及功率 + private String equipmentAndPower; + //状态 + private Byte status; + //创建时间 + private LocalDateTime gmtCreate; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime gmtModified; + //修改人id + private Long modifiedUid; + //修改人姓名 + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPowerAccessPoint() { + return powerAccessPoint; + } + + public void setPowerAccessPoint(String powerAccessPoint) { + this.powerAccessPoint = powerAccessPoint; + } + + public BigDecimal getWorkingVoltage() { + return workingVoltage; + } + + public void setWorkingVoltage(BigDecimal workingVoltage) { + this.workingVoltage = workingVoltage; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getEquipmentAndPower() { + return equipmentAndPower; + } + + public void setEquipmentAndPower(String equipmentAndPower) { + this.equipmentAndPower = equipmentAndPower; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalFilledItemType.java b/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalFilledItemType.java new file mode 100644 index 0000000..dca9624 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalFilledItemType.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum ApprovalFilledItemType { + UNINVOLVED((byte)0,"不涉及"), + INVOLVED((byte)1,"涉及"), + ; + + public byte code; + public String value; + + ApprovalFilledItemType(Byte code, String value) { + this.code = code; + this.value = value; + } + + + + static Map<Byte,ApprovalFilledItemType> map; + static { + map = new HashMap<>(); + for (ApprovalFilledItemType type : ApprovalFilledItemType.values()) { + map.put(type.code, type); + } + } + + public static ApprovalFilledItemType parse(Byte code) { + return map.get(code); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalStepTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalStepTypeEnum.java new file mode 100644 index 0000000..23944e9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/ApprovalStepTypeEnum.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum ApprovalStepTypeEnum { + TYPE_SINGLE_PERSON((byte)1,"单人审批"), + TYPE_MULTIPLE_PEOPLE((byte)2,"多人审批"), + TYPE_ANALYST((byte)3,"分析人审批"), + ; + + private Byte type; + private String desc; + + ApprovalStepTypeEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + + static Map<Byte, ApprovalStepTypeEnum> map; + static { + map = new HashMap<>(); + for (ApprovalStepTypeEnum e : ApprovalStepTypeEnum.values()) { + map.put(e.type, e); + } + } + + + public static ApprovalStepTypeEnum parse(Byte type) { + return map.get(type); + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static boolean checkStepType(Byte type){ + boolean flag = false; + for (ApprovalStepTypeEnum stepType:ApprovalStepTypeEnum.values()) { + if (type.equals(stepType.getType())) { + flag = true; + } + } + return flag; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/AuditTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/AuditTypeEnum.java new file mode 100644 index 0000000..d966cb8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/AuditTypeEnum.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.specialWork.enums; + + +import java.util.HashMap; +import java.util.Map; + +/** + * 安全措施类型枚举 + */ +public enum AuditTypeEnum { + + + CONCURRENT_SINGLE_TRIAL((byte) 1, "并行单审"), + CONCURRENT_JOINT_TRIAL((byte) 2, "并行会审"), + + ; + + + AuditTypeEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + Byte type ; + String desc; + + + static Map<Byte, AuditTypeEnum> map; + static { + map = new HashMap<>(); + for (AuditTypeEnum e : AuditTypeEnum.values()) { + map.put(e.type, e); + } + } + + public static AuditTypeEnum parse(Byte type) { + return map.get(type); + } + + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static Map<Byte, AuditTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, AuditTypeEnum> map) { + AuditTypeEnum.map = map; + } + + public static boolean checkMeasureType(Byte type){ + boolean flag = false; + for (AuditTypeEnum mtEnum : AuditTypeEnum.values()) { + if(mtEnum.getType().equals(type)){ + flag = true; + } + } + return flag; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/MeasureTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/MeasureTypeEnum.java new file mode 100644 index 0000000..fb5ea84 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/MeasureTypeEnum.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.specialWork.enums; + + +import java.util.HashMap; +import java.util.Map; + +/** + * 安全措施类型枚举 + */ +public enum MeasureTypeEnum { + + + TYPE_CHOSE((byte) 1, "选择"), + TYPE_INPUT((byte) 2, "填空"), + + ; + + + MeasureTypeEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + Byte type ; + String desc; + + + static Map<Byte, MeasureTypeEnum> map; + static { + map = new HashMap<>(); + for (MeasureTypeEnum e : MeasureTypeEnum.values()) { + map.put(e.type, e); + } + } + + public static MeasureTypeEnum parse(Byte type) { + return map.get(type); + } + + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static Map<Byte, MeasureTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, MeasureTypeEnum> map) { + MeasureTypeEnum.map = map; + } + + public static boolean checkMeasureType(Byte type){ + boolean flag = false; + for (MeasureTypeEnum mtEnum : MeasureTypeEnum.values()) { + if(mtEnum.getType().equals(type)){ + flag = true; + } + } + return flag; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/ProcessOperationEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/ProcessOperationEnum.java new file mode 100644 index 0000000..0ee9f4c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/ProcessOperationEnum.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum ProcessOperationEnum { + + APPLY(0, "提出申请"), + APPROVE(1, "审批"), + CANCEL(2, "取消申请"), + AUTO_REJECT(3, "自动驳回"), + APPROVE_SUCCESS(4, "审批通过"), + ABORD(5, "终止"), + FINISH(6, "作业流转结束"), + + ; + + + ProcessOperationEnum(int code, String value) { + this.code = code; + this.value = value; + } + + public int code; + + public String value; + + static Map<Integer, ProcessOperationEnum> map; + static { + map = new HashMap<>(); + for (ProcessOperationEnum e : ProcessOperationEnum.values()) { + map.put(e.code, e); + } + } + + public static ProcessOperationEnum parse(Integer code) { + return map.get(code); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleContinueTimeUnitEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleContinueTimeUnitEnum.java new file mode 100644 index 0000000..8e6c48a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleContinueTimeUnitEnum.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum RuleContinueTimeUnitEnum { + + TYPE_DAY((byte)1,"日"), + TYPE_HOUR((byte)2,"时"), + TYPE_MINUTE((byte)3,"分"), + TYPE_SECOND((byte)4,"秒"), + ; + + private Byte type; + private String desc; + + RuleContinueTimeUnitEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static boolean checkTimeUnitType(Byte type){ + boolean flag = false; + for (RuleContinueTimeUnitEnum timeUnit : RuleContinueTimeUnitEnum.values()) { + if (type.equals(timeUnit.getType())) { + flag = true; + } + } + return flag; + } + + + static Map<Byte, RuleContinueTimeUnitEnum> map; + static { + map = new HashMap<>(); + for (RuleContinueTimeUnitEnum e : RuleContinueTimeUnitEnum.values()) { + map.put(e.type, e); + } + } + + public static RuleContinueTimeUnitEnum parse(Byte type) { + return map.get(type); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemSmTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemSmTypeEnum.java new file mode 100644 index 0000000..478d8f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemSmTypeEnum.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum RuleItemSmTypeEnum { + + STAND((byte) 1, "标准"), + MEASURE((byte) 2, "措施"), + + ; + + + RuleItemSmTypeEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + Byte type ; + String desc; + + + static Map<Byte, RuleItemSmTypeEnum> map; + static { + map = new HashMap<>(); + for (RuleItemSmTypeEnum e : RuleItemSmTypeEnum.values()) { + map.put(e.type, e); + } + } + + public static RuleItemSmTypeEnum parse(Byte type) { + return map.get(type); + } + + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static Map<Byte, RuleItemSmTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, RuleItemSmTypeEnum> map) { + RuleItemSmTypeEnum.map = map; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStandStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStandStatusEnum.java new file mode 100644 index 0000000..bf7d87f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStandStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum RuleItemStandStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleItemStandStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, RuleItemStandStatusEnum> map; + static { + map = new HashMap<>(); + for (RuleItemStandStatusEnum ruleItemStatusEnum : RuleItemStandStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static RuleItemStandStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStatusEnum.java new file mode 100644 index 0000000..319b587 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum RuleItemStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleItemStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, RuleItemStatusEnum> map; + static { + map = new HashMap<>(); + for (RuleItemStatusEnum ruleItemStatusEnum : RuleItemStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static RuleItemStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemTypeEnum.java new file mode 100644 index 0000000..f7a41e4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleItemTypeEnum.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.enums; + + +import java.util.HashMap; +import java.util.Map; + +public enum RuleItemTypeEnum { + + + NUMERIC((byte) 1, "数值"), + OPTION((byte) 2, "选项"), + FILL((byte) 3, "填空"), + ; + + + RuleItemTypeEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + byte code; + String value; + + + static Map<Byte, RuleItemTypeEnum> map; + static { + map = new HashMap<>(); + for (RuleItemTypeEnum ruleItemTypeEnum : RuleItemTypeEnum.values()) { + map.put(ruleItemTypeEnum.code, ruleItemTypeEnum); + } + } + + public static RuleItemTypeEnum parse(Byte code) { + return map.get(code); + } + + + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureOptEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureOptEnum.java new file mode 100644 index 0000000..d46bcac --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureOptEnum.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum RuleMeasureOptEnum { + + YES((byte) 1, "是"), + NO((byte) 2, "否"), + + ; + + + RuleMeasureOptEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + Byte type ; + String desc; + + + static Map<Byte, RuleMeasureOptEnum> map; + static { + map = new HashMap<>(); + for (RuleMeasureOptEnum e : RuleMeasureOptEnum.values()) { + map.put(e.type, e); + } + } + + public static RuleMeasureOptEnum parse(Byte type) { + return map.get(type); + } + + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static Map<Byte, RuleMeasureOptEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, RuleMeasureOptEnum> map) { + RuleMeasureOptEnum.map = map; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureStatusEnum.java new file mode 100644 index 0000000..e0d952a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleMeasureStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +public enum RuleMeasureStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleMeasureStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public void setCode(byte code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleStandMatchingTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStandMatchingTypeEnum.java new file mode 100644 index 0000000..dc94234 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStandMatchingTypeEnum.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * 值匹配模式 + */ +public enum RuleStandMatchingTypeEnum { + + GREATER_THAN((byte) 1, "大于"), + EQUAL((byte) 2, "等于"), + LESS_THAN((byte) 3, "小于"), + GREATER_THAN_AND_EQUAL((byte) 4, "大于等于"), + LESS_THAN_AND_EQUAL((byte) 5, "小于等于"), + ; + RuleStandMatchingTypeEnum(byte code, String value) { + this.code = code; + this.value = value; + } + byte code; + String value; + static Map<Byte, RuleStandMatchingTypeEnum> map; + static { + map = new HashMap<>(); + for (RuleStandMatchingTypeEnum e : RuleStandMatchingTypeEnum.values()) { + map.put(e.code, e); + } + } + + public static RuleStandMatchingTypeEnum parse(Byte code) { + return map.get(code); + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStatusEnum.java new file mode 100644 index 0000000..5edc156 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +public enum RuleStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public void setCode(byte code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleStepStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStepStatusEnum.java new file mode 100644 index 0000000..02e7896 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleStepStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +public enum RuleStepStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleStepStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public void setCode(byte code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/RuleUnitStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/RuleUnitStatusEnum.java new file mode 100644 index 0000000..e03bd4b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/RuleUnitStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +public enum RuleUnitStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + RuleUnitStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public void setCode(byte code) { + this.code = code; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalStepResultEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalStepResultEnum.java new file mode 100644 index 0000000..57e28b0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalStepResultEnum.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkApprovalStepResultEnum { + WAIT_TO_START((byte)-1,"未开始"), + RESULT_IN_APPROVAL((byte)0,"审批中"), + RESULT_SUCCESS((byte)1,"审批通过"), + RESULT_ABORD((byte)2,"终止"), + + RESULT_OVER_TIME((byte)5,"作业审批超时"), + + RESULT_EXPIRATION_DATE((byte)6,"分析人审批时效过期") + + ; + + private Byte result; + private String desc; + + WorkApprovalStepResultEnum(Byte result, String desc) { + this.result = result; + this.desc = desc; + } + + static Map<Byte, WorkApprovalStepResultEnum> map; + static { + map = new HashMap<>(); + for (WorkApprovalStepResultEnum e : WorkApprovalStepResultEnum.values()) { + map.put(e.result, e); + } + } + public static WorkApprovalStepResultEnum parse(Byte type) { + return map.get(type); + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalUnitResultEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalUnitResultEnum.java new file mode 100644 index 0000000..81f8b2b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkApprovalUnitResultEnum.java @@ -0,0 +1,54 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkApprovalUnitResultEnum { + WAIT_TO_START((byte)-1,"未开始"), + RESULT_IN_APPROVAL((byte)0,"审批中"), + RESULT_SUCCESS((byte)1,"审批通过"), + RESULT_AUTO_REJECT((byte)2,"自动驳回"), + RESULT_ABORD((byte)3,"终止"), + RESULT_INTERRUPTED((byte)4,"审批中断"), + + RESULT_OVER_TIME((byte)5,"审批超时"), + + RESULT_EXPIRATION_DATE((byte)6,"分析人审批时效过期"), + RESULT_APPROVED_UNSUCCESS((byte) 7, "未审批通过"), + ; + + private Byte result; + private String desc; + + WorkApprovalUnitResultEnum(Byte result, String desc) { + this.result = result; + this.desc = desc; + } + + static Map<Byte, WorkApprovalUnitResultEnum> map; + static { + map = new HashMap<>(); + for (WorkApprovalUnitResultEnum e : WorkApprovalUnitResultEnum.values()) { + map.put(e.result, e); + } + } + public static WorkApprovalUnitResultEnum parse(Byte type) { + return map.get(type); + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkAtHeightStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkAtHeightStatusEnum.java new file mode 100644 index 0000000..60d1535 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkAtHeightStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkAtHeightStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkAtHeightStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkAtHeightStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkAtHeightStatusEnum ruleItemStatusEnum : WorkAtHeightStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkAtHeightStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkBlindPlatePluggingStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkBlindPlatePluggingStatusEnum.java new file mode 100644 index 0000000..9cb5c3d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkBlindPlatePluggingStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkBlindPlatePluggingStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkBlindPlatePluggingStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkBlindPlatePluggingStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkBlindPlatePluggingStatusEnum ruleItemStatusEnum : WorkBlindPlatePluggingStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkBlindPlatePluggingStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkBrokenCircuitStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkBrokenCircuitStatusEnum.java new file mode 100644 index 0000000..e026c5d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkBrokenCircuitStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkBrokenCircuitStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkBrokenCircuitStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkBrokenCircuitStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkBrokenCircuitStatusEnum ruleItemStatusEnum : WorkBrokenCircuitStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkBrokenCircuitStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkConfinedSpaceStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkConfinedSpaceStatusEnum.java new file mode 100644 index 0000000..1730f9d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkConfinedSpaceStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkConfinedSpaceStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkConfinedSpaceStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkConfinedSpaceStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkConfinedSpaceStatusEnum ruleItemStatusEnum : WorkConfinedSpaceStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkConfinedSpaceStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkGroundBreakingStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkGroundBreakingStatusEnum.java new file mode 100644 index 0000000..fef30d1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkGroundBreakingStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkGroundBreakingStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkGroundBreakingStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkGroundBreakingStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkGroundBreakingStatusEnum ruleItemStatusEnum : WorkGroundBreakingStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkGroundBreakingStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkHoistingStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkHoistingStatusEnum.java new file mode 100644 index 0000000..8a7212e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkHoistingStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkHoistingStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkHoistingStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkHoistingStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkHoistingStatusEnum ruleItemStatusEnum : WorkHoistingStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkHoistingStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkHotStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkHotStatusEnum.java new file mode 100644 index 0000000..fa1ab3f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkHotStatusEnum.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkHotStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkHotStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, RuleItemStatusEnum> map; + static { + map = new HashMap<>(); + for (RuleItemStatusEnum ruleItemStatusEnum : RuleItemStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static RuleItemStatusEnum parse(Byte code) { + return map.get(code); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkLevelEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkLevelEnum.java new file mode 100644 index 0000000..3607b66 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkLevelEnum.java @@ -0,0 +1,68 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkLevelEnum { + DEFAULT((byte)0,"无等级"), + FIRE_LEVEL_1((byte)1,"一级动火作业"), + FIRE_LEVEL_2((byte)2,"二级动火作业"), + FIRE_LEVEL_3((byte)3,"特级动火作业"), + HIGH_SPACE_LEVEL_1((byte)4,"一级高处作业"), + HIGH_SPACE_LEVEL_2((byte)5,"二级高处作业"), + HIGH_SPACE_LEVEL_3((byte)6,"三级高处作业"), + HIGH_SPACE_LEVEL_4((byte)7,"特级高处作业"), + HANG_LEVEL_1((byte)8,"一级吊装作业"), + HANG_LEVEL_2((byte)9,"二级吊装作业"), + HANG_LEVEL_3((byte)10,"三级吊装作业"), + BLIND_PLATE_LEVEL_C((byte)11,"抽盲板作业"), + BLIND_PLATE_LEVEL_D((byte)12,"堵盲板作业") + ; + + private Byte level; + private String title; + + WorkLevelEnum(Byte level, String title) { + this.level = level; + this.title = title; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public static boolean checkWorkLevel(Byte level){ + boolean flag = false; + for (WorkLevelEnum workLevelEnum : WorkLevelEnum.values()) { + if(workLevelEnum.getLevel().equals(level)){ + flag = true; + } + } + return flag; + } + + + static Map<Byte, WorkLevelEnum> map; + static { + map = new HashMap<>(); + for (WorkLevelEnum levelEnum : WorkLevelEnum.values()) { + map.put(levelEnum.getLevel(), levelEnum); + } + } + + public static WorkLevelEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkModeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkModeEnum.java new file mode 100644 index 0000000..8acadbc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkModeEnum.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * 作业方式 + */ +public enum WorkModeEnum { + + ELECTRIC_WELDING((byte)1,"电焊"), + GAS_CUTTING((byte)2,"气割"), + MANUAL_WHEEL_CUTTING((byte)3,"手动轮切割"), + ; + + private byte type; + private String desc; + + public byte getType() { + return type; + } + + public void setType(byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + WorkModeEnum(byte type, String desc) { + this.type = type; + this.desc = desc; + } + static Map<Byte, WorkModeEnum> map; + static { + map = new HashMap<>(); + for (WorkModeEnum workModeEnum : WorkModeEnum.values()) { + map.put(workModeEnum.type, workModeEnum); + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionResultEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionResultEnum.java new file mode 100644 index 0000000..978b608 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionResultEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkProcessDetectionResultEnum { + NORMAL((byte)1,"正常"), + ABNORMAL((byte)2,"异常"), + ; + + public byte code; + public String value; + + WorkProcessDetectionResultEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + + + static Map<Byte, WorkProcessDetectionResultEnum> map; + static { + map = new HashMap<>(); + for (WorkProcessDetectionResultEnum e : WorkProcessDetectionResultEnum.values()) { + map.put(e.code, e); + } + } + public static WorkProcessDetectionResultEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionStatusEnum.java new file mode 100644 index 0000000..77cd682 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessDetectionStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkProcessDetectionStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + public byte code; + public String value; + + WorkProcessDetectionStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + + + static Map<Byte, WorkProcessDetectionStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkProcessDetectionStatusEnum e : WorkProcessDetectionStatusEnum.values()) { + map.put(e.code, e); + } + } + public static WorkProcessDetectionStatusEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningStatusEnum.java new file mode 100644 index 0000000..927ddf2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningStatusEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkProcessWarningStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + public byte code; + public String value; + + WorkProcessWarningStatusEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + + + static Map<Byte, WorkProcessWarningStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkProcessWarningStatusEnum e : WorkProcessWarningStatusEnum.values()) { + map.put(e.code, e); + } + } + public static WorkProcessWarningStatusEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningTypeEnum.java new file mode 100644 index 0000000..bc23ca2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkProcessWarningTypeEnum.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkProcessWarningTypeEnum { + CHECK((byte)1,"检查"), + DETECTION((byte)2,"检测"), + ; + + public byte code; + public String value; + + WorkProcessWarningTypeEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + + + static Map<Byte, WorkProcessWarningTypeEnum> map; + static { + map = new HashMap<>(); + for (WorkProcessWarningTypeEnum e : WorkProcessWarningTypeEnum.values()) { + map.put(e.code, e); + } + } + public static WorkProcessWarningTypeEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkReportSourceEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkReportSourceEnum.java new file mode 100644 index 0000000..a02d0a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkReportSourceEnum.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkReportSourceEnum { + APP((byte)1,"移动端"), + WEB((byte)2,"网页端"), + ; + + public byte code; + public String value; + + WorkReportSourceEnum(Byte code, String value) { + this.code = code; + this.value = value; + } + + static Map<Byte, WorkReportSourceEnum> map; + static { + map = new HashMap<>(); + for (WorkReportSourceEnum e : WorkReportSourceEnum.values()) { + map.put(e.code, e); + } + } + + public static WorkReportSourceEnum parse(Byte code) { + return map.get(code); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkRuleMeasureOptEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkRuleMeasureOptEnum.java new file mode 100644 index 0000000..720eee4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkRuleMeasureOptEnum.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkRuleMeasureOptEnum { + + YES((byte) 1, "是"), + NO((byte) 2, "否"), + UNINVOLVED((byte) 3, "不涉及"), + ; + + + WorkRuleMeasureOptEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + Byte type ; + String desc; + + + static Map<Byte, WorkRuleMeasureOptEnum> map; + static { + map = new HashMap<>(); + for (WorkRuleMeasureOptEnum e : WorkRuleMeasureOptEnum.values()) { + map.put(e.type, e); + } + } + + public static WorkRuleMeasureOptEnum parse(Byte type) { + return map.get(type); + } + + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static Map<Byte, WorkRuleMeasureOptEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, WorkRuleMeasureOptEnum> map) { + WorkRuleMeasureOptEnum.map = map; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkStandTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkStandTypeEnum.java new file mode 100644 index 0000000..0edff0c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkStandTypeEnum.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkStandTypeEnum { + TYPE_COMBUSTIBLE_GAS((byte) 1,"可燃气"), + TYPE_OXYGEN((byte) 2,"氧气"), + TYPE_HARMFUL((byte)3,"有毒有害气体"), + + + ; + + private Byte type; + private String desc; + + WorkStandTypeEnum(Byte type, String desc) { + this.type = type; + this.desc = desc; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + + static Map<Byte, WorkStandTypeEnum> map; + static { + map = new HashMap<>(); + for (WorkStandTypeEnum standTypeEnum : WorkStandTypeEnum.values()) { + map.put(standTypeEnum.getType(), standTypeEnum); + } + } + + + public static WorkStandTypeEnum parse(Byte code) { + return map.get(code); + } + + + + public static boolean checkWorkStandType(Byte type){ + boolean flag = false; + for (WorkStandTypeEnum workStandTypeEnum : WorkStandTypeEnum.values()){ + if(workStandTypeEnum.getType().equals(type)){ + flag = true; + } + } + return flag; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkStatusEnum.java new file mode 100644 index 0000000..9b318e1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkStatusEnum.java @@ -0,0 +1,58 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkStatusEnum { + + STATU_IN_APPLY((byte)1,"申请中"), + STATU_IN_APPROVAL((byte)2,"审批中"), + STATU_APPROVAL_REJECT((byte)3,"审批被驳回"), + STATU_WAIT_EXEC((byte)4,"作业待进行"), + STATU_IN_EXEC((byte)5,"作业进行中"), + STATU_ABORD((byte)6,"作业终止"), + STATU_FINISH((byte)7,"作业结束"), + STATU_APPLY_CANCEL((byte)8,"作业申请取消"), + STATU_OVER_TIME((byte)9,"作业审批超时"), + + STATU_EXPIRATION_DATE((byte)10,"分析人审批时效过期") + ; + + + private Byte status; + private String desc; + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + WorkStatusEnum(Byte status, String desc) { + this.status = status; + this.desc = desc; + } + + static Map<Byte, WorkStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkStatusEnum statusEnum : WorkStatusEnum.values()) { + map.put(statusEnum.getStatus(), statusEnum); + } + } + + public static WorkStatusEnum parse(Byte code) { + return map.get(code); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkTemporaryPowerStatusEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkTemporaryPowerStatusEnum.java new file mode 100644 index 0000000..48b9c91 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkTemporaryPowerStatusEnum.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum WorkTemporaryPowerStatusEnum { + VALID((byte)1,"有效"), + ABANDONED((byte)-1,"舍弃"), + ; + + byte code; + String value; + + WorkTemporaryPowerStatusEnum(byte code, String value) { + this.code = code; + this.value = value; + } + + public byte getCode() { + return code; + } + + public String getValue() { + return value; + } + + static Map<Byte, WorkTemporaryPowerStatusEnum> map; + static { + map = new HashMap<>(); + for (WorkTemporaryPowerStatusEnum ruleItemStatusEnum : WorkTemporaryPowerStatusEnum.values()) { + map.put(ruleItemStatusEnum.getCode(), ruleItemStatusEnum); + } + } + + public static WorkTemporaryPowerStatusEnum parse(Byte code) { + return map.get(code); + } + + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/enums/WorkTypeEnum.java b/src/main/java/com/gk/hotwork/specialWork/enums/WorkTypeEnum.java new file mode 100644 index 0000000..7c64e34 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/enums/WorkTypeEnum.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.specialWork.enums; + + +import java.util.HashMap; +import java.util.Map; + +public enum WorkTypeEnum { + WORK_FIRE((byte)1,"动火作业"), + WORK_CLOSE_SPACE((byte)2,"受限空间作业"), + WORK_HANG((byte)3,"吊装作业"), + WORK_DIF_SOLI((byte)4,"动土作业"), + WORK_BROKE_ROAD((byte)5,"断路作业"), + WORK_HIGH_SPACE((byte)6,"高处作业"), + WORK_TEMP_ELECTRIC((byte)7,"临时用电作业"), + WORK_BLIND_PLATE((byte)8,"盲板抽堵作业"), + ; + + private Byte type; + private String name; + + WorkTypeEnum(Byte type, String name) { + this.type = type; + this.name = name; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + static Map<Byte, WorkTypeEnum> map; + static { + map = new HashMap<>(); + for (WorkTypeEnum typeEnum : WorkTypeEnum.values()) { + map.put(typeEnum.getType(), typeEnum); + } + } + + public static WorkTypeEnum parse(Byte code) { + return map.get(code); + } + + + public static boolean checkWorkType(Byte type){ + boolean flag = false; + for (WorkTypeEnum workType : WorkTypeEnum.values()){ + if(workType.getType().equals(type)){ + flag = true; + } + } + return flag; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/bo/ApprovalRuleBO.java b/src/main/java/com/gk/hotwork/specialWork/model/bo/ApprovalRuleBO.java new file mode 100644 index 0000000..d5a1f48 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/bo/ApprovalRuleBO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.bo; + +import java.io.Serializable; + +public class ApprovalRuleBO implements Serializable { + + private static final long serialVersionUID = -3335620798962161655L; + /** 规则ID **/ + private Long ruleId; + + //规则名称 + private String ruleName; + + /** 企业ID **/ + private Long eid; + + /** 部门ID **/ + private Long depId; + + private String depName; + + /** 规则状态 **/ + private Byte status; + + /** 作业类型 **/ + private Byte workType; + + //作业等级 + private Byte workLevel; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApplyPendingInfoBO.java b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApplyPendingInfoBO.java new file mode 100644 index 0000000..c3cb3ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApplyPendingInfoBO.java @@ -0,0 +1,468 @@ +package com.gk.hotwork.specialWork.model.bo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyPendingInfoBO implements Serializable { + + private static final long serialVersionUID = -7634555013135222417L; + + private Long workApplyId; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + private String depName; + + //申请人员ID + private Long applyUid; + + private String applyUname; + + //作业类型 + private Byte workType; + + //作业等级 + private Byte workLevel; + + //作业状态 + private Byte status; + + //当前所处审批流程层级 + private Integer approvalStep; + + private Long approvalStepId; + + //申请时间 + private LocalDateTime applyTime; + + //预期作业开始进行时间 + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + private LocalDateTime expEndTime; + + private LocalDateTime gmtCreate; + + private LocalDateTime gmtModified; + + private String workContent; + + private String workLocation; + + private Long workDetailId; + + private String hazardIdentification; + + //作业证编号 + private String workPermitNo; + + //作业人 + private Long operatorUid; + //作业人 + private String operatorUname; + + private String operatorUnames; + + private String operatorCompanys; + + //作业人编号 + private String operatorCertificate; + + + private Long stepId; + + private Byte stepType; + + private Byte stepApprovalResult; + + private Integer stepSerial; + + //开始审批时间 + private LocalDateTime stepStartApprovalTime; + + //预期结束时间 + private LocalDateTime stepExpFinishApprovalTime; + + //结束审批时间 + private LocalDateTime stepFinishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean containItem; + + private Long unitId; + + private Long unitApprovalUid; + + private String unitApprovalUname; + + private Byte unitResult; + + private String unitFillContent; + + private LocalDateTime unitApprovalStartTime; + + private LocalDateTime unitApprovalEndTime; + + private LocalDateTime unitApprovalActualTime; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public Long getApprovalStepId() { + return approvalStepId; + } + + public void setApprovalStepId(Long approvalStepId) { + this.approvalStepId = approvalStepId; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Byte getStepType() { + return stepType; + } + + public void setStepType(Byte stepType) { + this.stepType = stepType; + } + + public Byte getStepApprovalResult() { + return stepApprovalResult; + } + + public void setStepApprovalResult(Byte stepApprovalResult) { + this.stepApprovalResult = stepApprovalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public LocalDateTime getStepStartApprovalTime() { + return stepStartApprovalTime; + } + + public void setStepStartApprovalTime(LocalDateTime stepStartApprovalTime) { + this.stepStartApprovalTime = stepStartApprovalTime; + } + + public LocalDateTime getStepExpFinishApprovalTime() { + return stepExpFinishApprovalTime; + } + + public void setStepExpFinishApprovalTime(LocalDateTime stepExpFinishApprovalTime) { + this.stepExpFinishApprovalTime = stepExpFinishApprovalTime; + } + + public LocalDateTime getStepFinishApprovalTime() { + return stepFinishApprovalTime; + } + + public void setStepFinishApprovalTime(LocalDateTime stepFinishApprovalTime) { + this.stepFinishApprovalTime = stepFinishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getUnitApprovalUid() { + return unitApprovalUid; + } + + public void setUnitApprovalUid(Long unitApprovalUid) { + this.unitApprovalUid = unitApprovalUid; + } + + public String getUnitApprovalUname() { + return unitApprovalUname; + } + + public void setUnitApprovalUname(String unitApprovalUname) { + this.unitApprovalUname = unitApprovalUname; + } + + public Byte getUnitResult() { + return unitResult; + } + + public void setUnitResult(Byte unitResult) { + this.unitResult = unitResult; + } + + public LocalDateTime getUnitApprovalStartTime() { + return unitApprovalStartTime; + } + + public void setUnitApprovalStartTime(LocalDateTime unitApprovalStartTime) { + this.unitApprovalStartTime = unitApprovalStartTime; + } + + public LocalDateTime getUnitApprovalEndTime() { + return unitApprovalEndTime; + } + + public void setUnitApprovalEndTime(LocalDateTime unitApprovalEndTime) { + this.unitApprovalEndTime = unitApprovalEndTime; + } + + public LocalDateTime getUnitApprovalActualTime() { + return unitApprovalActualTime; + } + + public void setUnitApprovalActualTime(LocalDateTime unitApprovalActualTime) { + this.unitApprovalActualTime = unitApprovalActualTime; + } + + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public Long getWorkDetailId() { + return workDetailId; + } + + public void setWorkDetailId(Long workDetailId) { + this.workDetailId = workDetailId; + } + + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + public String getUnitFillContent() { + return unitFillContent; + } + + public void setUnitFillContent(String unitFillContent) { + this.unitFillContent = unitFillContent; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalItemInfoBO.java b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalItemInfoBO.java new file mode 100644 index 0000000..d484fc1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalItemInfoBO.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.specialWork.model.bo; + +import com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo; + +public class WorkApprovalItemInfoBO extends WorkApprovalItemInfo { + + private static final long serialVersionUID = 1003469601909994551L; + + private Long originalId; + + private Long originalStandId; + + private Long originalMeasureId; + + public Long getOriginalId() { + return originalId; + } + + public void setOriginalId(Long originalId) { + this.originalId = originalId; + } + + public Long getOriginalStandId() { + return originalStandId; + } + + public void setOriginalStandId(Long originalStandId) { + this.originalStandId = originalStandId; + } + + public Long getOriginalMeasureId() { + return originalMeasureId; + } + + public void setOriginalMeasureId(Long originalMeasureId) { + this.originalMeasureId = originalMeasureId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalStepInfoBO.java b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalStepInfoBO.java new file mode 100644 index 0000000..d85fbcc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalStepInfoBO.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.model.bo; + +import com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo; + +public class WorkApprovalStepInfoBO extends WorkApprovalStepInfo { + + private static final long serialVersionUID = -6943550190146723622L; + + private Long originalId; + + private Long originalPreStepId; + + public Long getOriginalId() { + return originalId; + } + + public void setOriginalId(Long originalId) { + this.originalId = originalId; + } + + public Long getOriginalPreStepId() { + return originalPreStepId; + } + + public void setOriginalPreStepId(Long originalPreStepId) { + this.originalPreStepId = originalPreStepId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalUnitInfoBO.java b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalUnitInfoBO.java new file mode 100644 index 0000000..2e4ea8d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/bo/WorkApprovalUnitInfoBO.java @@ -0,0 +1,22 @@ +package com.gk.hotwork.specialWork.model.bo; + + +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; + +public class WorkApprovalUnitInfoBO extends WorkApprovalUnitInfo { + + private static final long serialVersionUID = -2512545444043646065L; + /** + * @Description: 用作判断 + */ + private Long originalId; + + + public Long getOriginalId() { + return originalId; + } + + public void setOriginalId(Long originalId) { + this.originalId = originalId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemAbordDataReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemAbordDataReqDTO.java new file mode 100644 index 0000000..25fd103 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemAbordDataReqDTO.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +public class ApprovalItemAbordDataReqDTO implements Serializable { + + private static final long serialVersionUID = -1072481326878525982L; + + private Long workApplyId; + + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemDataReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemDataReqDTO.java new file mode 100644 index 0000000..f675a13 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemDataReqDTO.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.util.List; + +public class ApprovalItemDataReqDTO implements Serializable { + + private static final long serialVersionUID = 5571010238304511148L; + + private Long workApplyId; + + private String unitFillContent; + + private List<ApprovalItemReqDTO> itemFilledContents; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + + public List<ApprovalItemReqDTO> getItemFilledContents() { + return itemFilledContents; + } + + public void setItemFilledContents(List<ApprovalItemReqDTO> itemFilledContents) { + this.itemFilledContents = itemFilledContents; + } + + public String getUnitFillContent() { + return unitFillContent; + } + + public void setUnitFillContent(String unitFillContent) { + this.unitFillContent = unitFillContent; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemReqDTO.java new file mode 100644 index 0000000..34ab225 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalItemReqDTO.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApprovalItemReqDTO implements Serializable { + + private static final long serialVersionUID = 4926072360470256436L; + + private Long itemId; + + private BigDecimal val; + + private Byte measureVal; + + private String measureText; + + private String analysisLocation; + + private Byte fillType; + + public BigDecimal getVal() { + return val; + } + + public void setVal(BigDecimal val) { + this.val = val; + } + + public Byte getMeasureVal() { + return measureVal; + } + + public void setMeasureVal(Byte measureVal) { + this.measureVal = measureVal; + } + + public String getMeasureText() { + return measureText; + } + + public void setMeasureText(String measureText) { + this.measureText = measureText; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getAnalysisLocation() { + return analysisLocation; + } + + public void setAnalysisLocation(String analysisLocation) { + this.analysisLocation = analysisLocation; + } + + public Byte getFillType() { + return fillType; + } + + public void setFillType(Byte fillType) { + this.fillType = fillType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleAddReqDTO.java new file mode 100644 index 0000000..5759268 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleAddReqDTO.java @@ -0,0 +1,91 @@ +package com.gk.hotwork.specialWork.model.dto.req; + + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 规则传参对象 + */ +public class ApprovalRuleAddReqDTO { + + //规则名称 + @NotNull(message = "规则名称不可以为空") + private String ruleName; + /** 企业ID **/ + private Long eid; + + /** 部门ID **/ + @NotNull(message = "部门不可以为空") + private Long depId; + + /** 规则状态 **/ + private Byte status; + + /** 作业类型 **/ + @NotNull(message = "作业类型不可以为空") + private Byte workType; + + //作业等级 + private Byte workLevel; + + @NotNull(message = "层级不可为空!") + List<ApprovalRuleStepAddReqDTO> stepList; + + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public List<ApprovalRuleStepAddReqDTO> getStepList() { + return stepList; + } + + public void setStepList(List<ApprovalRuleStepAddReqDTO> stepList) { + this.stepList = stepList; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemAddReqDTO.java new file mode 100644 index 0000000..6305c3c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemAddReqDTO.java @@ -0,0 +1,46 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +public class ApprovalRuleItemAddReqDTO implements Serializable { + + private static final long serialVersionUID = -3095144086323661177L; + + //填报项名称 + private String itemName; + + //该审批项类型 + private Byte itemType; + + //适应审批项填报标准ID + private Long itemStandId; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureAddReqDTO.java new file mode 100644 index 0000000..f8a2739 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureAddReqDTO.java @@ -0,0 +1,54 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +public class ApprovalRuleItemMeasureAddReqDTO { + + //安全措施所属作业类型 + @NotNull(message = "作业类型不可为空!") + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + @NotNull(message = "安全措施类型不可为空!") + private Byte type; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + @NotBlank(message = "文字内容不可为空!") + private String context; + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureModReqDTO.java new file mode 100644 index 0000000..7137a74 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemMeasureModReqDTO.java @@ -0,0 +1,64 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +public class ApprovalRuleItemMeasureModReqDTO { + + @NotNull(message = "安全措施主键不可为空!") + private Long id; + + //安全措施所属作业类型 + @NotNull(message = "作业类型不可为空!") + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + @NotNull(message = "安全措施类型不可为空!") + private Byte type; + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + @NotBlank(message = "文字内容不可为空!") + private String context; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemModReqDTO.java new file mode 100644 index 0000000..faf32b9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleItemModReqDTO.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +public class ApprovalRuleItemModReqDTO implements Serializable { + + private static final long serialVersionUID = 5034181927289881975L; + + private Long itemId; + + //填报项名称 + private String itemName; + + //该审批项类型 + private Byte itemType; + + //适应审批项填报标准ID + private Long itemStandId; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleModReqDTO.java new file mode 100644 index 0000000..55a744f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleModReqDTO.java @@ -0,0 +1,102 @@ +package com.gk.hotwork.specialWork.model.dto.req; + + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 规则传参对象 + */ +public class ApprovalRuleModReqDTO { + + /** 规则ID **/ + @NotNull(message = "规则主键不可为空") + private Long ruleId; + + //规则名称 + @NotNull(message = "规则名称不可以为空") + private String ruleName; + /** 企业ID **/ + private Long eid; + + /** 部门ID **/ + @NotNull(message = "部门不可以为空") + private Long depId; + + /** 规则状态 **/ + private Byte status; + + /** 作业类型 **/ + @NotNull(message = "作业类型不可以为空") + private Byte workType; + + //作业等级 + private Byte workLevel; + + @NotNull(message = "层级不可为空!") + List<ApprovalRuleStepModReqDTO> stepList; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public List<ApprovalRuleStepModReqDTO> getStepList() { + return stepList; + } + + public void setStepList(List<ApprovalRuleStepModReqDTO> stepList) { + this.stepList = stepList; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandAddReqDTO.java new file mode 100644 index 0000000..ae8e020 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandAddReqDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApprovalRuleStandAddReqDTO implements Serializable { + + private static final long serialVersionUID = 7740068616568987789L; + + //标准类型 压力 温度.... + @NotNull(message = "标准类型未选择!") + private Byte ruleStandType; + + //最低值 + @NotNull(message = "最低值不可为空!") + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + @NotNull(message = "最低值匹配模式不可为空!") + private Byte minValMatchPattern; + + //最大值 + @NotNull(message = "最大值不可为空!") + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + @NotNull(message = "最大值匹配模式不可为空!") + private Byte maxValMatchPattern; + + //标题 + @NotNull(message = "标题不可为空!") + private String title; + + //描述信息 + private String info; + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandModReqDTO.java new file mode 100644 index 0000000..423f14b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandModReqDTO.java @@ -0,0 +1,105 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApprovalRuleStandModReqDTO implements Serializable { + + + private static final long serialVersionUID = 7662079219776994206L; + @NotNull(message = "主键不可为空!") + private Long ruleStandId; + + //标准类型 压力 温度.... + @NotNull(message = "标准类型未选择!") + private Byte ruleStandType; + + //最低值 + @NotNull(message = "最低值不可为空!") + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + @NotNull(message = "最低值匹配模式不可为空!") + private Byte minValMatchPattern; + + //最大值 + @NotNull(message = "最大值不可为空!") + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + @NotNull(message = "最大值匹配模式不可为空!") + private Byte maxValMatchPattern; + + //标题 + @NotNull(message = "标题不可为空!") + private String title; + + //描述信息 + private String info; + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Long getRuleStandId() { + return ruleStandId; + } + + public void setRuleStandId(Long ruleStandId) { + this.ruleStandId = ruleStandId; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandReqDTO.java new file mode 100644 index 0000000..b2d399d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStandReqDTO.java @@ -0,0 +1,111 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + * 传参对象 + */ +public class ApprovalRuleStandReqDTO { + //标准ID + private Long id; + + //标准类型 压力 温度.... + @NotNull(message = "压力标准类型不能为空!") + private Byte type; + + //所属企业ID + private Long eid; + + //所属部门ID + @NotNull(message = "部门未选择!") + private Long depId; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + @NotNull(message = "标准名称不可为空!") + private String title; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepAddReqDTO.java new file mode 100644 index 0000000..f654ad6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepAddReqDTO.java @@ -0,0 +1,133 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 审批规则 - 层级 + */ +public class ApprovalRuleStepAddReqDTO { + + /** + * 层级名称 + */ + @NotBlank(message = "层级名称不能为空!") + private String stepName; + + /** 层级规则状态 **/ + private Byte status; + + /** 层级所在顺序 **/ + @NotNull(message = "层级所在顺序不能为空!") + private Integer stepSerial; + + /** 层级内部有序标识 **/ + private Boolean enableOrder; + + //审批层级类型,单人,多人,分析人.... + @NotNull(message = "审批类型层级类型未选择!") + private Byte type; + + //审批环节有效时间 + @NotNull(message = "审批环节有效时间不能为空!") + private Integer continueTime; + + //审批环节有效时间单位 + @NotNull(message = "审批环节有效时间单位!") + private Byte continueTimeUnit; + + //审批单元 + @NotNull(message = "审批单元不可为空!") + private List<ApprovalRuleUnitAddReqDTO> unitList; + /** + * 审批项ids + */ + @NotNull(message = "审批项不可为空!") + private List<ApprovalRuleUnitItemAddReqDTO> itemList; + + /** + * 审核(0 单审,1 会审) + */ + private Byte auditType; + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public Boolean getEnableOrder() { + return enableOrder; + } + + public void setEnableOrder(Boolean enableOrder) { + this.enableOrder = enableOrder; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Integer getContinueTime() { + return continueTime; + } + + public void setContinueTime(Integer continueTime) { + this.continueTime = continueTime; + } + + public Byte getContinueTimeUnit() { + return continueTimeUnit; + } + + public void setContinueTimeUnit(Byte continueTimeUnit) { + this.continueTimeUnit = continueTimeUnit; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public List<ApprovalRuleUnitAddReqDTO> getUnitList() { + return unitList; + } + + public void setUnitList(List<ApprovalRuleUnitAddReqDTO> unitList) { + this.unitList = unitList; + } + + public List<ApprovalRuleUnitItemAddReqDTO> getItemList() { + return itemList; + } + + public void setItemList(List<ApprovalRuleUnitItemAddReqDTO> itemList) { + this.itemList = itemList; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepModReqDTO.java new file mode 100644 index 0000000..8fa63c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleStepModReqDTO.java @@ -0,0 +1,144 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 审批规则 - 层级 + */ +public class ApprovalRuleStepModReqDTO { + + /** 层级ID **/ + private Long stepId; + + /** + * 层级名称 + */ + @NotBlank(message = "层级名称不能为空!") + private String stepName; + + /** 层级规则状态 **/ + private Byte status; + + /** 层级所在顺序 **/ + @NotNull(message = "层级所在顺序不能为空!") + private Integer stepSerial; + + /** 层级内部有序标识 **/ + private Boolean enableOrder; + + //审批层级类型,单人,多人,分析人.... + @NotNull(message = "审批类型层级类型未选择!") + private Byte type; + + //审批环节有效时间 + @NotNull(message = "审批环节有效时间不能为空!") + private Integer continueTime; + + //审批环节有效时间单位 + @NotNull(message = "审批环节有效时间单位!") + private Byte continueTimeUnit; + + //审批单元 + @NotNull(message = "审批单元不可为空!") + private List<ApprovalRuleUnitModReqDTO> unitList; + /** + * 审批项ids + */ + @NotNull(message = "审批项不可为空!") + private List<ApprovalRuleUnitItemModReqDTO> itemList; + + /** + * 审核(0 单审,1 会审) + */ + private Byte auditType; + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public Boolean getEnableOrder() { + return enableOrder; + } + + public void setEnableOrder(Boolean enableOrder) { + this.enableOrder = enableOrder; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Integer getContinueTime() { + return continueTime; + } + + public void setContinueTime(Integer continueTime) { + this.continueTime = continueTime; + } + + public Byte getContinueTimeUnit() { + return continueTimeUnit; + } + + public void setContinueTimeUnit(Byte continueTimeUnit) { + this.continueTimeUnit = continueTimeUnit; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public List<ApprovalRuleUnitModReqDTO> getUnitList() { + return unitList; + } + + public void setUnitList(List<ApprovalRuleUnitModReqDTO> unitList) { + this.unitList = unitList; + } + + public List<ApprovalRuleUnitItemModReqDTO> getItemList() { + return itemList; + } + + public void setItemList(List<ApprovalRuleUnitItemModReqDTO> itemList) { + this.itemList = itemList; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitAddReqDTO.java new file mode 100644 index 0000000..fb57eb6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitAddReqDTO.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; + +public class ApprovalRuleUnitAddReqDTO { + + + private Integer unitSerial; + + /** 绑定人员ID **/ + @NotNull(message = "该层级未选择处理人员") + private Long bindUid; + + + public Integer getUnitSerial() { + return unitSerial; + } + + public void setUnitSerial(Integer unitSerial) { + this.unitSerial = unitSerial; + } + + public Long getBindUid() { + return bindUid; + } + + public void setBindUid(Long bindUid) { + this.bindUid = bindUid; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemAddReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemAddReqDTO.java new file mode 100644 index 0000000..692335f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemAddReqDTO.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.model.dto.req; + + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 审批规则 - 填报项 传参 + */ +public class ApprovalRuleUnitItemAddReqDTO { + + //填报项名称 + @NotBlank(message = "填报项名称不可为空!") + private String itemName; + + //该审批项类型 + @NotNull(message = "审批项类型选择!") + private Byte type; + + //适应审批项填报标准ID + private Long standId; + + //适应审批项安全措施类型ID + private Long measureId; + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemModReqDTO.java new file mode 100644 index 0000000..7f3ace3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitItemModReqDTO.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.specialWork.model.dto.req; + + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 审批规则 - 填报项 传参 + */ +public class ApprovalRuleUnitItemModReqDTO { + //审批规则 - 填报项ID + private Long id; + + //填报项名称 + @NotBlank(message = "填报项名称不可为空!") + private String itemName; + + //该审批项类型 + @NotNull(message = "审批项类型选择!") + private Byte type; + + //适应审批项填报标准ID + private Long standId; + + //适应审批项安全措施类型ID + private Long measureId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitModReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitModReqDTO.java new file mode 100644 index 0000000..5e44e94 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/ApprovalRuleUnitModReqDTO.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; + +public class ApprovalRuleUnitModReqDTO { + + /** + * 主键 + */ + private Long unitId; + /** 单元所在顺序 **/ + private Integer unitSerial; + + /** 绑定人员ID **/ + @NotNull(message = "该层级未选择处理人员") + private Long bindUid; + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Integer getUnitSerial() { + return unitSerial; + } + + public void setUnitSerial(Integer unitSerial) { + this.unitSerial = unitSerial; + } + + public Long getBindUid() { + return bindUid; + } + + public void setBindUid(Long bindUid) { + this.bindUid = bindUid; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/DeleteForm.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/DeleteForm.java new file mode 100644 index 0000000..c983adc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/DeleteForm.java @@ -0,0 +1,20 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * id传参 + */ +public class DeleteForm { + @NotNull(message = "删除主键不可为空") + private List<Long> ids; + + public List<Long> getIds() { + return ids; + } + + public void setIds(List<Long> ids) { + this.ids = ids; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyAtHighReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyAtHighReqDTO.java new file mode 100644 index 0000000..f0f3fdc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyAtHighReqDTO.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class WorkApplyAtHighReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = -2081738436536746812L; + //作业单位 + private Long operationDepId; + //作业高度 + private BigDecimal operationHeight; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public BigDecimal getOperationHeight() { + return operationHeight; + } + + public void setOperationHeight(BigDecimal operationHeight) { + this.operationHeight = operationHeight; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBlindPlatePluggingReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBlindPlatePluggingReqDTO.java new file mode 100644 index 0000000..237f9b3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBlindPlatePluggingReqDTO.java @@ -0,0 +1,125 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +public class WorkApplyBlindPlatePluggingReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = -3775972254078871318L; + //盲板编号 + private String bpCode; + //主要介质 + private String mainMedia; + //温度 + private BigDecimal temperature; + //压力 + private BigDecimal pressure; + //盲板材质 + private String bpMaterialQuality; + //盲板规格 + private String bpSpecification; + //盲板位置 + private String bpLocation; + //盲板位置图路径 + private String bpLocationMapPath; + //装盲板时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime installBpTime; + //拆盲板时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime uninstallBpTime; + + //涉及其他特殊作业 + private String otherSpecialWork; + + public String getBpCode() { + return bpCode; + } + + public void setBpCode(String bpCode) { + this.bpCode = bpCode; + } + + public String getMainMedia() { + return mainMedia; + } + + public void setMainMedia(String mainMedia) { + this.mainMedia = mainMedia; + } + + public BigDecimal getTemperature() { + return temperature; + } + + public void setTemperature(BigDecimal temperature) { + this.temperature = temperature; + } + + public BigDecimal getPressure() { + return pressure; + } + + public void setPressure(BigDecimal pressure) { + this.pressure = pressure; + } + + public String getBpMaterialQuality() { + return bpMaterialQuality; + } + + public void setBpMaterialQuality(String bpMaterialQuality) { + this.bpMaterialQuality = bpMaterialQuality; + } + + public String getBpSpecification() { + return bpSpecification; + } + + public void setBpSpecification(String bpSpecification) { + this.bpSpecification = bpSpecification; + } + + public String getBpLocation() { + return bpLocation; + } + + public void setBpLocation(String bpLocation) { + this.bpLocation = bpLocation; + } + + public String getBpLocationMapPath() { + return bpLocationMapPath; + } + + public void setBpLocationMapPath(String bpLocationMapPath) { + this.bpLocationMapPath = bpLocationMapPath; + } + + public LocalDateTime getInstallBpTime() { + return installBpTime; + } + + public void setInstallBpTime(LocalDateTime installBpTime) { + this.installBpTime = installBpTime; + } + + public LocalDateTime getUninstallBpTime() { + return uninstallBpTime; + } + + public void setUninstallBpTime(LocalDateTime uninstallBpTime) { + this.uninstallBpTime = uninstallBpTime; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBrokenCircuitReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBrokenCircuitReqDTO.java new file mode 100644 index 0000000..f6dfacf --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyBrokenCircuitReqDTO.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.model.dto.req; + + +import java.io.Serializable; + +public class WorkApplyBrokenCircuitReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = 326403288977682944L; + //作业单位 + private Long operationDepId; + //断路原因 + private String bcReason; + //断路地段图片路径 + private String bcPath; + //断路地段说明 + private String bcExplain; + //涉及相关部门 + private String involvedDepIds; + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getBcReason() { + return bcReason; + } + + public void setBcReason(String bcReason) { + this.bcReason = bcReason; + } + + public String getBcPath() { + return bcPath; + } + + public void setBcPath(String bcPath) { + this.bcPath = bcPath; + } + + public String getBcExplain() { + return bcExplain; + } + + public void setBcExplain(String bcExplain) { + this.bcExplain = bcExplain; + } + + public String getInvolvedDepIds() { + return involvedDepIds; + } + + public void setInvolvedDepIds(String involvedDepIds) { + this.involvedDepIds = involvedDepIds; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyConfinedSpaceReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyConfinedSpaceReqDTO.java new file mode 100644 index 0000000..087fd6b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyConfinedSpaceReqDTO.java @@ -0,0 +1,61 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +public class WorkApplyConfinedSpaceReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = 8284372970104020051L; + //受限空间所属单位id + private Long csDepId; + + //受限空间名称 + private String csName; + //受限空间内原有介质名称 + private String csOriginalName; + + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getCsDepId() { + return csDepId; + } + + public void setCsDepId(Long csDepId) { + this.csDepId = csDepId; + } + + + public String getCsName() { + return csName; + } + + public void setCsName(String csName) { + this.csName = csName; + } + + public String getCsOriginalName() { + return csOriginalName; + } + + public void setCsOriginalName(String csOriginalName) { + this.csOriginalName = csOriginalName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyEight.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyEight.java new file mode 100644 index 0000000..c962a96 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyEight.java @@ -0,0 +1,8 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +/** +* @Description: 8个作业入参 +*/ +public class WorkApplyEight { + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyGroundBreakingReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyGroundBreakingReqDTO.java new file mode 100644 index 0000000..6f9db4c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyGroundBreakingReqDTO.java @@ -0,0 +1,63 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +/** + * 动土作业 + */ +public class WorkApplyGroundBreakingReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = -7752215718396059334L; + //作业单位 + private Long operationDepId; + //动土范围 + private String gbScope; + //动土方式 + private String gbMethod; + //图片路径 + private String gbPath; + + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getGbScope() { + return gbScope; + } + + public void setGbScope(String gbScope) { + this.gbScope = gbScope; + } + + public String getGbMethod() { + return gbMethod; + } + + public void setGbMethod(String gbMethod) { + this.gbMethod = gbMethod; + } + + public String getGbPath() { + return gbPath; + } + + public void setGbPath(String gbPath) { + this.gbPath = gbPath; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHoistingReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHoistingReqDTO.java new file mode 100644 index 0000000..7b14767 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHoistingReqDTO.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 吊装作业 + */ +public class WorkApplyHoistingReqDTO extends WorkApplyEight implements Serializable{ + + private static final long serialVersionUID = -459626266664394533L; + //吊装工具名称 + private String hoistingToolName; + //起吊物体质量 + private BigDecimal weightMass; + + public String getHoistingToolName() { + return hoistingToolName; + } + + public void setHoistingToolName(String hoistingToolName) { + this.hoistingToolName = hoistingToolName; + } + + public BigDecimal getWeightMass() { + return weightMass; + } + + public void setWeightMass(BigDecimal weightMass) { + this.weightMass = weightMass; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHotReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHotReqDTO.java new file mode 100644 index 0000000..5efb2c8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyHotReqDTO.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; + +public class WorkApplyHotReqDTO extends WorkApplyEight implements Serializable { + + private static final long serialVersionUID = 5010351959673846801L; + + // 动火方式 + private String hotMethod; + + // 涉及其他作业 + private String otherSpecialWork; + + public String getHotMethod() { + return hotMethod; + } + + public void setHotMethod(String hotMethod) { + this.hotMethod = hotMethod; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyReqDTO.java new file mode 100644 index 0000000..4483986 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyReqDTO.java @@ -0,0 +1,120 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +// 作业申请的请求体 +public class WorkApplyReqDTO<T> implements Serializable { + + private static final long serialVersionUID = 2538730610582299235L; + // 作业类型 + private Byte workType; + + // 作业等级 + private Byte workLevel; + + // 预期作业开始进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expStartTime; + + // 预期作业结束进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expEndTime; + + private String operatorUnames; + + private String operatorCompanys; + + // 作业内容 + private String workContent; + // 作业地点 + private String workLocation; + // 危险辨识 + private String hazardIdentification; + + private T workDetail; + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public T getWorkDetail() { + return workDetail; + } + + public void setWorkDetail(T workDetail) { + this.workDetail = workDetail; + } + + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyTemporaryPowerReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyTemporaryPowerReqDTO.java new file mode 100644 index 0000000..b5201e8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApplyTemporaryPowerReqDTO.java @@ -0,0 +1,44 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 临时用电 + */ + +public class WorkApplyTemporaryPowerReqDTO extends WorkApplyEight implements Serializable{ + + private static final long serialVersionUID = 7274051573700560235L; + //电源接入点 + private String powerAccessPoint; + //工作电压 + private BigDecimal workingVoltage; + //用电设备及功率 + private String equipmentAndPower; + + public String getPowerAccessPoint() { + return powerAccessPoint; + } + + public void setPowerAccessPoint(String powerAccessPoint) { + this.powerAccessPoint = powerAccessPoint; + } + + public BigDecimal getWorkingVoltage() { + return workingVoltage; + } + + public void setWorkingVoltage(BigDecimal workingVoltage) { + this.workingVoltage = workingVoltage; + } + + public String getEquipmentAndPower() { + return equipmentAndPower; + } + + public void setEquipmentAndPower(String equipmentAndPower) { + this.equipmentAndPower = equipmentAndPower; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalItemContentReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalItemContentReqDTO.java new file mode 100644 index 0000000..9b985be --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalItemContentReqDTO.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.math.BigDecimal; + +public class WorkApprovalItemContentReqDTO { + + //审批项类型 + private byte itemType; + + //审批项数值 + private BigDecimal value; + + //审批填空 + private String content; + + //选项值 + private String option; + + + public byte getItemType() { + return itemType; + } + + public void setItemType(byte itemType) { + this.itemType = itemType; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getOption() { + return option; + } + + public void setOption(String option) { + this.option = option; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalReqDTO.java new file mode 100644 index 0000000..e7215c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkApprovalReqDTO.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 作业审批请求对象 + */ +public class WorkApprovalReqDTO { + + //作业id + @NotNull(message = "作业申请主键不可为空!") + private Long workApplyId; + + //层级审批类型 + @NotNull(message = "层级审批类型!") + private byte stepApprovalType; + + //审批人 + private Long approval_uid; + + //审批结果 + private byte result; + + //图片路径 + private String picturePath; + + //填报审批项内容 + private List<WorkApprovalItemContentReqDTO> itemContentReqDTOList; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public byte getStepApprovalType() { + return stepApprovalType; + } + + public void setStepApprovalType(byte stepApprovalType) { + this.stepApprovalType = stepApprovalType; + } + + + public Long getApproval_uid() { + return approval_uid; + } + + public void setApproval_uid(Long approval_uid) { + this.approval_uid = approval_uid; + } + + public byte getResult() { + return result; + } + + public void setResult(byte result) { + this.result = result; + } + + public String getPicturePath() { + return picturePath; + } + + public void setPicturePath(String picturePath) { + this.picturePath = picturePath; + } + + public List<WorkApprovalItemContentReqDTO> getItemContentReqDTOList() { + return itemContentReqDTOList; + } + + public void setItemContentReqDTOList(List<WorkApprovalItemContentReqDTO> itemContentReqDTOList) { + this.itemContentReqDTOList = itemContentReqDTOList; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkProcessDetectionReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkProcessDetectionReqDTO.java new file mode 100644 index 0000000..6ce940e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkProcessDetectionReqDTO.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class WorkProcessDetectionReqDTO implements Serializable { + + private static final long serialVersionUID = 5269314115257657149L; + + private String workPermitNo; + + private String info; + + private BigDecimal combustible; + + private BigDecimal oxygen; + + private BigDecimal carbonMonoxide; + + private BigDecimal hydrogenSulfide; + + private Byte source; + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public BigDecimal getCombustible() { + return combustible; + } + + public void setCombustible(BigDecimal combustible) { + this.combustible = combustible; + } + + public BigDecimal getOxygen() { + return oxygen; + } + + public void setOxygen(BigDecimal oxygen) { + this.oxygen = oxygen; + } + + public BigDecimal getCarbonMonoxide() { + return carbonMonoxide; + } + + public void setCarbonMonoxide(BigDecimal carbonMonoxide) { + this.carbonMonoxide = carbonMonoxide; + } + + public BigDecimal getHydrogenSulfide() { + return hydrogenSulfide; + } + + public void setHydrogenSulfide(BigDecimal hydrogenSulfide) { + this.hydrogenSulfide = hydrogenSulfide; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkReqDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkReqDTO.java new file mode 100644 index 0000000..cc9df46 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/req/WorkReqDTO.java @@ -0,0 +1,160 @@ +package com.gk.hotwork.specialWork.model.dto.req; + +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; + +/** + * 作业基础信息请求对象 + */ +public class WorkReqDTO { + + //所属企业ID + private Long eid; + + //所属部门ID + @NotNull(message = "部门不可为空!") + private Long depId; + + //申请人员ID + @NotNull(message = "申请不可为空!") + private Long applyUid; + + //作业类型 + @NotNull(message = "作业类型不可为空!") + private Byte workType; + + //作业等级 + @NotNull(message = "作业等级不可为空!") + private Byte workLevel; + + //作业状态 + private Byte status; + + //当前所处审批流程层级 + private Integer approvalStep; + + //申请时间 + @NotNull(message = "申请时间不可为空!") + private LocalDateTime applyTime; + + //预期作业开始进行时间 + @NotNull(message = "作业开始时间不可为空!") + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + @NotNull(message = "作业结束时间不可为空!") + private LocalDateTime expEndTime; + + //作业证编号 + private String workPermitNo; + + //作业人 + private Long operatorId; + + //作业人编号 + private String operatorCertificate; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getOperatorId() { + return operatorId; + } + + public void setOperatorId(Long operatorId) { + this.operatorId = operatorId; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/AllWorkApplyPageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/AllWorkApplyPageRespDTO.java new file mode 100644 index 0000000..0838625 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/AllWorkApplyPageRespDTO.java @@ -0,0 +1,300 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + + +public class AllWorkApplyPageRespDTO implements Serializable { + + private static final long serialVersionUID = 6175176581171951602L; + + //作业ID + private Long workApplyId; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + private String depName; + + //申请人员ID + private Long applyUid; + + private String applyUname; + + //作业类型 + private Byte workType; + + private String workTypeDesc; + + //作业等级 + private Byte workLevel; + + private String workLevelDesc; + + //作业状态 + private Byte status; + + private String statusDesc; + + //当前所处审批流程层级 + private Integer approvalStep; + + private Long approvalStepId; + + private String workContent; + + private String workLocation; + // 危险辨识 + private String hazardIdentification; + + +// private List<WorkApplyOperatorRespDTO> operators; + + private String operatorUnames; + + private String operatorCompanys; + + private Object workDetail; + + //申请时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime applyTime; + + //预期作业开始进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expEndTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + //作业证编号 + private String workPermitNo; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getApprovalStepId() { + return approvalStepId; + } + + public void setApprovalStepId(Long approvalStepId) { + this.approvalStepId = approvalStepId; + } + + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public Object getWorkDetail() { + return workDetail; + } + + public void setWorkDetail(Object workDetail) { + this.workDetail = workDetail; + } + + + + + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemMeasureRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemMeasureRespDTO.java new file mode 100644 index 0000000..99ffd2b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemMeasureRespDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApplicantWorkApprovalItemMeasureRespDTO implements Serializable { + + + private static final long serialVersionUID = -8752942057117048672L; + //ID,主键 + private Long measureId; + + //安全措施所属作业类型 + private Byte workType; + + private String workTypeDesc; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + private String typeDesc; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private Long workApplyId; + + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemRespDTO.java new file mode 100644 index 0000000..0ab5e09 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemRespDTO.java @@ -0,0 +1,142 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +/** + * 审批填报项 + */ +public class ApplicantWorkApprovalItemRespDTO implements Serializable { + + private static final long serialVersionUID = 8980733459936552835L; + + //填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + private String typeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + private ApplicantWorkApprovalItemMeasureRespDTO measure; + + private ApplicantWorkApprovalItemStandRespDTO stand; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public ApplicantWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(ApplicantWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public ApplicantWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(ApplicantWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemStandRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemStandRespDTO.java new file mode 100644 index 0000000..bd6f793 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalItemStandRespDTO.java @@ -0,0 +1,153 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApplicantWorkApprovalItemStandRespDTO implements Serializable { + + private static final long serialVersionUID = -7463830161910599483L; + + private Long standId; + + private Byte type; + + private String typeDesc; + + private Long eid; + + private Long depId; + + private String depName; + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + private String minValMatchPatternDesc; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + private String maxValMatchPatternDesc; + + + private String title; + + private Long workApplyId; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public String getMinValMatchPatternDesc() { + return minValMatchPatternDesc; + } + + public void setMinValMatchPatternDesc(String minValMatchPatternDesc) { + this.minValMatchPatternDesc = minValMatchPatternDesc; + } + + public String getMaxValMatchPatternDesc() { + return maxValMatchPatternDesc; + } + + public void setMaxValMatchPatternDesc(String maxValMatchPatternDesc) { + this.maxValMatchPatternDesc = maxValMatchPatternDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalStepRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalStepRespDTO.java new file mode 100644 index 0000000..244da1b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalStepRespDTO.java @@ -0,0 +1,203 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class ApplicantWorkApprovalStepRespDTO implements Serializable { + + private static final long serialVersionUID = 8898288987689474623L; + private Long stepId; + + //所属作业ID + private Long workApplyId; + + private String stepName; + + private Byte auditType; + + private String auditTypeDesc; + //审批层级类型,单人,多人,分析人.... + private Byte type; + + private String typeDesc; + + //审批结果 + private Byte approvalResult; + + private String approvalResultDesc; + + //审批层级序号 + private Integer stepSerial; + + //开始审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime startApprovalTime; + + //预期结束时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expFinishApprovalTime; + + //结束审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime finishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean containItem; + + private List<ApplicantWorkApprovalUnitRespDTO> stepUnits; + + private List<ApplicantWorkApprovalItemRespDTO> stepItems; + + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getApprovalResult() { + return approvalResult; + } + + public void setApprovalResult(Byte approvalResult) { + this.approvalResult = approvalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public LocalDateTime getStartApprovalTime() { + return startApprovalTime; + } + + public void setStartApprovalTime(LocalDateTime startApprovalTime) { + this.startApprovalTime = startApprovalTime; + } + + public LocalDateTime getExpFinishApprovalTime() { + return expFinishApprovalTime; + } + + public void setExpFinishApprovalTime(LocalDateTime expFinishApprovalTime) { + this.expFinishApprovalTime = expFinishApprovalTime; + } + + public LocalDateTime getFinishApprovalTime() { + return finishApprovalTime; + } + + public void setFinishApprovalTime(LocalDateTime finishApprovalTime) { + this.finishApprovalTime = finishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public List<ApplicantWorkApprovalUnitRespDTO> getStepUnits() { + return stepUnits; + } + + public void setStepUnits(List<ApplicantWorkApprovalUnitRespDTO> stepUnits) { + this.stepUnits = stepUnits; + } + + public List<ApplicantWorkApprovalItemRespDTO> getStepItems() { + return stepItems; + } + + public void setStepItems(List<ApplicantWorkApprovalItemRespDTO> stepItems) { + this.stepItems = stepItems; + } + + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public String getApprovalResultDesc() { + return approvalResultDesc; + } + + public void setApprovalResultDesc(String approvalResultDesc) { + this.approvalResultDesc = approvalResultDesc; + } + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } + + + public String getAuditTypeDesc() { + return auditTypeDesc; + } + + public void setAuditTypeDesc(String auditTypeDesc) { + this.auditTypeDesc = auditTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitFilledItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitFilledItemRespDTO.java new file mode 100644 index 0000000..55c1e8c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitFilledItemRespDTO.java @@ -0,0 +1,205 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApplicantWorkApprovalUnitFilledItemRespDTO implements Serializable { + + private static final long serialVersionUID = -977161219097083733L; + + private Long id; + + private Long itemId; + + private Long unitId; + + private BigDecimal val; + + private Long workApplyId; + + private Byte measureVal; + + private String measureValDesc; + + private String measureText; + + private Byte fillType; + + private String fillTypeDesc; + + //填报项名称 + private String itemName; + + //填报类型 数值、选项、填空... + private Byte itemType; + + private String itemTypeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + private ApplicantWorkApprovalItemMeasureRespDTO measure; + + private ApplicantWorkApprovalItemStandRespDTO stand; + + private String analysisLocation; + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public BigDecimal getVal() { + return val; + } + + public void setVal(BigDecimal val) { + this.val = val; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getMeasureVal() { + return measureVal; + } + + public void setMeasureVal(Byte measureVal) { + this.measureVal = measureVal; + } + + public String getMeasureText() { + return measureText; + } + + public void setMeasureText(String measureText) { + this.measureText = measureText; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + public ApplicantWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(ApplicantWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public ApplicantWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(ApplicantWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + public String getItemTypeDesc() { + return itemTypeDesc; + } + + public void setItemTypeDesc(String itemTypeDesc) { + this.itemTypeDesc = itemTypeDesc; + } + + + public String getAnalysisLocation() { + return analysisLocation; + } + + public void setAnalysisLocation(String analysisLocation) { + this.analysisLocation = analysisLocation; + } + + public String getMeasureValDesc() { + return measureValDesc; + } + + public void setMeasureValDesc(String measureValDesc) { + this.measureValDesc = measureValDesc; + } + + public Byte getFillType() { + return fillType; + } + + public void setFillType(Byte fillType) { + this.fillType = fillType; + } + + public String getFillTypeDesc() { + return fillTypeDesc; + } + + public void setFillTypeDesc(String fillTypeDesc) { + this.fillTypeDesc = fillTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitRespDTO.java new file mode 100644 index 0000000..a6121cf --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovalUnitRespDTO.java @@ -0,0 +1,147 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 审批单元 + */ +public class ApplicantWorkApprovalUnitRespDTO implements Serializable { + + + private static final long serialVersionUID = -2019933579793219627L; + //审批单元ID + private Long unitId; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //审批人ID + private Long approvalUid; + + private String approvalUname; + + //审批结果 + private Byte result; + + private String resultDesc; + + //审批开始时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalStartTime; + + //审批截止时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalEndTime; + + //实际审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalActualTime; + + private List<ApplicantWorkApprovalUnitFilledItemRespDTO> filledItems; + + private String filledContent; + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public LocalDateTime getApprovalStartTime() { + return approvalStartTime; + } + + public void setApprovalStartTime(LocalDateTime approvalStartTime) { + this.approvalStartTime = approvalStartTime; + } + + public LocalDateTime getApprovalEndTime() { + return approvalEndTime; + } + + public void setApprovalEndTime(LocalDateTime approvalEndTime) { + this.approvalEndTime = approvalEndTime; + } + + public LocalDateTime getApprovalActualTime() { + return approvalActualTime; + } + + public void setApprovalActualTime(LocalDateTime approvalActualTime) { + this.approvalActualTime = approvalActualTime; + } + + public String getApprovalUname() { + return approvalUname; + } + + public void setApprovalUname(String approvalUname) { + this.approvalUname = approvalUname; + } + + public List<ApplicantWorkApprovalUnitFilledItemRespDTO> getFilledItems() { + return filledItems; + } + + public void setFilledItems(List<ApplicantWorkApprovalUnitFilledItemRespDTO> filledItems) { + this.filledItems = filledItems; + } + + + public String getResultDesc() { + return resultDesc; + } + + public void setResultDesc(String resultDesc) { + this.resultDesc = resultDesc; + } + + public String getFilledContent() { + return filledContent; + } + + public void setFilledContent(String filledContent) { + this.filledContent = filledContent; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyDetailRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyDetailRespDTO.java new file mode 100644 index 0000000..5858619 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyDetailRespDTO.java @@ -0,0 +1,92 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.util.List; + +public class ApplicantWorkApprovedApplyDetailRespDTO implements Serializable { + + private static final long serialVersionUID = 6177193730745924205L; + + private Long workApplyId; + + private String workPermitNo; + + private String workLocation; + + private String workContent; + + private String hazardIdentification; + + private String operatorUnames; + + private String operatorCompanys; + +// private List<ApplicantWorkApprovedApplyOperatorRespDTO> operators; + + private List<ApplicantWorkApprovalStepRespDTO> approvalSteps; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public List<ApplicantWorkApprovalStepRespDTO> getApprovalSteps() { + return approvalSteps; + } + + public void setApprovalSteps(List<ApplicantWorkApprovalStepRespDTO> approvalSteps) { + this.approvalSteps = approvalSteps; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyOperatorRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyOperatorRespDTO.java new file mode 100644 index 0000000..638e4e1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApplicantWorkApprovedApplyOperatorRespDTO.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApplicantWorkApprovedApplyOperatorRespDTO implements Serializable { + + + private static final long serialVersionUID = 6857670476578438989L; + private Long id; + + private Long operatorUid; + + private Long workApplyId; + + private String operatorUname; + + private String operatorCertificate; + + private String operatorPhone; + + private String operatorIdentify; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public String getOperatorPhone() { + return operatorPhone; + } + + public void setOperatorPhone(String operatorPhone) { + this.operatorPhone = operatorPhone; + } + + public String getOperatorIdentify() { + return operatorIdentify; + } + + public void setOperatorIdentify(String operatorIdentify) { + this.operatorIdentify = operatorIdentify; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleItemStandPageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleItemStandPageRespDTO.java new file mode 100644 index 0000000..dd1c8a2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleItemStandPageRespDTO.java @@ -0,0 +1,198 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 审批规则--填报事项标准 + */ +public class ApprovalRuleItemStandPageRespDTO implements Serializable { + + private static final long serialVersionUID = 2275339887615374901L; + //标准ID + + private Long ruleStandId; + + //标准类型 压力 温度.... + private Byte ruleStandType; + + private String ruleStandTypeDesc; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + private String title; + + //描述 + private String info; + //状态 + private Byte status; + + private String statusDesc; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime gmtCreate; + + private Long createUid; + + private String createUname; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime gmtModified; + + private Long modifiedUid; + + private String modifiedUname; + + + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getRuleStandId() { + return ruleStandId; + } + + public void setRuleStandId(Long ruleStandId) { + this.ruleStandId = ruleStandId; + } + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public String getRuleStandTypeDesc() { + return ruleStandTypeDesc; + } + + public void setRuleStandTypeDesc(String ruleStandTypeDesc) { + this.ruleStandTypeDesc = ruleStandTypeDesc; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasurePageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasurePageRespDTO.java new file mode 100644 index 0000000..0e98067 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasurePageRespDTO.java @@ -0,0 +1,133 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; + +public class ApprovalRuleMeasurePageRespDTO { + + private Long id; + + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //安全措施状态 + private Byte status; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasureRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasureRespDTO.java new file mode 100644 index 0000000..e788344 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleMeasureRespDTO.java @@ -0,0 +1,134 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; + +public class ApprovalRuleMeasureRespDTO { + + private Long id; + + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //安全措施状态 + private Byte status; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleRespDTO.java new file mode 100644 index 0000000..649a3d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleRespDTO.java @@ -0,0 +1,161 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; +import java.util.List; + +public class ApprovalRuleRespDTO { + /** 规则ID **/ + private Long ruleId; + + //规则名称 + private String ruleName; + + /** 企业ID **/ + private Long eid; + + /** 部门ID **/ + private Long depId; + + /** 规则状态 **/ + private Byte status; + + /** 作业类型 **/ + private Byte workType; + + //作业等级 + private Byte workLevel; + + /** 创建时间 **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + /** 修改时间 **/ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + /** 创建人ID **/ + private Long createUid; + + /** 创建人姓名 **/ + private String createUname; + + private Long modifiedUid; + + private String modifiedUname; + + //该审批规则下的审批层级列表 + private List<ApprovalRuleStepRespDTO> stepList; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public List<ApprovalRuleStepRespDTO> getStepList() { + return stepList; + } + + public void setStepList(List<ApprovalRuleStepRespDTO> stepList) { + this.stepList = stepList; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandListRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandListRespDTO.java new file mode 100644 index 0000000..e5b2bd5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandListRespDTO.java @@ -0,0 +1,127 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApprovalRuleStandListRespDTO implements Serializable { + + private static final long serialVersionUID = 5879266510492066511L; + + private Long ruleStandId; + + //标准类型 压力 温度.... + private Byte ruleStandType; + + private String ruleStandTypeDesc; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + private String title; + + //描述 + private String info; + + //状态 + private Byte status; + + private String statusDesc; + + public Long getRuleStandId() { + return ruleStandId; + } + + public void setRuleStandId(Long ruleStandId) { + this.ruleStandId = ruleStandId; + } + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + public String getRuleStandTypeDesc() { + return ruleStandTypeDesc; + } + + public void setRuleStandTypeDesc(String ruleStandTypeDesc) { + this.ruleStandTypeDesc = ruleStandTypeDesc; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandRespDTO.java new file mode 100644 index 0000000..9f9e6d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStandRespDTO.java @@ -0,0 +1,176 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +public class ApprovalRuleStandRespDTO { + + private Long id; + + //标准类型 压力 温度.... + private Byte type; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + //标题 + private String title; + + //状态 + private Byte status; + + private LocalDateTime gmtCreate; + + private Long createUid; + + private String createUname; + + private LocalDateTime gmtModified; + + private Long modifiedUid; + + private String modifiedUname; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStepRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStepRespDTO.java new file mode 100644 index 0000000..9bbe8ad --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleStepRespDTO.java @@ -0,0 +1,232 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; +import java.util.List; + +public class ApprovalRuleStepRespDTO { + + /** 层级ID **/ + private Long stepId; + + /** 所属规则ID **/ + private Long ruleId; + + /** + * 审核(0 单审,1 会审) + */ + private Byte auditType; + + /** + * 层级名称 + */ + private String stepName; + + /** 层级规则状态 **/ + private Byte status; + + /** 层级所在顺序 **/ + private Integer stepSerial; + + /** 层级内部有序标识 **/ + private Boolean enableOrder; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + //审批环节有效时间 + private Integer continueTime; + + //审批环节有效时间单位 + private Byte continueTimeUnit; + + //前一个节点 + private Long preStepId; + + //下一个节点 + private Long nextStepId; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + /** 创建人ID **/ + private Long createUid; + + /** 创建人姓名 **/ + private String createUname; + + private Long modifiedUid; + + private String modifiedUname; + + //该审批层级下的审批单元列表 + private List<ApprovalRuleUnitRespDTO> unitList; + + //该审批层级下的审批项列表 + private List<ApprovalRuleUnitItemRespDTO> itemList; + + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public Boolean getEnableOrder() { + return enableOrder; + } + + public void setEnableOrder(Boolean enableOrder) { + this.enableOrder = enableOrder; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Integer getContinueTime() { + return continueTime; + } + + public void setContinueTime(Integer continueTime) { + this.continueTime = continueTime; + } + + public Byte getContinueTimeUnit() { + return continueTimeUnit; + } + + public void setContinueTimeUnit(Byte continueTimeUnit) { + this.continueTimeUnit = continueTimeUnit; + } + + public List<ApprovalRuleUnitRespDTO> getUnitList() { + return unitList; + } + + public void setUnitList(List<ApprovalRuleUnitRespDTO> unitList) { + this.unitList = unitList; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public List<ApprovalRuleUnitItemRespDTO> getItemList() { + return itemList; + } + + public void setItemList(List<ApprovalRuleUnitItemRespDTO> itemList) { + this.itemList = itemList; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemListRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemListRespDTO.java new file mode 100644 index 0000000..670f095 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemListRespDTO.java @@ -0,0 +1,125 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApprovalRuleUnitItemListRespDTO implements Serializable { + + private static final long serialVersionUID = -776756495109595072L; + + //审批规则 - 填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属规则ID + private Long ruleId; + + //所属规则层级ID + private Long stepId; + + //所属审批规则审批单元ID + private Long unitId; + + //该审批项类型 + private Byte itemType; + + private String itemTypeDesc; + + //适应审批项填报标准ID + private Long itemStandId; + + private Byte status; + + private String statusDesc; + + private ApprovalRuleStandListRespDTO itemStand; + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public String getItemTypeDesc() { + return itemTypeDesc; + } + + public void setItemTypeDesc(String itemTypeDesc) { + this.itemTypeDesc = itemTypeDesc; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public ApprovalRuleStandListRespDTO getItemStand() { + return itemStand; + } + + public void setItemStand(ApprovalRuleStandListRespDTO itemStand) { + this.itemStand = itemStand; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemPageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemPageRespDTO.java new file mode 100644 index 0000000..9b6f16c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemPageRespDTO.java @@ -0,0 +1,193 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 审批规则 - 填报项 + */ +public class ApprovalRuleUnitItemPageRespDTO implements Serializable { + + private static final long serialVersionUID = 2893543669971621144L; + //审批规则 - 填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属规则ID + private Long ruleId; + + //所属规则层级ID + private Long stepId; + + //所属审批规则审批单元ID + private Long unitId; + + //该审批项类型 + private Byte itemType; + + private String itemTypeDesc; + + //适应审批项填报标准ID + private Long itemStandId; + + private ApprovalRuleStandListRespDTO itemStand; + + private Byte status; + + private String statusDesc; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public String getItemTypeDesc() { + return itemTypeDesc; + } + + public void setItemTypeDesc(String itemTypeDesc) { + this.itemTypeDesc = itemTypeDesc; + } + + public ApprovalRuleStandListRespDTO getItemStand() { + return itemStand; + } + + public void setItemStand(ApprovalRuleStandListRespDTO itemStand) { + this.itemStand = itemStand; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemRespDTO.java new file mode 100644 index 0000000..3466f21 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitItemRespDTO.java @@ -0,0 +1,176 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; + +public class ApprovalRuleUnitItemRespDTO { + + private Long id; + + //填报项名称 + private String itemName; + //所属规则ID + private Long ruleId; + + //所属规则层级ID + private Long stepId; + + //所属审批规则审批单元ID + private Long unitId; + + //该审批项类型 + //填报类型 数值、选项、填空... + private Byte type; + + //类型为安全措施(选项、填空)时不为null,否则为null + private Long measureId; + + //类型为数值时不为null,否则为null + //适应审批项填报标准ID + private Long standId; + + private Byte status; + + private Byte smType; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + private String createUname; + + private Long createUid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + private String modifiedUname; + + private Long modifiedUid; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public Byte getSmType() { + return smType; + } + + public void setSmType(Byte smType) { + this.smType = smType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitRespDTO.java new file mode 100644 index 0000000..0a1886b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApprovalRuleUnitRespDTO.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +public class ApprovalRuleUnitRespDTO { + + /** 单元规则ID **/ + private Long unitId; + + /** 绑定人员ID **/ + private Long bindUid; + + + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + + public Long getBindUid() { + return bindUid; + } + + public void setBindUid(Long bindUid) { + this.bindUid = bindUid; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemMeasureRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemMeasureRespDTO.java new file mode 100644 index 0000000..38e8cc8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemMeasureRespDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApproverWorkApprovalItemMeasureRespDTO implements Serializable { + + + private static final long serialVersionUID = 4045492074355336943L; + //ID,主键 + private Long measureId; + + //安全措施所属作业类型 + private Byte workType; + + private String workTypeDesc; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + private String typeDesc; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private Long workApplyId; + + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemRespDTO.java new file mode 100644 index 0000000..0896bb0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemRespDTO.java @@ -0,0 +1,142 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +/** + * 审批填报项 + */ +public class ApproverWorkApprovalItemRespDTO implements Serializable { + + + private static final long serialVersionUID = 3064428476801130798L; + //填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + private String typeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + private ApproverWorkApprovalItemMeasureRespDTO measure; + + private ApproverWorkApprovalItemStandRespDTO stand; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + + public ApproverWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(ApproverWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public ApproverWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(ApproverWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemStandRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemStandRespDTO.java new file mode 100644 index 0000000..b14656c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalItemStandRespDTO.java @@ -0,0 +1,153 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApproverWorkApprovalItemStandRespDTO implements Serializable { + + + private static final long serialVersionUID = 3860099039284777898L; + private Long standId; + + private Byte type; + + private String typeDesc; + + private Long eid; + + private Long depId; + + private String depName; + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + private String minValMatchPatternDesc; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + private String maxValMatchPatternDesc; + + private String title; + + private Long workApplyId; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + + public String getMinValMatchPatternDesc() { + return minValMatchPatternDesc; + } + + public void setMinValMatchPatternDesc(String minValMatchPatternDesc) { + this.minValMatchPatternDesc = minValMatchPatternDesc; + } + + public String getMaxValMatchPatternDesc() { + return maxValMatchPatternDesc; + } + + public void setMaxValMatchPatternDesc(String maxValMatchPatternDesc) { + this.maxValMatchPatternDesc = maxValMatchPatternDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalStepRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalStepRespDTO.java new file mode 100644 index 0000000..06613f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalStepRespDTO.java @@ -0,0 +1,205 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class ApproverWorkApprovalStepRespDTO implements Serializable { + + private static final long serialVersionUID = 8532433762943500767L; + + private Long stepId; + + //所属作业ID + private Long workApplyId; + + private String stepName; + + private Byte auditType; + + private String auditTypeDesc; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + private String typeDesc; + + //审批结果 + private Byte approvalResult; + + private String approvalResultDesc; + + //审批层级序号 + private Integer stepSerial; + + //开始审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime startApprovalTime; + + //预期结束时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expFinishApprovalTime; + + //结束审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime finishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean containItem; + + private List<ApproverWorkApprovalUnitRespDTO> stepUnits; + + private List<ApproverWorkApprovalItemRespDTO> stepItems; + + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getApprovalResult() { + return approvalResult; + } + + public void setApprovalResult(Byte approvalResult) { + this.approvalResult = approvalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public LocalDateTime getStartApprovalTime() { + return startApprovalTime; + } + + public void setStartApprovalTime(LocalDateTime startApprovalTime) { + this.startApprovalTime = startApprovalTime; + } + + public LocalDateTime getExpFinishApprovalTime() { + return expFinishApprovalTime; + } + + public void setExpFinishApprovalTime(LocalDateTime expFinishApprovalTime) { + this.expFinishApprovalTime = expFinishApprovalTime; + } + + public LocalDateTime getFinishApprovalTime() { + return finishApprovalTime; + } + + public void setFinishApprovalTime(LocalDateTime finishApprovalTime) { + this.finishApprovalTime = finishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + + + public List<ApproverWorkApprovalUnitRespDTO> getStepUnits() { + return stepUnits; + } + + public void setStepUnits(List<ApproverWorkApprovalUnitRespDTO> stepUnits) { + this.stepUnits = stepUnits; + } + + public List<ApproverWorkApprovalItemRespDTO> getStepItems() { + return stepItems; + } + + public void setStepItems(List<ApproverWorkApprovalItemRespDTO> stepItems) { + this.stepItems = stepItems; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public String getApprovalResultDesc() { + return approvalResultDesc; + } + + public void setApprovalResultDesc(String approvalResultDesc) { + this.approvalResultDesc = approvalResultDesc; + } + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } + + public String getAuditTypeDesc() { + return auditTypeDesc; + } + + public void setAuditTypeDesc(String auditTypeDesc) { + this.auditTypeDesc = auditTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitFilledItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitFilledItemRespDTO.java new file mode 100644 index 0000000..74b9ca2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitFilledItemRespDTO.java @@ -0,0 +1,208 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApproverWorkApprovalUnitFilledItemRespDTO implements Serializable { + + + private static final long serialVersionUID = 587179894762614992L; + + private Long id; + + private Long itemId; + + private Long unitId; + + private BigDecimal val; + + private Long workApplyId; + + private Byte measureVal; + + private String measureValDesc; + + private String measureText; + + private Byte fillType; + + private String fillTypeDesc; + + + //填报项名称 + private String itemName; + + //填报类型 数值、选项、填空... + private Byte itemType; + + private String itemTypeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + private ApproverWorkApprovalItemMeasureRespDTO measure; + + private ApproverWorkApprovalItemStandRespDTO stand; + + private String analysisLocation; + + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public BigDecimal getVal() { + return val; + } + + public void setVal(BigDecimal val) { + this.val = val; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getMeasureVal() { + return measureVal; + } + + public void setMeasureVal(Byte measureVal) { + this.measureVal = measureVal; + } + + public String getMeasureText() { + return measureText; + } + + public void setMeasureText(String measureText) { + this.measureText = measureText; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public String getItemTypeDesc() { + return itemTypeDesc; + } + + public void setItemTypeDesc(String itemTypeDesc) { + this.itemTypeDesc = itemTypeDesc; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + public ApproverWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(ApproverWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public ApproverWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(ApproverWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + public String getAnalysisLocation() { + return analysisLocation; + } + + public void setAnalysisLocation(String analysisLocation) { + this.analysisLocation = analysisLocation; + } + + public String getMeasureValDesc() { + return measureValDesc; + } + + public void setMeasureValDesc(String measureValDesc) { + this.measureValDesc = measureValDesc; + } + + public Byte getFillType() { + return fillType; + } + + public void setFillType(Byte fillType) { + this.fillType = fillType; + } + + public String getFillTypeDesc() { + return fillTypeDesc; + } + + public void setFillTypeDesc(String fillTypeDesc) { + this.fillTypeDesc = fillTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitRespDTO.java new file mode 100644 index 0000000..e79e6dc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovalUnitRespDTO.java @@ -0,0 +1,146 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 审批单元 + */ +public class ApproverWorkApprovalUnitRespDTO implements Serializable { + + + private static final long serialVersionUID = -4189973469841349267L; + //审批单元ID + private Long unitId; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //审批人ID + private Long approvalUid; + + private String approvalUname; + + //审批结果 + private Byte result; + + private String resultDesc; + + //审批开始时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalStartTime; + + //审批截止时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalEndTime; + + //实际审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalActualTime; + + private List<ApproverWorkApprovalUnitFilledItemRespDTO> filledItems; + + private String filledContent; + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public LocalDateTime getApprovalStartTime() { + return approvalStartTime; + } + + public void setApprovalStartTime(LocalDateTime approvalStartTime) { + this.approvalStartTime = approvalStartTime; + } + + public LocalDateTime getApprovalEndTime() { + return approvalEndTime; + } + + public void setApprovalEndTime(LocalDateTime approvalEndTime) { + this.approvalEndTime = approvalEndTime; + } + + public LocalDateTime getApprovalActualTime() { + return approvalActualTime; + } + + public void setApprovalActualTime(LocalDateTime approvalActualTime) { + this.approvalActualTime = approvalActualTime; + } + + public String getApprovalUname() { + return approvalUname; + } + + public void setApprovalUname(String approvalUname) { + this.approvalUname = approvalUname; + } + + public List<ApproverWorkApprovalUnitFilledItemRespDTO> getFilledItems() { + return filledItems; + } + + public void setFilledItems(List<ApproverWorkApprovalUnitFilledItemRespDTO> filledItems) { + this.filledItems = filledItems; + } + + public String getResultDesc() { + return resultDesc; + } + + public void setResultDesc(String resultDesc) { + this.resultDesc = resultDesc; + } + + public String getFilledContent() { + return filledContent; + } + + public void setFilledContent(String filledContent) { + this.filledContent = filledContent; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyDetailRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyDetailRespDTO.java new file mode 100644 index 0000000..8456ed2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyDetailRespDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.util.List; + +public class ApproverWorkApprovedApplyDetailRespDTO implements Serializable { + + private static final long serialVersionUID = 7963730210452658510L; + + private Long workApplyId; + + private String workPermitNo; + + private String workLocation; + + private String workContent; + + private String hazardIdentification; + + private String operatorUnames; + + private String operatorCompanys; + +// private List<ApproverWorkApprovedApplyOperatorRespDTO> operators; + + private List<ApproverWorkApprovalStepRespDTO> approvalSteps; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public List<ApproverWorkApprovalStepRespDTO> getApprovalSteps() { + return approvalSteps; + } + + public void setApprovalSteps(List<ApproverWorkApprovalStepRespDTO> approvalSteps) { + this.approvalSteps = approvalSteps; + } + + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyOperatorRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyOperatorRespDTO.java new file mode 100644 index 0000000..81d1a51 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkApprovedApplyOperatorRespDTO.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApproverWorkApprovedApplyOperatorRespDTO implements Serializable { + + + private static final long serialVersionUID = -5683328722008587142L; + + private Long id; + + private Long operatorUid; + + private Long workApplyId; + + private String operatorUname; + + private String operatorCertificate; + + private String operatorPhone; + + private String operatorIdentify; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public String getOperatorPhone() { + return operatorPhone; + } + + public void setOperatorPhone(String operatorPhone) { + this.operatorPhone = operatorPhone; + } + + public String getOperatorIdentify() { + return operatorIdentify; + } + + public void setOperatorIdentify(String operatorIdentify) { + this.operatorIdentify = operatorIdentify; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalDataRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalDataRespDTO.java new file mode 100644 index 0000000..ee289c5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalDataRespDTO.java @@ -0,0 +1,241 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class ApproverWorkPendingApprovalDataRespDTO implements Serializable { + + private static final long serialVersionUID = -406211561361957898L; + + //审批层级ID + private Long stepId; + + //所属作业ID + private Long workApplyId; + + private String stepName; + + //审批层级类型,单人,多人,分析人.... + private Byte stepType; + + private String stepTypeDesc; + + //审批结果 + private Byte stepApprovalResult; + + private String stepApprovalResultDesc; + + //开始审批时间 + private LocalDateTime stepStartApprovalTime; + + //预期结束时间 + private LocalDateTime stepExpFinishApprovalTime; + + //结束审批时间 + private LocalDateTime stepFinishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean containItem; + + private Long unitId; + + private Long approvalUid; + + private String approvalUname; + + private Byte unitApprovalResult; + + private String unitApprovalResultDesc; + + //审批开始时间 + private LocalDateTime unitApprovalStartTime; + + //审批截止时间 + private LocalDateTime unitApprovalEndTime; + + //实际审批时间 + private LocalDateTime unitApprovalActualTime; + + private List<ApproverWorkPendingApprovalItemRespDTO> items; + + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStepType() { + return stepType; + } + + public void setStepType(Byte stepType) { + this.stepType = stepType; + } + + public String getStepTypeDesc() { + return stepTypeDesc; + } + + public void setStepTypeDesc(String stepTypeDesc) { + this.stepTypeDesc = stepTypeDesc; + } + + public Byte getStepApprovalResult() { + return stepApprovalResult; + } + + public void setStepApprovalResult(Byte stepApprovalResult) { + this.stepApprovalResult = stepApprovalResult; + } + + public String getStepApprovalResultDesc() { + return stepApprovalResultDesc; + } + + public void setStepApprovalResultDesc(String stepApprovalResultDesc) { + this.stepApprovalResultDesc = stepApprovalResultDesc; + } + + public LocalDateTime getStepStartApprovalTime() { + return stepStartApprovalTime; + } + + public void setStepStartApprovalTime(LocalDateTime stepStartApprovalTime) { + this.stepStartApprovalTime = stepStartApprovalTime; + } + + public LocalDateTime getStepExpFinishApprovalTime() { + return stepExpFinishApprovalTime; + } + + public void setStepExpFinishApprovalTime(LocalDateTime stepExpFinishApprovalTime) { + this.stepExpFinishApprovalTime = stepExpFinishApprovalTime; + } + + public LocalDateTime getStepFinishApprovalTime() { + return stepFinishApprovalTime; + } + + public void setStepFinishApprovalTime(LocalDateTime stepFinishApprovalTime) { + this.stepFinishApprovalTime = stepFinishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public String getApprovalUname() { + return approvalUname; + } + + public void setApprovalUname(String approvalUname) { + this.approvalUname = approvalUname; + } + + public Byte getUnitApprovalResult() { + return unitApprovalResult; + } + + public void setUnitApprovalResult(Byte unitApprovalResult) { + this.unitApprovalResult = unitApprovalResult; + } + + public String getUnitApprovalResultDesc() { + return unitApprovalResultDesc; + } + + public void setUnitApprovalResultDesc(String unitApprovalResultDesc) { + this.unitApprovalResultDesc = unitApprovalResultDesc; + } + + public LocalDateTime getUnitApprovalStartTime() { + return unitApprovalStartTime; + } + + public void setUnitApprovalStartTime(LocalDateTime unitApprovalStartTime) { + this.unitApprovalStartTime = unitApprovalStartTime; + } + + public LocalDateTime getUnitApprovalEndTime() { + return unitApprovalEndTime; + } + + public void setUnitApprovalEndTime(LocalDateTime unitApprovalEndTime) { + this.unitApprovalEndTime = unitApprovalEndTime; + } + + public LocalDateTime getUnitApprovalActualTime() { + return unitApprovalActualTime; + } + + public void setUnitApprovalActualTime(LocalDateTime unitApprovalActualTime) { + this.unitApprovalActualTime = unitApprovalActualTime; + } + + public List<ApproverWorkPendingApprovalItemRespDTO> getItems() { + return items; + } + + public void setItems(List<ApproverWorkPendingApprovalItemRespDTO> items) { + this.items = items; + } + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemMeasureRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemMeasureRespDTO.java new file mode 100644 index 0000000..9bfd7d5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemMeasureRespDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApproverWorkPendingApprovalItemMeasureRespDTO implements Serializable { + + private static final long serialVersionUID = -3087275887505253057L; + + //ID,主键 + private Long measureId; + + //安全措施所属作业类型 + private Byte workType; + + private String workTypeDesc; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + private String typeDesc; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private Long workApplyId; + + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemRespDTO.java new file mode 100644 index 0000000..557beff --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemRespDTO.java @@ -0,0 +1,146 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class ApproverWorkPendingApprovalItemRespDTO implements Serializable { + + private static final long serialVersionUID = -573469137658526162L; + + //填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + private String typeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + private ApproverWorkPendingApprovalItemMeasureRespDTO measure; + + private ApproverWorkPendingApprovalItemStandRespDTO stand; + +// private boolean filled; +// +// private ApproverWorkApprovalUnitFilledItemRespDTO filledItemContent; + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + + public ApproverWorkPendingApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(ApproverWorkPendingApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public ApproverWorkPendingApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(ApproverWorkPendingApprovalItemStandRespDTO stand) { + this.stand = stand; + } + +// public boolean isFilled() { +// return filled; +// } +// +// public void setFilled(boolean filled) { +// this.filled = filled; +// } +// +// public ApproverWorkApprovalUnitFilledItemRespDTO getFilledItemContent() { +// return filledItemContent; +// } +// +// public void setFilledItemContent(ApproverWorkApprovalUnitFilledItemRespDTO filledItemContent) { +// this.filledItemContent = filledItemContent; +// } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemStandRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemStandRespDTO.java new file mode 100644 index 0000000..e80e068 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/ApproverWorkPendingApprovalItemStandRespDTO.java @@ -0,0 +1,136 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ApproverWorkPendingApprovalItemStandRespDTO implements Serializable { + + private static final long serialVersionUID = -7822298506621404656L; + + private Long standId; + + private Byte type; + + private String typeDesc; + + + private String depName; + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + private String minValMatchPatternDesc; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + private String maxValMatchPatternDesc; + + private String title; + + private Long workApplyId; + + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + + public String getMinValMatchPatternDesc() { + return minValMatchPatternDesc; + } + + public void setMinValMatchPatternDesc(String minValMatchPatternDesc) { + this.minValMatchPatternDesc = minValMatchPatternDesc; + } + + public String getMaxValMatchPatternDesc() { + return maxValMatchPatternDesc; + } + + public void setMaxValMatchPatternDesc(String maxValMatchPatternDesc) { + this.maxValMatchPatternDesc = maxValMatchPatternDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/DepRPCRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/DepRPCRespDTO.java new file mode 100644 index 0000000..33c8fe8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/DepRPCRespDTO.java @@ -0,0 +1,100 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.util.List; + +public class DepRPCRespDTO implements Serializable { + + private static final long serialVersionUID = -7301681475055521523L; + + private Long depId; + + private String depName; + + private String depInfo; + + private Byte depLevel; + + private String depLevelDesc; + + private Byte status; + + private String statusDesc; + + private Long parentDepId; + + private List<DepRPCRespDTO> children; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getDepInfo() { + return depInfo; + } + + public void setDepInfo(String depInfo) { + this.depInfo = depInfo; + } + + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public Long getParentDepId() { + return parentDepId; + } + + public void setParentDepId(Long parentDepId) { + this.parentDepId = parentDepId; + } + + public List<DepRPCRespDTO> getChildren() { + return children; + } + + public void setChildren(List<DepRPCRespDTO> children) { + this.children = children; + } + + public Byte getDepLevel() { + return depLevel; + } + + public void setDepLevel(Byte depLevel) { + this.depLevel = depLevel; + } + + public String getDepLevelDesc() { + return depLevelDesc; + } + + public void setDepLevelDesc(String depLevelDesc) { + this.depLevelDesc = depLevelDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemMeasureRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemMeasureRespDTO.java new file mode 100644 index 0000000..d03fb78 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemMeasureRespDTO.java @@ -0,0 +1,93 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class OthersWorkApprovalItemMeasureRespDTO implements Serializable { + + private static final long serialVersionUID = 2452825044423437631L; + //ID,主键 + private Long measureId; + + //安全措施所属作业类型 + private Byte workType; + + private String workTypeDesc; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + private String typeDesc; + + //正确值 + private Byte correctVal; + + //文字内容,最长64汉字 + private String context; + + private Long workApplyId; + + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getCorrectVal() { + return correctVal; + } + + public void setCorrectVal(Byte correctVal) { + this.correctVal = correctVal; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemRespDTO.java new file mode 100644 index 0000000..2bf40a5 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemRespDTO.java @@ -0,0 +1,141 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +/** + * 审批填报项 + */ +public class OthersWorkApprovalItemRespDTO implements Serializable { + + private static final long serialVersionUID = 7447788020253606629L; + //填报项ID + private Long itemId; + + //填报项名称 + private String itemName; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + private String typeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + private OthersWorkApprovalItemMeasureRespDTO measure; + + private OthersWorkApprovalItemStandRespDTO stand; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public OthersWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(OthersWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public OthersWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(OthersWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemStandRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemStandRespDTO.java new file mode 100644 index 0000000..cc1a38b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalItemStandRespDTO.java @@ -0,0 +1,153 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class OthersWorkApprovalItemStandRespDTO implements Serializable { + + private static final long serialVersionUID = 2569889781874856575L; + + private Long standId; + + private Byte type; + + private String typeDesc; + + private Long eid; + + private Long depId; + + private String depName; + //最低值 + private BigDecimal minVal; + + //最低值匹配模式,等于,大于... + private Byte minValMatchPattern; + + private String minValMatchPatternDesc; + + //最大值 + private BigDecimal maxVal; + + //最大值匹配模式,等于,大于... + private Byte maxValMatchPattern; + + private String maxValMatchPatternDesc; + + + private String title; + + private Long workApplyId; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public BigDecimal getMinVal() { + return minVal; + } + + public void setMinVal(BigDecimal minVal) { + this.minVal = minVal; + } + + public Byte getMinValMatchPattern() { + return minValMatchPattern; + } + + public void setMinValMatchPattern(Byte minValMatchPattern) { + this.minValMatchPattern = minValMatchPattern; + } + + public BigDecimal getMaxVal() { + return maxVal; + } + + public void setMaxVal(BigDecimal maxVal) { + this.maxVal = maxVal; + } + + public Byte getMaxValMatchPattern() { + return maxValMatchPattern; + } + + public void setMaxValMatchPattern(Byte maxValMatchPattern) { + this.maxValMatchPattern = maxValMatchPattern; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public String getMinValMatchPatternDesc() { + return minValMatchPatternDesc; + } + + public void setMinValMatchPatternDesc(String minValMatchPatternDesc) { + this.minValMatchPatternDesc = minValMatchPatternDesc; + } + + public String getMaxValMatchPatternDesc() { + return maxValMatchPatternDesc; + } + + public void setMaxValMatchPatternDesc(String maxValMatchPatternDesc) { + this.maxValMatchPatternDesc = maxValMatchPatternDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalStepRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalStepRespDTO.java new file mode 100644 index 0000000..fe38626 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalStepRespDTO.java @@ -0,0 +1,204 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class OthersWorkApprovalStepRespDTO implements Serializable { + + private static final long serialVersionUID = -5005407150792907362L; + + private Long stepId; + + private String stepName; + + private Byte auditType; + + private String auditTypeDesc; + + //所属作业ID + private Long workApplyId; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + private String typeDesc; + + //审批结果 + private Byte approvalResult; + + private String approvalResultDesc; + + //审批层级序号 + private Integer stepSerial; + + //开始审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime startApprovalTime; + + //预期结束时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expFinishApprovalTime; + + //结束审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime finishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean containItem; + + private List<OthersWorkApprovalUnitRespDTO> stepUnits; + + private List<OthersWorkApprovalItemRespDTO> stepItems; + + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getApprovalResult() { + return approvalResult; + } + + public void setApprovalResult(Byte approvalResult) { + this.approvalResult = approvalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public LocalDateTime getStartApprovalTime() { + return startApprovalTime; + } + + public void setStartApprovalTime(LocalDateTime startApprovalTime) { + this.startApprovalTime = startApprovalTime; + } + + public LocalDateTime getExpFinishApprovalTime() { + return expFinishApprovalTime; + } + + public void setExpFinishApprovalTime(LocalDateTime expFinishApprovalTime) { + this.expFinishApprovalTime = expFinishApprovalTime; + } + + public LocalDateTime getFinishApprovalTime() { + return finishApprovalTime; + } + + public void setFinishApprovalTime(LocalDateTime finishApprovalTime) { + this.finishApprovalTime = finishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public List<OthersWorkApprovalUnitRespDTO> getStepUnits() { + return stepUnits; + } + + public void setStepUnits(List<OthersWorkApprovalUnitRespDTO> stepUnits) { + this.stepUnits = stepUnits; + } + + public List<OthersWorkApprovalItemRespDTO> getStepItems() { + return stepItems; + } + + public void setStepItems(List<OthersWorkApprovalItemRespDTO> stepItems) { + this.stepItems = stepItems; + } + + + public String getTypeDesc() { + return typeDesc; + } + + public void setTypeDesc(String typeDesc) { + this.typeDesc = typeDesc; + } + + public String getApprovalResultDesc() { + return approvalResultDesc; + } + + public void setApprovalResultDesc(String approvalResultDesc) { + this.approvalResultDesc = approvalResultDesc; + } + + public Boolean getContainItem() { + return containItem; + } + + public void setContainItem(Boolean containItem) { + this.containItem = containItem; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } + + public Byte getAuditType() { + return auditType; + } + + public void setAuditType(Byte auditType) { + this.auditType = auditType; + } + + public String getAuditTypeDesc() { + return auditTypeDesc; + } + + public void setAuditTypeDesc(String auditTypeDesc) { + this.auditTypeDesc = auditTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitFilledItemRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitFilledItemRespDTO.java new file mode 100644 index 0000000..39d4ac6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitFilledItemRespDTO.java @@ -0,0 +1,204 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + + +import java.io.Serializable; +import java.math.BigDecimal; + +public class OthersWorkApprovalUnitFilledItemRespDTO implements Serializable { + + private static final long serialVersionUID = -846725374243167L; + + private Long id; + + private Long itemId; + + private Long unitId; + + private BigDecimal val; + + private Long workApplyId; + + private Byte measureVal; + + private String measureValDesc; + + private String measureText; + + private Byte fillType; + + private String fillTypeDesc; + + //填报项名称 + private String itemName; + + //填报类型 数值、选项、填空... + private Byte itemType; + + private String itemTypeDesc; + + //适用标准ID + private Long standId; + + private Long measureId; + + //安全措施 - 是否是涉及项 + private Boolean measureInvolve; + + private String analysisLocation; + + private OthersWorkApprovalItemMeasureRespDTO measure; + + private OthersWorkApprovalItemStandRespDTO stand; + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public BigDecimal getVal() { + return val; + } + + public void setVal(BigDecimal val) { + this.val = val; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getMeasureVal() { + return measureVal; + } + + public void setMeasureVal(Byte measureVal) { + this.measureVal = measureVal; + } + + public String getMeasureText() { + return measureText; + } + + public void setMeasureText(String measureText) { + this.measureText = measureText; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getStandId() { + return standId; + } + + public void setStandId(Long standId) { + this.standId = standId; + } + + public Long getMeasureId() { + return measureId; + } + + public void setMeasureId(Long measureId) { + this.measureId = measureId; + } + + public Boolean getMeasureInvolve() { + return measureInvolve; + } + + public void setMeasureInvolve(Boolean measureInvolve) { + this.measureInvolve = measureInvolve; + } + + public OthersWorkApprovalItemMeasureRespDTO getMeasure() { + return measure; + } + + public void setMeasure(OthersWorkApprovalItemMeasureRespDTO measure) { + this.measure = measure; + } + + public OthersWorkApprovalItemStandRespDTO getStand() { + return stand; + } + + public void setStand(OthersWorkApprovalItemStandRespDTO stand) { + this.stand = stand; + } + + public String getItemTypeDesc() { + return itemTypeDesc; + } + + public void setItemTypeDesc(String itemTypeDesc) { + this.itemTypeDesc = itemTypeDesc; + } + + public String getAnalysisLocation() { + return analysisLocation; + } + + public void setAnalysisLocation(String analysisLocation) { + this.analysisLocation = analysisLocation; + } + + public String getMeasureValDesc() { + return measureValDesc; + } + + public void setMeasureValDesc(String measureValDesc) { + this.measureValDesc = measureValDesc; + } + + public Byte getFillType() { + return fillType; + } + + public void setFillType(Byte fillType) { + this.fillType = fillType; + } + + public String getFillTypeDesc() { + return fillTypeDesc; + } + + public void setFillTypeDesc(String fillTypeDesc) { + this.fillTypeDesc = fillTypeDesc; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitRespDTO.java new file mode 100644 index 0000000..16d9200 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovalUnitRespDTO.java @@ -0,0 +1,146 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 审批单元 + */ +public class OthersWorkApprovalUnitRespDTO implements Serializable { + + private static final long serialVersionUID = 660094555470932414L; + //审批单元ID + private Long unitId; + + //所属作业ID + private Long workApplyId; + + //所属审批层级ID + private Long stepId; + + //审批人ID + private Long approvalUid; + + private String approvalUname; + + //审批结果 + private Byte result; + + private String resultDesc; + + //审批开始时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalStartTime; + + //审批截止时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalEndTime; + + //实际审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime approvalActualTime; + + private List<OthersWorkApprovalUnitFilledItemRespDTO> filledItems; + + private String filledContent; + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public LocalDateTime getApprovalStartTime() { + return approvalStartTime; + } + + public void setApprovalStartTime(LocalDateTime approvalStartTime) { + this.approvalStartTime = approvalStartTime; + } + + public LocalDateTime getApprovalEndTime() { + return approvalEndTime; + } + + public void setApprovalEndTime(LocalDateTime approvalEndTime) { + this.approvalEndTime = approvalEndTime; + } + + public LocalDateTime getApprovalActualTime() { + return approvalActualTime; + } + + public void setApprovalActualTime(LocalDateTime approvalActualTime) { + this.approvalActualTime = approvalActualTime; + } + + public String getApprovalUname() { + return approvalUname; + } + + public void setApprovalUname(String approvalUname) { + this.approvalUname = approvalUname; + } + + public List<OthersWorkApprovalUnitFilledItemRespDTO> getFilledItems() { + return filledItems; + } + + public void setFilledItems(List<OthersWorkApprovalUnitFilledItemRespDTO> filledItems) { + this.filledItems = filledItems; + } + + + public String getResultDesc() { + return resultDesc; + } + + public void setResultDesc(String resultDesc) { + this.resultDesc = resultDesc; + } + + public String getFilledContent() { + return filledContent; + } + + public void setFilledContent(String filledContent) { + this.filledContent = filledContent; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyDetailRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyDetailRespDTO.java new file mode 100644 index 0000000..028b60b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyDetailRespDTO.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; +import java.util.List; + +public class OthersWorkApprovedApplyDetailRespDTO implements Serializable { + + private static final long serialVersionUID = -2916670744741822555L; + + private Long workApplyId; + + private String workPermitNo; + + private String workLocation; + + private String workContent; + + private String hazardIdentification; + + private String operatorUnames; + + private String operatorCompanys; + + +// private List<OthersWorkApprovedApplyOperatorRespDTO> operators; + + private List<OthersWorkApprovalStepRespDTO> approvalSteps; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public List<OthersWorkApprovalStepRespDTO> getApprovalSteps() { + return approvalSteps; + } + + public void setApprovalSteps(List<OthersWorkApprovalStepRespDTO> approvalSteps) { + this.approvalSteps = approvalSteps; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyOperatorRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyOperatorRespDTO.java new file mode 100644 index 0000000..e66b513 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/OthersWorkApprovedApplyOperatorRespDTO.java @@ -0,0 +1,79 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class OthersWorkApprovedApplyOperatorRespDTO implements Serializable { + + private static final long serialVersionUID = -1030400404645249213L; + + private Long id; + + private Long operatorUid; + + private Long workApplyId; + + private String operatorUname; + + private String operatorCertificate; + + private String operatorPhone; + + private String operatorIdentify; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public String getOperatorPhone() { + return operatorPhone; + } + + public void setOperatorPhone(String operatorPhone) { + this.operatorPhone = operatorPhone; + } + + public String getOperatorIdentify() { + return operatorIdentify; + } + + public void setOperatorIdentify(String operatorIdentify) { + this.operatorIdentify = operatorIdentify; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyAtHeightRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyAtHeightRespDTO.java new file mode 100644 index 0000000..bd2d08f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyAtHeightRespDTO.java @@ -0,0 +1,63 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.math.BigDecimal; + +/** + * 高空作业 + */ +public class WorkApplyAtHeightRespDTO { + + //主键 + + private Long id; + //作业单位 + private Long operationDepId; + + //作业高度 + private BigDecimal operationHeight; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public BigDecimal getOperationHeight() { + return operationHeight; + } + + public void setOperationHeight(BigDecimal operationHeight) { + this.operationHeight = operationHeight; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBlindPlatePluggingRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBlindPlatePluggingRespDTO.java new file mode 100644 index 0000000..e0501a9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBlindPlatePluggingRespDTO.java @@ -0,0 +1,144 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 盲板抽堵作业 + */ +public class WorkApplyBlindPlatePluggingRespDTO { + + + //主键 + + private Long id; + //盲板编号 + private String bpCode; + //主要介质 + private String mainMedia; + //温度 + private BigDecimal temperature; + //压力 + private BigDecimal pressure; + //盲板材质 + private String bpMaterialQuality; + //盲板规格 + private String bpSpecification; + //盲板位置 + private String bpLocation; + //盲板位置图路径 + private String bpLocationMapPath; + //装盲板时间 + private LocalDateTime installBpTime; + //拆盲板时间 + private LocalDateTime uninstallBpTime; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getBpCode() { + return bpCode; + } + + public void setBpCode(String bpCode) { + this.bpCode = bpCode; + } + + public String getMainMedia() { + return mainMedia; + } + + public void setMainMedia(String mainMedia) { + this.mainMedia = mainMedia; + } + + public BigDecimal getTemperature() { + return temperature; + } + + public void setTemperature(BigDecimal temperature) { + this.temperature = temperature; + } + + public BigDecimal getPressure() { + return pressure; + } + + public void setPressure(BigDecimal pressure) { + this.pressure = pressure; + } + + public String getBpMaterialQuality() { + return bpMaterialQuality; + } + + public void setBpMaterialQuality(String bpMaterialQuality) { + this.bpMaterialQuality = bpMaterialQuality; + } + + public String getBpSpecification() { + return bpSpecification; + } + + public void setBpSpecification(String bpSpecification) { + this.bpSpecification = bpSpecification; + } + + public String getBpLocation() { + return bpLocation; + } + + public void setBpLocation(String bpLocation) { + this.bpLocation = bpLocation; + } + + public String getBpLocationMapPath() { + return bpLocationMapPath; + } + + public void setBpLocationMapPath(String bpLocationMapPath) { + this.bpLocationMapPath = bpLocationMapPath; + } + + public LocalDateTime getInstallBpTime() { + return installBpTime; + } + + public void setInstallBpTime(LocalDateTime installBpTime) { + this.installBpTime = installBpTime; + } + + public LocalDateTime getUninstallBpTime() { + return uninstallBpTime; + } + + public void setUninstallBpTime(LocalDateTime uninstallBpTime) { + this.uninstallBpTime = uninstallBpTime; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBrokenCircuitRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBrokenCircuitRespDTO.java new file mode 100644 index 0000000..2a592a0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyBrokenCircuitRespDTO.java @@ -0,0 +1,81 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +/** + * 断路作业 + */ +public class WorkApplyBrokenCircuitRespDTO { + + + //主键 + private Long id; + //作业单位 + private Long operationDepId; + + //断路原因 + private String bcReason; + //断路地段图片路径 + private String bcPath; + //断路地段说明 + private String bcExplain; + //作业申请id + private Long workApplyId; + //涉及相关部门 + private String involvedDepIds; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public String getBcReason() { + return bcReason; + } + + public void setBcReason(String bcReason) { + this.bcReason = bcReason; + } + + public String getBcPath() { + return bcPath; + } + + public void setBcPath(String bcPath) { + this.bcPath = bcPath; + } + + public String getBcExplain() { + return bcExplain; + } + + public void setBcExplain(String bcExplain) { + this.bcExplain = bcExplain; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getInvolvedDepIds() { + return involvedDepIds; + } + + public void setInvolvedDepIds(String involvedDepIds) { + this.involvedDepIds = involvedDepIds; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyConfinedSpaceRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyConfinedSpaceRespDTO.java new file mode 100644 index 0000000..3086204 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyConfinedSpaceRespDTO.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +/** + * 受限空间作业 + */ +public class WorkApplyConfinedSpaceRespDTO { + + //主键 + private Long id; + //受限空间所属单位id + private Long csDepId; + //受限空间名称 + private String csName; + //受限空间内原有介质名称 + private String csOriginalName; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCsDepId() { + return csDepId; + } + + public void setCsDepId(Long csDepId) { + this.csDepId = csDepId; + } + + public String getCsName() { + return csName; + } + + public void setCsName(String csName) { + this.csName = csName; + } + + public String getCsOriginalName() { + return csOriginalName; + } + + public void setCsOriginalName(String csOriginalName) { + this.csOriginalName = csOriginalName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyEightRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyEightRespDTO.java new file mode 100644 index 0000000..8d5ee87 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyEightRespDTO.java @@ -0,0 +1,5 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +class WorkApplyEightRespDTO { + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyGroundBreakingRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyGroundBreakingRespDTO.java new file mode 100644 index 0000000..a650434 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyGroundBreakingRespDTO.java @@ -0,0 +1,80 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +/** + * 动土作业 + */ +public class WorkApplyGroundBreakingRespDTO { + + //主键 + private Long id; + //作业单位 + private Long operationDepId; + //动土范围 + private String gbScope; + //动土方式 + private String gbMethod; + //图片路径 + private String gbPath; + //作业申请id + private Long workApplyId; + //涉及其他特殊作业 + private String otherSpecialWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + + public String getGbScope() { + return gbScope; + } + + public void setGbScope(String gbScope) { + this.gbScope = gbScope; + } + + public String getGbMethod() { + return gbMethod; + } + + public void setGbMethod(String gbMethod) { + this.gbMethod = gbMethod; + } + + public String getGbPath() { + return gbPath; + } + + public void setGbPath(String gbPath) { + this.gbPath = gbPath; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHoistingRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHoistingRespDTO.java new file mode 100644 index 0000000..dcd3166 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHoistingRespDTO.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.math.BigDecimal; + +/** + * 吊装作业 + */ +public class WorkApplyHoistingRespDTO { + + //主键 + private Long id; + //吊装工具名称 + private String hoistingToolName; + //起吊物体质量 + private BigDecimal weightMass; + //作业申请id + private Long workApplyId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getHoistingToolName() { + return hoistingToolName; + } + + public void setHoistingToolName(String hoistingToolName) { + this.hoistingToolName = hoistingToolName; + } + + public BigDecimal getWeightMass() { + return weightMass; + } + + public void setWeightMass(BigDecimal weightMass) { + this.weightMass = weightMass; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHotRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHotRespDTO.java new file mode 100644 index 0000000..de7b096 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyHotRespDTO.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class WorkApplyHotRespDTO extends WorkApplyEightRespDTO implements Serializable { + + private static final long serialVersionUID = 1585114854056582682L; + + private Long hotId; + + private String hotMethod; + + private Long workApplyId; + + private String otherSpecialWork; + + public Long getHotId() { + return hotId; + } + + public void setHotId(Long hotId) { + this.hotId = hotId; + } + + public String getHotMethod() { + return hotMethod; + } + + public void setHotMethod(String hotMethod) { + this.hotMethod = hotMethod; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOtherSpecialWork() { + return otherSpecialWork; + } + + public void setOtherSpecialWork(String otherSpecialWork) { + this.otherSpecialWork = otherSpecialWork; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyOperatorRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyOperatorRespDTO.java new file mode 100644 index 0000000..971a85e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyOperatorRespDTO.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.io.Serializable; + +public class WorkApplyOperatorRespDTO implements Serializable { + + private static final long serialVersionUID = 4691462822641543447L; + + private Long id; + + private Long operatorUid; + + private Long workApplyId; + + private String operatorUname; + + private String operatorCertificate; + + private String operatorPhone; + + private String operatorIdentify; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public String getOperatorCertificate() { + return operatorCertificate; + } + + public void setOperatorCertificate(String operatorCertificate) { + this.operatorCertificate = operatorCertificate; + } + + public String getOperatorPhone() { + return operatorPhone; + } + + public void setOperatorPhone(String operatorPhone) { + this.operatorPhone = operatorPhone; + } + + public String getOperatorIdentify() { + return operatorIdentify; + } + + public void setOperatorIdentify(String operatorIdentify) { + this.operatorIdentify = operatorIdentify; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPageRespDTO.java new file mode 100644 index 0000000..2f8b8f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPageRespDTO.java @@ -0,0 +1,296 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + + +public class WorkApplyPageRespDTO implements Serializable { + + private static final long serialVersionUID = 1781042196278094202L; + //作业ID + private Long workApplyId; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + private String depName; + + //申请人员ID + private Long applyUid; + + private String applyUname; + + //作业类型 + private Byte workType; + + private String workTypeDesc; + + //作业等级 + private Byte workLevel; + + private String workLevelDesc; + + //作业状态 + private Byte status; + + private String statusDesc; + + //当前所处审批流程层级 + private Integer approvalStep; + + private Long approvalStepId; + + private String workContent; + + private String workLocation; + // 危险辨识 + private String hazardIdentification; + + private String operatorUnames; + + private String operatorCompanys; + + +// private List<WorkApplyOperatorRespDTO> operators; + + private Object workDetail; + + //申请时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime applyTime; + + //预期作业开始进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expEndTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + //作业证编号 + private String workPermitNo; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getApprovalStepId() { + return approvalStepId; + } + + public void setApprovalStepId(Long approvalStepId) { + this.approvalStepId = approvalStepId; + } + + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public Object getWorkDetail() { + return workDetail; + } + + public void setWorkDetail(Object workDetail) { + this.workDetail = workDetail; + } + + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPendingPageRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPendingPageRespDTO.java new file mode 100644 index 0000000..648ad17 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyPendingPageRespDTO.java @@ -0,0 +1,521 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + + +public class WorkApplyPendingPageRespDTO implements Serializable { + + private static final long serialVersionUID = 1781042196278094202L; + //作业ID + private Long workApplyId; + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + private String depName; + + //申请人员ID + private Long applyUid; + + private String applyUname; + + //作业类型 + private Byte workType; + + private String workTypeDesc; + + //作业等级 + private Byte workLevel; + + private String workLevelDesc; + + //作业状态 + private Byte status; + + private String statusDesc; + + //当前所处审批流程层级 + private Integer approvalStep; + + private Long approvalStepId; + + + private String workContent; + + private String workLocation; + + private String hazardIdentification; + + //申请时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime applyTime; + + //预期作业开始进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expStartTime; + + //预期作业结束进行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime expEndTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtCreate; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime gmtModified; + + //作业证编号 + private String workPermitNo; + + private Long stepId; + + private Byte stepType; + + private String stepTypeDesc; + + private Byte stepApprovalResult; + + private String stepApprovalResultDesc; + + private Integer stepSerial; + + private Object WorkDetail; + + //开始审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime stepStartApprovalTime; + + //预期结束时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime stepExpFinishApprovalTime; + + //结束审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime stepFinishApprovalTime; + + private Long preStepId; + + private Long nextStepId; + + private Boolean stepContainItem; + + private Long unitId; + + private Long unitApprovalUid; + + private String unitApprovalUname; + + private Byte unitResult; + + private String unitResultDesc; + + private String unitFilledContent; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime unitApprovalStartTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime unitApprovalEndTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime unitApprovalActualTime; + + +// private List<WorkApplyOperatorRespDTO> operators; + + private String operatorUnames; + + private String operatorCompanys; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Integer getApprovalStep() { + return approvalStep; + } + + public void setApprovalStep(Integer approvalStep) { + this.approvalStep = approvalStep; + } + + public LocalDateTime getApplyTime() { + return applyTime; + } + + public void setApplyTime(LocalDateTime applyTime) { + this.applyTime = applyTime; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } + + public LocalDateTime getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Long getApprovalStepId() { + return approvalStepId; + } + + public void setApprovalStepId(Long approvalStepId) { + this.approvalStepId = approvalStepId; + } + + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Byte getStepType() { + return stepType; + } + + public void setStepType(Byte stepType) { + this.stepType = stepType; + } + + public String getStepTypeDesc() { + return stepTypeDesc; + } + + public void setStepTypeDesc(String stepTypeDesc) { + this.stepTypeDesc = stepTypeDesc; + } + + public Byte getStepApprovalResult() { + return stepApprovalResult; + } + + public void setStepApprovalResult(Byte stepApprovalResult) { + this.stepApprovalResult = stepApprovalResult; + } + + public String getStepApprovalResultDesc() { + return stepApprovalResultDesc; + } + + public void setStepApprovalResultDesc(String stepApprovalResultDesc) { + this.stepApprovalResultDesc = stepApprovalResultDesc; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + public LocalDateTime getStepStartApprovalTime() { + return stepStartApprovalTime; + } + + public void setStepStartApprovalTime(LocalDateTime stepStartApprovalTime) { + this.stepStartApprovalTime = stepStartApprovalTime; + } + + public LocalDateTime getStepExpFinishApprovalTime() { + return stepExpFinishApprovalTime; + } + + public void setStepExpFinishApprovalTime(LocalDateTime stepExpFinishApprovalTime) { + this.stepExpFinishApprovalTime = stepExpFinishApprovalTime; + } + + public LocalDateTime getStepFinishApprovalTime() { + return stepFinishApprovalTime; + } + + public void setStepFinishApprovalTime(LocalDateTime stepFinishApprovalTime) { + this.stepFinishApprovalTime = stepFinishApprovalTime; + } + + public Long getPreStepId() { + return preStepId; + } + + public void setPreStepId(Long preStepId) { + this.preStepId = preStepId; + } + + public Long getNextStepId() { + return nextStepId; + } + + public void setNextStepId(Long nextStepId) { + this.nextStepId = nextStepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Long getUnitApprovalUid() { + return unitApprovalUid; + } + + public void setUnitApprovalUid(Long unitApprovalUid) { + this.unitApprovalUid = unitApprovalUid; + } + + public String getUnitApprovalUname() { + return unitApprovalUname; + } + + public void setUnitApprovalUname(String unitApprovalUname) { + this.unitApprovalUname = unitApprovalUname; + } + + public Byte getUnitResult() { + return unitResult; + } + + public void setUnitResult(Byte unitResult) { + this.unitResult = unitResult; + } + + public String getUnitResultDesc() { + return unitResultDesc; + } + + public void setUnitResultDesc(String unitResultDesc) { + this.unitResultDesc = unitResultDesc; + } + + public LocalDateTime getUnitApprovalStartTime() { + return unitApprovalStartTime; + } + + public void setUnitApprovalStartTime(LocalDateTime unitApprovalStartTime) { + this.unitApprovalStartTime = unitApprovalStartTime; + } + + public LocalDateTime getUnitApprovalEndTime() { + return unitApprovalEndTime; + } + + public void setUnitApprovalEndTime(LocalDateTime unitApprovalEndTime) { + this.unitApprovalEndTime = unitApprovalEndTime; + } + + public LocalDateTime getUnitApprovalActualTime() { + return unitApprovalActualTime; + } + + public void setUnitApprovalActualTime(LocalDateTime unitApprovalActualTime) { + this.unitApprovalActualTime = unitApprovalActualTime; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public Boolean getStepContainItem() { + return stepContainItem; + } + + public void setStepContainItem(Boolean stepContainItem) { + this.stepContainItem = stepContainItem; + } + + public String getUnitFilledContent() { + return unitFilledContent; + } + + public void setUnitFilledContent(String unitFilledContent) { + this.unitFilledContent = unitFilledContent; + } + + + public Object getWorkDetail() { + return WorkDetail; + } + + public void setWorkDetail(Object workDetail) { + WorkDetail = workDetail; + } + + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public String getOperatorUnames() { + return operatorUnames; + } + + public void setOperatorUnames(String operatorUnames) { + this.operatorUnames = operatorUnames; + } + + public String getOperatorCompanys() { + return operatorCompanys; + } + + public void setOperatorCompanys(String operatorCompanys) { + this.operatorCompanys = operatorCompanys; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyRecordRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyRecordRespDTO.java new file mode 100644 index 0000000..90f6b1a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyRecordRespDTO.java @@ -0,0 +1,123 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyRecordRespDTO implements Serializable { + + private static final long serialVersionUID = -4594640770927831987L; + + private Long id; + + private Long workApplyId; + + private Long stepId; + + private String stepName; + + private Long operatorUid; + + private String operatorUname; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime operationTime; + // 是否是系统操作 + private Boolean systen; + + private Integer operation; + + private String operationDesc; + + private String content; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Boolean getSysten() { + return systen; + } + + public void setSysten(Boolean systen) { + this.systen = systen; + } + + public Integer getOperation() { + return operation; + } + + public void setOperation(Integer operation) { + this.operation = operation; + } + + public String getOperationDesc() { + return operationDesc; + } + + public void setOperationDesc(String operationDesc) { + this.operationDesc = operationDesc; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyReportableRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyReportableRespDTO.java new file mode 100644 index 0000000..9f2ef26 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyReportableRespDTO.java @@ -0,0 +1,152 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyReportableRespDTO implements Serializable { + + private static final long serialVersionUID = 6940524130655503949L; + + private Long workApplyId; + + //作业类型 + private Byte workType; + + //作业类型 + private String workTypeDesc; + + //作业等级 + private Byte workLevel; + + private String workLevelDesc; + + //作业证编号 + private String workPermitNo; + + + private String workContent; + + // 作业地点 + private String workLocation; + + // 危害辨识 + private String hazardIdentification; + + private Byte status; + + private String statusDesc; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime expStartTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime expEndTime; + + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public String getWorkContent() { + return workContent; + } + + public void setWorkContent(String workContent) { + this.workContent = workContent; + } + + public String getWorkLocation() { + return workLocation; + } + + public void setWorkLocation(String workLocation) { + this.workLocation = workLocation; + } + + public String getHazardIdentification() { + return hazardIdentification; + } + + public void setHazardIdentification(String hazardIdentification) { + this.hazardIdentification = hazardIdentification; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public LocalDateTime getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(LocalDateTime expStartTime) { + this.expStartTime = expStartTime; + } + + public LocalDateTime getExpEndTime() { + return expEndTime; + } + + public void setExpEndTime(LocalDateTime expEndTime) { + this.expEndTime = expEndTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyTemporaryPowerRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyTemporaryPowerRespDTO.java new file mode 100644 index 0000000..5cb50a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkApplyTemporaryPowerRespDTO.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.math.BigDecimal; + +/** + * 临时用电 + */ +public class WorkApplyTemporaryPowerRespDTO{ + + + //主键 + private Long id; + //电源接入点 + private String powerAccessPoint; + //工作电压 + private BigDecimal workingVoltage; + //作业申请id + private Long workApplyId; + //用电设备及功率 + private String equipmentAndPower; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPowerAccessPoint() { + return powerAccessPoint; + } + + public void setPowerAccessPoint(String powerAccessPoint) { + this.powerAccessPoint = powerAccessPoint; + } + + public BigDecimal getWorkingVoltage() { + return workingVoltage; + } + + public void setWorkingVoltage(BigDecimal workingVoltage) { + this.workingVoltage = workingVoltage; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getEquipmentAndPower() { + return equipmentAndPower; + } + + public void setEquipmentAndPower(String equipmentAndPower) { + this.equipmentAndPower = equipmentAndPower; + } +} + diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkDepStatisticRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkDepStatisticRespDTO.java new file mode 100644 index 0000000..d0cd199 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkDepStatisticRespDTO.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import java.util.List; + +public class WorkDepStatisticRespDTO { + private Long depId; + private String depName; + private Integer totalCount; + private List<WorkTypeStatisticRespDTO> typeList; + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List<WorkTypeStatisticRespDTO> getTypeList() { + return typeList; + } + + public void setTypeList(List<WorkTypeStatisticRespDTO> typeList) { + this.typeList = typeList; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessDetectionInfoRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessDetectionInfoRespDTO.java new file mode 100644 index 0000000..371b94e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessDetectionInfoRespDTO.java @@ -0,0 +1,224 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +public class WorkProcessDetectionInfoRespDTO implements Serializable { + + private static final long serialVersionUID = -5526302693290339334L; + + private Long workProcessDetectionId; + + private Long workApplyId; + + private String workPermitNo; + + private Byte workType; + + private String workTypeDesc; + + private Byte workLevel; + + private String workLevelDesc; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime operationTime; + + private Long operatorUid; + + private String operatorUname; + + private String info; + + private BigDecimal combustible; + + private BigDecimal oxygen; + + private BigDecimal carbonMonoxide; + + private BigDecimal hydrogenSulfide; + // 数据状态 + private Byte status; + + private String statusDesc; + + // 检测结果 1-正常 2-异常 + private Byte result; + + private String resultDesc; + + private Byte source; + + private String sourceDesc; + + public Long getWorkProcessDetectionId() { + return workProcessDetectionId; + } + + public void setWorkProcessDetectionId(Long workProcessDetectionId) { + this.workProcessDetectionId = workProcessDetectionId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public BigDecimal getCombustible() { + return combustible; + } + + public void setCombustible(BigDecimal combustible) { + this.combustible = combustible; + } + + public BigDecimal getOxygen() { + return oxygen; + } + + public void setOxygen(BigDecimal oxygen) { + this.oxygen = oxygen; + } + + public BigDecimal getCarbonMonoxide() { + return carbonMonoxide; + } + + public void setCarbonMonoxide(BigDecimal carbonMonoxide) { + this.carbonMonoxide = carbonMonoxide; + } + + public BigDecimal getHydrogenSulfide() { + return hydrogenSulfide; + } + + public void setHydrogenSulfide(BigDecimal hydrogenSulfide) { + this.hydrogenSulfide = hydrogenSulfide; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public String getResultDesc() { + return resultDesc; + } + + public void setResultDesc(String resultDesc) { + this.resultDesc = resultDesc; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + public String getSourceDesc() { + return sourceDesc; + } + + public void setSourceDesc(String sourceDesc) { + this.sourceDesc = sourceDesc; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessWarningInfoRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessWarningInfoRespDTO.java new file mode 100644 index 0000000..a77f75c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkProcessWarningInfoRespDTO.java @@ -0,0 +1,204 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class WorkProcessWarningInfoRespDTO implements Serializable { + + private static final long serialVersionUID = -3225169552154720750L; + + private Long workProcessWarningId; + + private Long workApplyId; + + private String workPermitNo; + + private String warningContent; + + private Byte warningType; + + private String warningTypeDesc; + + private String warningInfo; + + private Long operatorUid; + + private String operatorUname; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime operationTime; + + private Byte status; + + private String statusDesc; + + private Byte source; + + private String sourceDesc; + + private Byte workType; + + private String workTypeDesc; + + private Byte workLevel; + + private String workLevelDesc; + + private List<String> imagePaths; + + + public Long getWorkProcessWarningId() { + return workProcessWarningId; + } + + public void setWorkProcessWarningId(Long workProcessWarningId) { + this.workProcessWarningId = workProcessWarningId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public String getWarningContent() { + return warningContent; + } + + public void setWarningContent(String warningContent) { + this.warningContent = warningContent; + } + + public Byte getWarningType() { + return warningType; + } + + public void setWarningType(Byte warningType) { + this.warningType = warningType; + } + + public String getWarningTypeDesc() { + return warningTypeDesc; + } + + public void setWarningTypeDesc(String warningTypeDesc) { + this.warningTypeDesc = warningTypeDesc; + } + + public String getWarningInfo() { + return warningInfo; + } + + public void setWarningInfo(String warningInfo) { + this.warningInfo = warningInfo; + } + + public Long getOperatorUid() { + return operatorUid; + } + + public void setOperatorUid(Long operatorUid) { + this.operatorUid = operatorUid; + } + + public String getOperatorUname() { + return operatorUname; + } + + public void setOperatorUname(String operatorUname) { + this.operatorUname = operatorUname; + } + + public LocalDateTime getOperationTime() { + return operationTime; + } + + public void setOperationTime(LocalDateTime operationTime) { + this.operationTime = operationTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getStatusDesc() { + return statusDesc; + } + + public void setStatusDesc(String statusDesc) { + this.statusDesc = statusDesc; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + public String getSourceDesc() { + return sourceDesc; + } + + public void setSourceDesc(String sourceDesc) { + this.sourceDesc = sourceDesc; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public String getWorkTypeDesc() { + return workTypeDesc; + } + + public void setWorkTypeDesc(String workTypeDesc) { + this.workTypeDesc = workTypeDesc; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public String getWorkLevelDesc() { + return workLevelDesc; + } + + public void setWorkLevelDesc(String workLevelDesc) { + this.workLevelDesc = workLevelDesc; + } + + public List<String> getImagePaths() { + return imagePaths; + } + + public void setImagePaths(List<String> imagePaths) { + this.imagePaths = imagePaths; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkTypeStatisticRespDTO.java b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkTypeStatisticRespDTO.java new file mode 100644 index 0000000..34f7574 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/dto/resp/WorkTypeStatisticRespDTO.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.model.dto.resp; + +public class WorkTypeStatisticRespDTO { + private Byte workType; + private String WorkTypeName; + private Integer count; + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public String getWorkTypeName() { + return WorkTypeName; + } + + public void setWorkTypeName(String workTypeName) { + WorkTypeName = workTypeName; + } + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/AllWorkApplyPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/AllWorkApplyPageQuery.java new file mode 100644 index 0000000..af5bced --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/AllWorkApplyPageQuery.java @@ -0,0 +1,74 @@ +package com.gk.hotwork.specialWork.model.query; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +public class AllWorkApplyPageQuery implements Serializable { + + private static final long serialVersionUID = -4746522030456952618L; + + private Byte status; + + private Byte workType; + + private Byte workLevel; + + private Long applyDepId; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date applyStartTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date applyEndTime; + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Long getApplyDepId() { + return applyDepId; + } + + public void setApplyDepId(Long applyDepId) { + this.applyDepId = applyDepId; + } + + public Date getApplyStartTime() { + return applyStartTime; + } + + public void setApplyStartTime(Date applyStartTime) { + this.applyStartTime = applyStartTime; + } + + public Date getApplyEndTime() { + return applyEndTime; + } + + public void setApplyEndTime(Date applyEndTime) { + this.applyEndTime = applyEndTime; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemPageQuery.java new file mode 100644 index 0000000..494a1db --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemPageQuery.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class ApprovalRuleItemPageQuery implements Serializable { + + private static final long serialVersionUID = -6787181264140995138L; + + // 填报项名称 + private String itemName; + + // 该审批项类型 + private Byte itemType; + + // 适应审批项填报标准ID + private Long itemStandId; + + // 是否包含审批项标准 + private boolean containItemStandEnable; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + public boolean isContainItemStandEnable() { + return containItemStandEnable; + } + + public void setContainItemStandEnable(boolean containItemStandEnable) { + this.containItemStandEnable = containItemStandEnable; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemQuery.java new file mode 100644 index 0000000..6af63a4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleItemQuery.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class ApprovalRuleItemQuery implements Serializable { + + private static final long serialVersionUID = -6787181264140995138L; + + //填报项名称 + private String itemName; + + //该审批项类型 + private Byte itemType; + + //适应审批项填报标准ID + private Long itemStandId; + + private boolean containItemStandEnable; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + public boolean isContainItemStandEnable() { + return containItemStandEnable; + } + + public void setContainItemStandEnable(boolean containItemStandEnable) { + this.containItemStandEnable = containItemStandEnable; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleListQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleListQuery.java new file mode 100644 index 0000000..134a27e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleListQuery.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.specialWork.model.query; + +public class ApprovalRuleListQuery { + + //企业ID + private Long eid; + + //部门ID + private Long depId; + + //状态 + private Byte status; + + //作业类型 + private Byte workType; + + //创建人ID + private Long createUid; + + //创建人员姓名 + private String createUname; + + //分页标识,true需要分页,false不分页 + private Boolean pageable; + + //页大小 + private Long pageSize; + + //查询页数 + private Long pageIndex; + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandListQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandListQuery.java new file mode 100644 index 0000000..38a89c3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandListQuery.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class ApprovalRuleStandListQuery implements Serializable { + + private static final long serialVersionUID = -1337966430634539660L; + //标准类型 + private Byte ruleStandType; + + //标准标题 + private String title; + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandPageQuery.java new file mode 100644 index 0000000..bc17237 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/ApprovalRuleStandPageQuery.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class ApprovalRuleStandPageQuery implements Serializable { + + private static final long serialVersionUID = -6114138984117049335L; + + //标准类型 + private Byte ruleStandType; + + //标准标题 + private String title; + + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyApplyingPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyApplyingPageQuery.java new file mode 100644 index 0000000..afab94a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyApplyingPageQuery.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.specialWork.model.query; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyApplyingPageQuery implements Serializable { + + private static final long serialVersionUID = -8793440313723450419L; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + private Byte status; + + private Byte workType; + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyPendingPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyPendingPageQuery.java new file mode 100644 index 0000000..b51f22c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyPendingPageQuery.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.specialWork.model.query; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyPendingPageQuery implements Serializable { + + private static final long serialVersionUID = 472228974480022710L; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + private String applyUname; + + private Byte workType; + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyRecordListQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyRecordListQuery.java new file mode 100644 index 0000000..6f385ec --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkApplyRecordListQuery.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class WorkApplyRecordListQuery implements Serializable { + + private static final long serialVersionUID = 3556850919208490922L; + + private Long workApplyId; + + private Long stepId; + + private String operatorName; + + private boolean systemEnable; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public boolean isSystemEnable() { + return systemEnable; + } + + public void setSystemEnable(boolean systemEnable) { + this.systemEnable = systemEnable; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkAtHeightQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkAtHeightQuery.java new file mode 100644 index 0000000..f4d5df8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkAtHeightQuery.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkAtHeightQuery { + + //作业单位id + private Long operationDepId; + + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBlindPlatePluggingQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBlindPlatePluggingQuery.java new file mode 100644 index 0000000..168f781 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBlindPlatePluggingQuery.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkBlindPlatePluggingQuery { + + + + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBrokenCircuitQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBrokenCircuitQuery.java new file mode 100644 index 0000000..ecb8e57 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkBrokenCircuitQuery.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkBrokenCircuitQuery { + + //作业单位id + private Long operationDepId; + + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getOperationDepId() { + return operationDepId; + } + + public void setOperationDepId(Long operationDepId) { + this.operationDepId = operationDepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkConfinedSpaceQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkConfinedSpaceQuery.java new file mode 100644 index 0000000..3882519 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkConfinedSpaceQuery.java @@ -0,0 +1,36 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkConfinedSpaceQuery { + + //受限空间所属单位id + private Long csDepId; + + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getCsDepId() { + return csDepId; + } + + public void setCsDepId(Long csDepId) { + this.csDepId = csDepId; + } + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkGroundBreakingQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkGroundBreakingQuery.java new file mode 100644 index 0000000..79ee602 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkGroundBreakingQuery.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkGroundBreakingQuery { + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkHoistingQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkHoistingQuery.java new file mode 100644 index 0000000..85fd49e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkHoistingQuery.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkHoistingQuery { + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessDetectionPageQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessDetectionPageQuery.java new file mode 100644 index 0000000..083e8a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessDetectionPageQuery.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class WorkProcessDetectionPageQuery implements Serializable { + + private static final long serialVersionUID = -1828468030633478965L; + + private Byte workType; + + private String workPermitNo; + + private Byte result; + + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessWorkApplyQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessWorkApplyQuery.java new file mode 100644 index 0000000..8b76efd --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkProcessWorkApplyQuery.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.specialWork.model.query; + +import java.io.Serializable; + +public class WorkProcessWorkApplyQuery implements Serializable { + + private static final long serialVersionUID = 7483484275529329081L; + + private String workPermitNo; + + private Byte workType; + + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/WorkTemporaryPowerQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkTemporaryPowerQuery.java new file mode 100644 index 0000000..eaa4ab6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/WorkTemporaryPowerQuery.java @@ -0,0 +1,24 @@ +package com.gk.hotwork.specialWork.model.query; + +public class WorkTemporaryPowerQuery { + //作业申请id + private Long workApplyId; + //状态 + private Byte status; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/AllWorkApplyPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/AllWorkApplyPageDBQuery.java new file mode 100644 index 0000000..695e227 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/AllWorkApplyPageDBQuery.java @@ -0,0 +1,72 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +public class AllWorkApplyPageDBQuery implements Serializable { + + private static final long serialVersionUID = 5228385705035546086L; + + + private Byte status; + + private Byte workType; + + private Byte workLevel; + + private Long applyDepId; + + private Date applyStartTime; + + private Date applyEndTime; + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Long getApplyDepId() { + return applyDepId; + } + + public void setApplyDepId(Long applyDepId) { + this.applyDepId = applyDepId; + } + + public Date getApplyStartTime() { + return applyStartTime; + } + + public void setApplyStartTime(Date applyStartTime) { + this.applyStartTime = applyStartTime; + } + + public Date getApplyEndTime() { + return applyEndTime; + } + + public void setApplyEndTime(Date applyEndTime) { + this.applyEndTime = applyEndTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemDBQuery.java new file mode 100644 index 0000000..db44cd4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemDBQuery.java @@ -0,0 +1,51 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class ApprovalRuleItemDBQuery implements Serializable { + + private static final long serialVersionUID = 3162328358610573292L; + //填报项名称 + private String itemName; + + //该审批项类型 + private Byte itemType; + + //适应审批项填报标准ID + private Long itemStandId; + + private Byte status; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemMeasureQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemMeasureQuery.java new file mode 100644 index 0000000..32a6524 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemMeasureQuery.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.specialWork.model.query.db; + + + +public class ApprovalRuleItemMeasureQuery { + //安全措施所属作业类型 + private Byte workType; + + //安全措施类型,1:选择 | 2:填空 + private Byte type; + + //文字内容,最长64汉字 + private String context; + + //安全措施状态 + private Byte status; + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemPageDBQuery.java new file mode 100644 index 0000000..329fc31 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleItemPageDBQuery.java @@ -0,0 +1,50 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class ApprovalRuleItemPageDBQuery implements Serializable { + + private static final long serialVersionUID = 1734712689928808267L; + //填报项名称 + private String itemName; + + //该审批项类型 + private Byte itemType; + + //适应审批项填报标准ID + private Long itemStandId; + + private Byte status; + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public Byte getItemType() { + return itemType; + } + + public void setItemType(Byte itemType) { + this.itemType = itemType; + } + + public Long getItemStandId() { + return itemStandId; + } + + public void setItemStandId(Long itemStandId) { + this.itemStandId = itemStandId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleListDbQuery.java new file mode 100644 index 0000000..912be4e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleListDbQuery.java @@ -0,0 +1,91 @@ +package com.gk.hotwork.specialWork.model.query.db; + +public class ApprovalRuleListDbQuery { + + //企业ID + private Long eid; + + //部门ID + private Long depId; + + //状态 + private Byte status; + + //作业类型 + private Byte workType; + + //作业等级 + private Byte workLevel; + + //创建人ID + private Long createUid; + + //创建人员姓名 + private String createUname; + + private String ruleName; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public Long getCreateUid() { + return createUid; + } + + public void setCreateUid(Long createUid) { + this.createUid = createUid; + } + + public String getCreateUname() { + return createUname; + } + + public void setCreateUname(String createUname) { + this.createUname = createUname; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandListDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandListDBQuery.java new file mode 100644 index 0000000..6b99ea7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandListDBQuery.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class ApprovalRuleStandListDBQuery implements Serializable { + + private static final long serialVersionUID = -7575095206853293712L; + + //标准类型 + private Byte ruleStandType; + + //标准状态 + private Byte status; + + //标准标题 + private String title; + + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandPageDBQuery.java new file mode 100644 index 0000000..28b58c8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStandPageDBQuery.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class ApprovalRuleStandPageDBQuery implements Serializable { + + private static final long serialVersionUID = 8494452034934728461L; + + //标准类型 + private Byte ruleStandType; + + //标准标题 + private String title; + + //标准状态 + private Byte status; + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + + public Byte getRuleStandType() { + return ruleStandType; + } + + public void setRuleStandType(Byte ruleStandType) { + this.ruleStandType = ruleStandType; + } + + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStepListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStepListDbQuery.java new file mode 100644 index 0000000..58f2480 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleStepListDbQuery.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import javax.validation.constraints.NotBlank; + +public class ApprovalRuleStepListDbQuery { + + //所属规则ID + private Long ruleId; + + //状态 + private Byte status; + + //类型 + private Byte type; + /** + * 层级名称 + */ + @NotBlank(message = "层级名称不能为空!") + private String stepName; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public String getStepName() { + return stepName; + } + + public void setStepName(String stepName) { + this.stepName = stepName; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitDbQuery.java new file mode 100644 index 0000000..b9ca19f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitDbQuery.java @@ -0,0 +1,58 @@ +package com.gk.hotwork.specialWork.model.query.db; + +public class ApprovalRuleUnitDbQuery { + /** 所属规则ID **/ + private Long ruleId; + + /** 层级ID **/ + private Long stepId; + + /** 单元规则状态 **/ + private Byte status; + + /** 绑定部门ID **/ + private Long bindDepId; + + /** 绑定人员ID **/ + private Long bindUid; + + public Long getRuleId() { + return ruleId; + } + + public void setRuleId(Long ruleId) { + this.ruleId = ruleId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getBindDepId() { + return bindDepId; + } + + public void setBindDepId(Long bindDepId) { + this.bindDepId = bindDepId; + } + + public Long getBindUid() { + return bindUid; + } + + public void setBindUid(Long bindUid) { + this.bindUid = bindUid; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitItemListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitItemListDbQuery.java new file mode 100644 index 0000000..27e271e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/ApprovalRuleUnitItemListDbQuery.java @@ -0,0 +1,8 @@ +package com.gk.hotwork.specialWork.model.query.db; + +/** + * 审批项查询对象 + */ +public class ApprovalRuleUnitItemListDbQuery { + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyApplyingPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyApplyingPageDBQuery.java new file mode 100644 index 0000000..a2050b8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyApplyingPageDBQuery.java @@ -0,0 +1,59 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyApplyingPageDBQuery implements Serializable { + + private static final long serialVersionUID = 1178847236080741640L; + + private LocalDateTime startTime; + + private LocalDateTime endTime; + + private Byte status; + + private Long applyUid; + + private Byte workType; + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyPendingPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyPendingPageDBQuery.java new file mode 100644 index 0000000..702e1ef --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyPendingPageDBQuery.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkApplyPendingPageDBQuery implements Serializable { + + private static final long serialVersionUID = -8282957922049855615L; + + private LocalDateTime startTime; + + private LocalDateTime endTime; + + private String applyUname; + + private Byte status; + + private Long approvalUid; + + private Byte workType; + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public String getApplyUname() { + return applyUname; + } + + public void setApplyUname(String applyUname) { + this.applyUname = applyUname; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyRecordListDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyRecordListDBQuery.java new file mode 100644 index 0000000..55c4d53 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApplyRecordListDBQuery.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class WorkApplyRecordListDBQuery implements Serializable { + + private static final long serialVersionUID = -2083051402758052919L; + + private Long workApplyId; + + private Long stepId; + + private String operatorName; + + private boolean systemEnable; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public boolean isSystemEnable() { + return systemEnable; + } + + public void setSystemEnable(boolean systemEnable) { + this.systemEnable = systemEnable; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalItemListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalItemListDbQuery.java new file mode 100644 index 0000000..e330177 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalItemListDbQuery.java @@ -0,0 +1,78 @@ +package com.gk.hotwork.specialWork.model.query.db; + +/** + * 审批填报项 + */ +public class WorkApprovalItemListDbQuery { + + + + //所属作业ID + private Long workId; + + //所属审批层级ID + private Long stepId; + + //所属审批单元ID + private Long unitId; + + //填报类型 数值、选项、填空... + private Byte type; + + //填报项状态 + private Byte status; + + //适用标准ID + private Byte standId; + + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getUnitId() { + return unitId; + } + + public void setUnitId(Long unitId) { + this.unitId = unitId; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getStandId() { + return standId; + } + + public void setStandId(Byte standId) { + this.standId = standId; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalStepListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalStepListDbQuery.java new file mode 100644 index 0000000..8040078 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalStepListDbQuery.java @@ -0,0 +1,89 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.time.LocalDateTime; + +/** + * 作业审批层级 + */ +public class WorkApprovalStepListDbQuery { + + //所属作业ID + private Long workId; + + //状态 + private Byte status; + + //审批层级类型,单人,多人,分析人.... + private Byte type; + + //审批结果 + private Byte approvalResult; + + //审批层级序号 + private Integer stepSerial; + + + //开始审批时间 + private LocalDateTime startApprovalTime; + + //结束审批时间 + private LocalDateTime finishApprovalTime; + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getApprovalResult() { + return approvalResult; + } + + public void setApprovalResult(Byte approvalResult) { + this.approvalResult = approvalResult; + } + + public Integer getStepSerial() { + return stepSerial; + } + + public void setStepSerial(Integer stepSerial) { + this.stepSerial = stepSerial; + } + + + public LocalDateTime getStartApprovalTime() { + return startApprovalTime; + } + + public void setStartApprovalTime(LocalDateTime startApprovalTime) { + this.startApprovalTime = startApprovalTime; + } + + + public LocalDateTime getFinishApprovalTime() { + return finishApprovalTime; + } + + public void setFinishApprovalTime(LocalDateTime finishApprovalTime) { + this.finishApprovalTime = finishApprovalTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalUnitListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalUnitListDbQuery.java new file mode 100644 index 0000000..f40cf41 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkApprovalUnitListDbQuery.java @@ -0,0 +1,85 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.time.LocalDateTime; + +public class WorkApprovalUnitListDbQuery { + + + //所属作业ID + private Long workId; + + //所属审批层级ID + private Long stepId; + + //审批人ID + private Long approvalUid; + + //审批类型 + private Byte type; + + //审批结果 + private Byte result; + + //审批开始时间 + private LocalDateTime approvalStartTime; + + //审批截止时间 + private LocalDateTime approvalEndTime; + + public Long getWorkId() { + return workId; + } + + public void setWorkId(Long workId) { + this.workId = workId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Long getApprovalUid() { + return approvalUid; + } + + public void setApprovalUid(Long approvalUid) { + this.approvalUid = approvalUid; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public LocalDateTime getApprovalStartTime() { + return approvalStartTime; + } + + public void setApprovalStartTime(LocalDateTime approvalStartTime) { + this.approvalStartTime = approvalStartTime; + } + + public LocalDateTime getApprovalEndTime() { + return approvalEndTime; + } + + public void setApprovalEndTime(LocalDateTime approvalEndTime) { + this.approvalEndTime = approvalEndTime; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkHotQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkHotQuery.java new file mode 100644 index 0000000..b5fb1f2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkHotQuery.java @@ -0,0 +1,26 @@ +package com.gk.hotwork.specialWork.model.query.db; + +public class WorkHotQuery { + //作业申请id + private Long workApplyId; + + //状态 + private Byte status; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkListDbQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkListDbQuery.java new file mode 100644 index 0000000..77cf74a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkListDbQuery.java @@ -0,0 +1,116 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.time.LocalDateTime; + +public class WorkListDbQuery { + + //所属企业ID + private Long eid; + + //所属部门ID + private Long depId; + + //申请人ID + private Long applyUid; + + //作业状态 + private Byte status; + + //作业类型 + private Byte workType; + + //作业等级 + private Byte workLevel; + + //查询条件 - 申请时间开始 + private LocalDateTime applyTimeStart; + + //查询条件 - 申请时间结束 + private LocalDateTime applyTimeEnd; + + //查询条件 - 预期作业进行时间开始 + private LocalDateTime expTimeStart; + + //查询条件 - 预期作业进行时间结束 + private LocalDateTime expTimeEnd; + + public Long getEid() { + return eid; + } + + public void setEid(Long eid) { + this.eid = eid; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public Long getApplyUid() { + return applyUid; + } + + public void setApplyUid(Long applyUid) { + this.applyUid = applyUid; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getWorkLevel() { + return workLevel; + } + + public void setWorkLevel(Byte workLevel) { + this.workLevel = workLevel; + } + + public LocalDateTime getApplyTimeStart() { + return applyTimeStart; + } + + public void setApplyTimeStart(LocalDateTime applyTimeStart) { + this.applyTimeStart = applyTimeStart; + } + + public LocalDateTime getApplyTimeEnd() { + return applyTimeEnd; + } + + public void setApplyTimeEnd(LocalDateTime applyTimeEnd) { + this.applyTimeEnd = applyTimeEnd; + } + + public LocalDateTime getExpTimeStart() { + return expTimeStart; + } + + public void setExpTimeStart(LocalDateTime expTimeStart) { + this.expTimeStart = expTimeStart; + } + + public LocalDateTime getExpTimeEnd() { + return expTimeEnd; + } + + public void setExpTimeEnd(LocalDateTime expTimeEnd) { + this.expTimeEnd = expTimeEnd; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessDetectionPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessDetectionPageDBQuery.java new file mode 100644 index 0000000..5da51a0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessDetectionPageDBQuery.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class WorkProcessDetectionPageDBQuery implements Serializable { + + private static final long serialVersionUID = -1828468030633478965L; + + private Byte workType; + + private String workPermitNo; + + private Byte result; + + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWarningPageDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWarningPageDBQuery.java new file mode 100644 index 0000000..10f50e1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWarningPageDBQuery.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; + +public class WorkProcessWarningPageDBQuery implements Serializable { + + private static final long serialVersionUID = 4408749780849592922L; + + private Byte workType; + + private String workPermitNo; + + private Byte warningType; + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWarningType() { + return warningType; + } + + public void setWarningType(Byte warningType) { + this.warningType = warningType; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWorkApplyDBQuery.java b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWorkApplyDBQuery.java new file mode 100644 index 0000000..e1ebb0f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/query/db/WorkProcessWorkApplyDBQuery.java @@ -0,0 +1,50 @@ +package com.gk.hotwork.specialWork.model.query.db; + +import java.io.Serializable; +import java.time.LocalDateTime; + +public class WorkProcessWorkApplyDBQuery implements Serializable { + + private static final long serialVersionUID = -6232196058601124388L; + + private String workPermitNo; + + private Byte workType; + + private LocalDateTime now; + + private Byte status; + + + public String getWorkPermitNo() { + return workPermitNo; + } + + public void setWorkPermitNo(String workPermitNo) { + this.workPermitNo = workPermitNo; + } + + public Byte getWorkType() { + return workType; + } + + public void setWorkType(Byte workType) { + this.workType = workType; + } + + public LocalDateTime getNow() { + return now; + } + + public void setNow(LocalDateTime now) { + this.now = now; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/model/update/EntityStatusBatchUO.java b/src/main/java/com/gk/hotwork/specialWork/model/update/EntityStatusBatchUO.java new file mode 100644 index 0000000..798585e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/model/update/EntityStatusBatchUO.java @@ -0,0 +1,60 @@ +package com.gk.hotwork.specialWork.model.update; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +public class EntityStatusBatchUO implements Serializable { + + private static final long serialVersionUID = 7451613006425893369L; + + private List<Long> ids; + + private Long modifiedUid; + + private String modifiedUname; + + private LocalDateTime gmtModified; + + private Byte status; + + public List<Long> getIds() { + return ids; + } + + public void setIds(List<Long> ids) { + this.ids = ids; + } + + public Long getModifiedUid() { + return modifiedUid; + } + + public void setModifiedUid(Long modifiedUid) { + this.modifiedUid = modifiedUid; + } + + public String getModifiedUname() { + return modifiedUname; + } + + public void setModifiedUname(String modifiedUname) { + this.modifiedUname = modifiedUname; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApplySpecialWorkConsumer.java b/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApplySpecialWorkConsumer.java new file mode 100644 index 0000000..b7a9383 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApplySpecialWorkConsumer.java @@ -0,0 +1,97 @@ +package com.gk.hotwork.specialWork.mq.consumer; + +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalStepResultEnum; +import com.gk.hotwork.specialWork.enums.WorkApprovalUnitResultEnum; +import com.gk.hotwork.specialWork.enums.WorkStatusEnum; +import com.gk.hotwork.specialWork.mq.msg.ApplySpecialWorkMsg; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalStepInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalUnitInfoService; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.applySpecialWorkTopic}",consumerGroup = "${rocketmq.consumers.applySpecialWorkGroup}") +public class ApplySpecialWorkConsumer implements RocketMQListener<MessageExt> { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.applySpecialWorkTopic}") + private String applySpecialWorkTopic; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + @Autowired + private WorkApplyInfoService workApplyInfoService; + + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + + @Override + @Transactional + public void onMessage(MessageExt message) { + ApplySpecialWorkMsg msg = JsonUtils.parse(new String(message.getBody(), StandardCharsets.UTF_8),ApplySpecialWorkMsg.class); + if(null != msg && msg.getWorkApplyId()>0){ + //当前时间早于目标处理时间前0秒 + Long relaySeconds = (msg.getExpStartTime().getTime() - new Date().getTime())/1000; + if(relaySeconds>0){ + //重发消息,实现连续延时 + Message reMsg = MessageBuilder.withPayload(msg).build(); + logger.info("【##】创建作业申请的消息延时"); + SendResult sendResult = rocketMQTemplate.syncSend(applySpecialWorkTopic, reMsg, 10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("【特殊作业】重发作业申请消息失败" + msg.getWorkApplyId()); + } + }else{//超时 + WorkApplyInfo applyInfo = workApplyInfoService.getById(msg.getWorkApplyId()); + //审批中作业 + if(applyInfo.getStatus().equals(WorkStatusEnum.STATU_IN_APPROVAL.getStatus()) && applyInfo.getApprovalStepId() != null) { + List<WorkApprovalUnitInfo> unitList = workApprovalUnitInfoService.listApprovalRuleUnitByStepId(applyInfo.getApprovalStepId()); + List<Long> unitIds = new ArrayList<>(); + for (WorkApprovalUnitInfo unit: unitList) { + if(unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult())){//审批中的单元 + unitIds.add(unit.getId()); + } + } + + //作业超时 + workApplyInfoService.updateStatusById(applyInfo.getId(),WorkStatusEnum.STATU_OVER_TIME); + + //层级超时 + workApprovalStepInfoService.updateStatusById(applyInfo.getApprovalStepId(),WorkApprovalStepResultEnum.RESULT_OVER_TIME); + + //单元 + workApprovalUnitInfoService.updateStatusByIds(unitIds,WorkApprovalUnitResultEnum.RESULT_OVER_TIME); + + logger.info("workApplyId:"+msg.getWorkApplyId()+" 作业超时!"); + } + } + + } + + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApprovalSpecialWorkConsumer.java b/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApprovalSpecialWorkConsumer.java new file mode 100644 index 0000000..3f0974b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/mq/consumer/ApprovalSpecialWorkConsumer.java @@ -0,0 +1,95 @@ +package com.gk.hotwork.specialWork.mq.consumer; + +import com.gk.hotwork.doublePrevention.utils.CalcuteDelayLevelUtils; +import com.gk.hotwork.doublePrevention.utils.JsonUtils; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalStepResultEnum; +import com.gk.hotwork.specialWork.enums.WorkApprovalUnitResultEnum; +import com.gk.hotwork.specialWork.enums.WorkStatusEnum; +import com.gk.hotwork.specialWork.mq.msg.ApprovalSpecialWorkMsg; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalStepInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalUnitInfoService; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.MessageBuilder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +@RocketMQMessageListener(topic = "${rocketmq.topic.approvalSpecialWorkTopic}",consumerGroup = "${rocketmq.consumers.approvalSpecialWorkGroup}") +public class ApprovalSpecialWorkConsumer implements RocketMQListener<MessageExt> { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.approvalSpecialWorkTopic}") + private String approvalSpecialWorkTopic; + @Autowired + private WorkApplyInfoService workApplyInfoService; + @Autowired + private RocketMQTemplate rocketMQTemplate; + + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + + @Override + @Transactional + public void onMessage(MessageExt message) { + ApprovalSpecialWorkMsg msg = JsonUtils.parse(new String(message.getBody(), StandardCharsets.UTF_8), ApprovalSpecialWorkMsg.class); + if(null != msg && msg.getWorkApplyId()>0){ + //当前时间早于目标处理时间前0秒 + Long relaySeconds = (msg.getApprovalEffectiveTime().getTime() - new Date().getTime())/1000; + if(relaySeconds>0){ + //重发消息,实现连续延时 + Message reMsg = MessageBuilder.withPayload(msg).build(); + logger.info("【##】创建分析人审批的消息延时"); + SendResult sendResult = rocketMQTemplate.syncSend(approvalSpecialWorkTopic, reMsg, 10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds)); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + throw new RuntimeException("【特殊作业】重新发送分析人审批消息失败" + msg.getWorkApplyId()); + } + }else{//分析人审批有效时长过期 + WorkApplyInfo applyInfo = workApplyInfoService.getById(msg.getWorkApplyId()); + //审批中作业 + if(applyInfo.getStatus().equals(WorkStatusEnum.STATU_IN_APPROVAL.getStatus()) && applyInfo.getApprovalStepId() != null) { + List<WorkApprovalUnitInfo> unitList = workApprovalUnitInfoService.listApprovalRuleUnitByStepId(applyInfo.getApprovalStepId()); + List<Long> unitIds = new ArrayList<>(); + for (WorkApprovalUnitInfo unit: unitList) { + if(unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult())){//审批中的单元 + unitIds.add(unit.getId()); + } + } + + //作业 + workApplyInfoService.updateStatusById(applyInfo.getId(),WorkStatusEnum.STATU_EXPIRATION_DATE); + + //层级 + workApprovalStepInfoService.updateStatusById(applyInfo.getApprovalStepId(),WorkApprovalStepResultEnum.RESULT_EXPIRATION_DATE); + + //单元 + workApprovalUnitInfoService.updateStatusByIds(unitIds,WorkApprovalUnitResultEnum.RESULT_EXPIRATION_DATE); + + logger.info("workApplyId:"+msg.getWorkApplyId()+" 分析人审批有效时长过期"); + } + } + + } + + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApplySpecialWorkMsg.java b/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApplySpecialWorkMsg.java new file mode 100644 index 0000000..8c47528 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApplySpecialWorkMsg.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.specialWork.mq.msg; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 创建特殊作业 + */ + +public class ApplySpecialWorkMsg { + /** + * 作业id + */ + private Long workApplyId; + + /** + * 作业开始时间 + */ + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date expStartTime; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Date getExpStartTime() { + return expStartTime; + } + + public void setExpStartTime(Date expStartTime) { + this.expStartTime = expStartTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApprovalSpecialWorkMsg.java b/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApprovalSpecialWorkMsg.java new file mode 100644 index 0000000..7d9e502 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/mq/msg/ApprovalSpecialWorkMsg.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.mq.msg; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public class ApprovalSpecialWorkMsg { + + //作业申请id + private Long workApplyId; + + //审批层级id + private Long stepId; + + //审批有效时间 + @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") + private Date approvalEffectiveTime; + + public Long getWorkApplyId() { + return workApplyId; + } + + public void setWorkApplyId(Long workApplyId) { + this.workApplyId = workApplyId; + } + + public Long getStepId() { + return stepId; + } + + public void setStepId(Long stepId) { + this.stepId = stepId; + } + + public Date getApprovalEffectiveTime() { + return approvalEffectiveTime; + } + + public void setApprovalEffectiveTime(Date approvalEffectiveTime) { + this.approvalEffectiveTime = approvalEffectiveTime; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemMeasureRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemMeasureRepository.java new file mode 100644 index 0000000..976bdef --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemMeasureRepository.java @@ -0,0 +1,37 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasure; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasureDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Set; + +@Repository +public interface ApprovalRuleItemMeasureRepository extends BaseMapper<ApprovalRuleItemMeasure> { + /** + * 列表 + */ + List<ApprovalRuleItemMeasure> listByConditions(Page<ApprovalRuleItemMeasure> page, @Param("query") ApprovalRuleItemMeasureQuery query); + /** + * 分页 + */ + List<ApprovalRuleItemMeasure> listByConditions(@Param("query") ApprovalRuleItemMeasureQuery query); + + /** + * 删除 -批量 + */ + int updateStatusByIds(@Param("ids") List<Long> ids, @Param("status") Byte status); + /** + * 删除 -单条 + */ + int updateStatusById(@Param("id") Long id, @Param("status") Byte status); + + List<Long> listMeasureId(Byte status); + + List<ApprovalRuleItemMeasureDO> listItemMeasureByIds(Set<Long> measureIds); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemStandRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemStandRepository.java new file mode 100644 index 0000000..8c2ce92 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleItemStandRepository.java @@ -0,0 +1,31 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStand; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandListDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Set; + +@Repository +public interface ApprovalRuleItemStandRepository extends BaseMapper<ApprovalRuleItemStand> { + + + ApprovalRuleItemStandDO getRuleStandDOById(@Param("ruleStandId") Long ruleStandId, @Param("status") Byte status); + + List<ApprovalRuleItemStandDO> listRuleStandDO(@Param("query") ApprovalRuleStandListDBQuery dbQuery); + + List<ApprovalRuleItemStand> listRuleStandByPage(Page<ApprovalRuleItemStand> page, @Param("query") ApprovalRuleStandPageDBQuery dbQuery); + + int updateStatusBatch(EntityStatusBatchUO batchDeleteObj); + + List<Long> listStandId(Byte status); + + List<ApprovalRuleItemStandDO> listItemStandByIds(Set<Long> standIds); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleRepository.java new file mode 100644 index 0000000..4a9afaf --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleRepository.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.ApprovalRule; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ApprovalRuleRepository extends BaseMapper<ApprovalRule> { + + List<ApprovalRule> listByConditions(@Param("query") ApprovalRuleListDbQuery query); + + List<ApprovalRule> listByConditions(Page<ApprovalRule> page, @Param("query") ApprovalRuleListDbQuery query); + + /** + * 批量删除 + * @param ruleIds + * @return + */ + int updateStutsByRuleIds(@Param("ruleIds") List<Long> ruleIds, @Param("status") Byte status); + + /** + * 单条删除 + * @param ruleId + * @param status + * @return + */ + int updateStutsByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + int insertRuleInfo(ApprovalRule rule); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleStepRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleStepRepository.java new file mode 100644 index 0000000..65b5761 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleStepRepository.java @@ -0,0 +1,69 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.ApprovalRuleStep; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStepListDbQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ApprovalRuleStepRepository extends BaseMapper<ApprovalRuleStep> { + + List<ApprovalRuleStep> listByConditions(ApprovalRuleStepListDbQuery query); + + /** + * 批量 - 根据主键 + * @param stepIds + * @return + */ + int updateStatusByStepIds(@Param("stepIds") List<Long> stepIds, @Param("status") Byte status); + + /** + * 单条件 - 主键 + * @param stepId + * @return + */ + int updateStatusByStepId(@Param("stepId") Long stepId, @Param("status") Byte status); + + /** + * 根据规则删除 + * @param ruleIds + * @return + */ + int updateStatusByRuleIds(@Param("ruleIds") List<Long> ruleIds, @Param("status") Byte status); + + /** + * 根据规则删除 + * @param ruleId + * @return + */ + int updateStatusByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + /** + * 根据规则id获取 层级id集合 + * @param ruleId + * @param status + * @return + */ + List<Long> listStepIdByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + /** + * 根据规则id获取集合 + * @param ruleId + * @param status + * @return + */ + List<ApprovalRuleStep> listByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + /** + * 更新一条数据(将pre_step_id置空) + */ + int updateStepAndEmptyPreStepId(ApprovalRuleStep step); + + + int saveStepList(@Param("list") List<ApprovalRuleStep> saveStepList); + + int updateBatchStep(@Param("list") List<ApprovalRuleStep> updateStepList); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitItemRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitItemRepository.java new file mode 100644 index 0000000..9a6f815 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitItemRepository.java @@ -0,0 +1,122 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItemDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ApprovalRuleUnitItemRepository extends BaseMapper<ApprovalRuleUnitItem> { + + + /** + * 根据层级id获取审批项 + * @param ruleStepId + * @return + */ + List<ApprovalRuleUnitItem> listActiveByRuleStepId(@Param("ruleStepId") Long ruleStepId, @Param("status") Byte status); + + /** + * 根据规则id获取单元 + * @param ruleId + * @return + */ + List<ApprovalRuleUnitItem> listActiveByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + /** + * 根据标准id获取数据 + * @param standIdList + * @return + */ + List<ApprovalRuleUnitItem> listActiveByRuleStandId(@Param("standIdList") List<Long> standIdList, @Param("status") Byte status); + + /** + * 批量插入填报项 + * @param itemList + * @return + */ + int batchInsert(List<ApprovalRuleUnitItem> itemList); + + /** + * 根据主键删除 单条 + */ + int updateStatusById(@Param("id") Long id, @Param("status") Byte status); + + /** + * 根据主键 批量删除 + * @param ids + * @return + */ + int updateStatusByIds(@Param("ids") List<Long> ids, @Param("status") Byte status); + + /** + * 根据多个规则id删除 + * @param ruleIds + * @return + */ + int updateStatusByRuleIds(@Param("ruleIds") List<Long> ruleIds, @Param("status") Byte status); + + /** + * 根据单个规则id删除 + */ + int updateStatusByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + /** + * 根据单个层级id删除 + * @param stepId + * @return + */ + int updateStatusByStepId(@Param("stepId") Long stepId, @Param("status") Byte status); + + /** + * 根据多个层级id删除 + * @param stepIds + * @return + */ + int updateStatusByStepIds(@Param("stepIds") List<Long> stepIds, @Param("status") Byte status); + + /** + * 根据单个单元id 删除 + */ + int updateStatusByUnitId(@Param("unitId") Long unitId, @Param("status") Byte status); + + /** + * 根据多个单元id 删除 + * @param unitIds + * @return + */ + int updateStatusByUnitIds(@Param("unitIds") List<Long> unitIds, @Param("status") Byte status); + + + + + /** + * @Description: 插入审批项 + */ + int insertRuleItem(ApprovalRuleUnitItem itemEntity); + + + /** + * @Description: 更新审批项 + */ + int updateRuleItem(ApprovalRuleUnitItem itemEntity); + + ApprovalRuleUnitItemDO getApprovalRuleUnitItemDOById(Long ruleItemId); + + List<ApprovalRuleUnitItem> listRuleItemByPage(Page<ApprovalRuleUnitItem> page, @Param("query") ApprovalRuleItemPageDBQuery dbQuery); + + List<ApprovalRuleUnitItemDO> listRuleItemDO(ApprovalRuleItemDBQuery dbQuery); + + int updateStatusBatch(EntityStatusBatchUO entityBatchDeleteObject); + + int countByMeasureIds(@Param("measureIds") List<Long> measureIds, @Param("status") Byte status); + + int updateItemBatch(List<ApprovalRuleUnitItem> itemList); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitRepository.java new file mode 100644 index 0000000..bcd21c0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/ApprovalRuleUnitRepository.java @@ -0,0 +1,49 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnit; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleUnitDbQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ApprovalRuleUnitRepository extends BaseMapper<ApprovalRuleUnit> { + + List<ApprovalRuleUnit> listActiveByRuleStepId(@Param("stepId") Long stepId, @Param("status") Byte status); + + List<ApprovalRuleUnit> listActiveByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + int updateStatusByRuleStepId(@Param("stepId") Long stepId, @Param("status") Byte status); + + int updateStatusByRuleId(@Param("ruleId") Long ruleId, @Param("status") Byte status); + + int batchInsert(@Param("unitList") List<ApprovalRuleUnit> unitList); + + /** + * 根据ruleIds批量删除单元 + */ + int updateStatusByRuleIds(@Param("ruleIds") List<Long> ruleIds, @Param("status") Byte status); + /** + * 根据stepIds批量删除单元 + */ + int updateStatusByStepIds(@Param("stepIds") List<Long> stepIds, @Param("status") Byte status); + + List<Long> listUnitIdByStepId(@Param("stepId") Long stepId, @Param("status") Byte status); + + /** + * 根据单元unitIds 批量删除 + * @param unitIds + * @param status + * @return + */ + int updateStatusByUnitIds(@Param("unitIds") List<Long> unitIds, @Param("status") Byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<ApprovalRuleUnit> listByConditions(ApprovalRuleUnitDbQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyInfoRepository.java new file mode 100644 index 0000000..7ce8d8a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyInfoRepository.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.WorkApplyCountDO; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApplyReportableDO; +import com.gk.hotwork.specialWork.model.bo.WorkApplyPendingInfoBO; +import com.gk.hotwork.specialWork.model.query.db.AllWorkApplyPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyApplyingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyPendingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWorkApplyDBQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApplyInfoRepository extends BaseMapper<WorkApplyInfo> { + + int insertWorkApplyInfo(WorkApplyInfo applyEntity); + + int updateStatusById(Long workApplyId, Byte status); + + List<WorkApplyInfo> listWorkApplyInfoByPage(Page<WorkApplyInfo> page, @Param("query") WorkApplyApplyingPageDBQuery dbQuery); + + List<WorkApplyPendingInfoBO> listPendingWorkApplyInfo(Page<WorkApplyPendingInfoBO> page, @Param("query") WorkApplyPendingPageDBQuery dbQuery); + + WorkApplyInfo getWorkApprovalByApprovalUid(@Param("workApplyId") Long workApplyId, @Param("approvalUid") Long approvalUid); + + int countWorkApplyInfo(); + + int updateApprovalStepIdById(@Param("workApplyId") Long workApplyId, @Param("nextStepId") Long nextStepId); + + List<WorkApplyInfo> listAllWorkApplyByPage(Page<WorkApplyInfo> page, @Param("query") AllWorkApplyPageDBQuery dbQuery); + + List<WorkApplyCountDO> getWorkApplyCountByDep(); + + List<WorkApplyReportableDO> listReportableWorkApply(@Param("query") WorkProcessWorkApplyDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyOperatorInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyOperatorInfoRepository.java new file mode 100644 index 0000000..6c9c443 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyOperatorInfoRepository.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApplyOperatorInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public +interface WorkApplyOperatorInfoRepository extends BaseMapper<WorkApplyOperatorInfo> { + + int insertBatchOperator(@Param("list") List<WorkApplyOperatorInfo> operatorEntities); + + List<WorkApplyOperatorInfo> listWorkOperatorByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyRecordInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyRecordInfoRepository.java new file mode 100644 index 0000000..efc0f6f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApplyRecordInfoRepository.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApplyRecordInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface WorkApplyRecordInfoRepository extends BaseMapper<WorkApplyRecordInfo> { +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalFilledItemInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalFilledItemInfoRepository.java new file mode 100644 index 0000000..ef1e886 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalFilledItemInfoRepository.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalFilledItemInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApprovalFilledItemInfoRepository extends BaseMapper<WorkApprovalFilledItemInfo> { + + List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByWorkApplyId(Long workApplyId); + + List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByUnitId(Long unitId); + + int insertBatchFilledItemInfo(@Param("list") List<WorkApprovalFilledItemInfo> filledItemInfos); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemInfoRepository.java new file mode 100644 index 0000000..df5e78c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemInfoRepository.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApprovalItemInfoRepository extends BaseMapper<WorkApprovalItemInfo> { + + + int insertBatch(@Param("list") List<WorkApprovalItemInfo> workApprovalItemInfos); + + List<WorkApprovalItemInfo> listWorkApprovalItemByWorkApplyId(Long workApplyId); + + List<WorkApprovalItemInfo> listWorkApprovalItemInfoByStepId(Long stepId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemMeasureInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemMeasureInfoRepository.java new file mode 100644 index 0000000..da70264 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemMeasureInfoRepository.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemMeasureInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApprovalItemMeasureInfoRepository extends BaseMapper<WorkApprovalItemMeasureInfo> { + + int insertBatch(@Param("list") List<WorkApprovalItemMeasureInfo> measureEntities); + + List<WorkApprovalItemMeasureInfo> listWorkApprovalItemMeasureByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemStandInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemStandInfoRepository.java new file mode 100644 index 0000000..c32d346 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalItemStandInfoRepository.java @@ -0,0 +1,17 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApprovalItemStandInfoRepository extends BaseMapper<WorkApprovalItemStandInfo> { + + int insertBatch(@Param("list") List<WorkApprovalItemStandInfo> standEntities); + + List<WorkApprovalItemStandInfo> listWorkApprovalItemStandByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalRuleInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalRuleInfoRepository.java new file mode 100644 index 0000000..121e658 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalRuleInfoRepository.java @@ -0,0 +1,9 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalRuleInfo; +import org.springframework.stereotype.Repository; + +@Repository +public interface WorkApprovalRuleInfoRepository extends BaseMapper<WorkApprovalRuleInfo> { +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalStepInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalStepInfoRepository.java new file mode 100644 index 0000000..196a2f3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalStepInfoRepository.java @@ -0,0 +1,23 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +@Repository +public interface WorkApprovalStepInfoRepository extends BaseMapper<WorkApprovalStepInfo> { + + int insertBatch(@Param("list") List<WorkApprovalStepInfo> ruleStepEntities); + + List<WorkApprovalStepInfo> listApprovalRuleStepByWorkApplyId(Long workApplyId); + + int updateStatusById(Long stepId, Byte result); + + int updateFinishApprovalTimeById(Long stepId, LocalDateTime finishTime); + + int updateStartApprovalTimeById(Long stepId, LocalDateTime startTime); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalUnitInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalUnitInfoRepository.java new file mode 100644 index 0000000..7498756 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkApprovalUnitInfoRepository.java @@ -0,0 +1,33 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkApprovalUnitInfoRepository extends BaseMapper<WorkApprovalUnitInfo> { + + int insertBatch(@Param("list") List<WorkApprovalUnitInfo> workApprovalUnitInfos); + + List<WorkApprovalUnitInfo> listApprovalRuleUnitByWorkApplyId(Long workApplyId); + + List<WorkApprovalUnitInfo> listWorkApprovalUnitByStepIdAndUid(Long stepId, Long approvalUid); + + int updateStatusById(Long unitId, Byte result); + + List<WorkApprovalUnitInfo> listApprovalRuleUnitByStepId(Long stepId); + + /** + * @Description: 这个操作不会更改审批时间 + */ + void updateStatusByStepId(Long stepId, Byte result); + + int updateStatusByIds(@Param("list") List<Long> unitIds, Byte result); + + int updateStatusAndFillContentById(Long unitId, String unitFillContent, Byte result); + + int batchUpdateStatusByIds(@Param("list") List<Long> unitIds, Byte result); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkAtHeightInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkAtHeightInfoRepository.java new file mode 100644 index 0000000..68e1b15 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkAtHeightInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkAtHeightInfo; +import com.gk.hotwork.specialWork.model.query.WorkAtHeightQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkAtHeightInfoRepository extends BaseMapper<WorkAtHeightInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkAtHeightInfo> listByConditions(@Param("query") WorkAtHeightQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkBlindPlatePluggingInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkBlindPlatePluggingInfoRepository.java new file mode 100644 index 0000000..e5d1079 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkBlindPlatePluggingInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkBlindPlatePluggingInfo; +import com.gk.hotwork.specialWork.model.query.WorkBlindPlatePluggingQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkBlindPlatePluggingInfoRepository extends BaseMapper<WorkBlindPlatePluggingInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkBlindPlatePluggingInfo> listByConditions(@Param("query") WorkBlindPlatePluggingQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkBrokenCircuitInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkBrokenCircuitInfoRepository.java new file mode 100644 index 0000000..b0ddafe --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkBrokenCircuitInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkBrokenCircuitInfo; +import com.gk.hotwork.specialWork.model.query.WorkBrokenCircuitQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkBrokenCircuitInfoRepository extends BaseMapper<WorkBrokenCircuitInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkBrokenCircuitInfo> listByConditions(@Param("query") WorkBrokenCircuitQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkConfinedSpaceInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkConfinedSpaceInfoRepository.java new file mode 100644 index 0000000..ba32831 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkConfinedSpaceInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkConfinedSpaceInfo; +import com.gk.hotwork.specialWork.model.query.WorkConfinedSpaceQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkConfinedSpaceInfoRepository extends BaseMapper<WorkConfinedSpaceInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkConfinedSpaceInfo> listByConditions(@Param("query") WorkConfinedSpaceQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkGroundBreakingInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkGroundBreakingInfoRepository.java new file mode 100644 index 0000000..9793e16 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkGroundBreakingInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkGroundBreakingInfo; +import com.gk.hotwork.specialWork.model.query.WorkGroundBreakingQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkGroundBreakingInfoRepository extends BaseMapper<WorkGroundBreakingInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkGroundBreakingInfo> listByConditions(@Param("query") WorkGroundBreakingQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkHoistingInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkHoistingInfoRepository.java new file mode 100644 index 0000000..786ab34 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkHoistingInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkHoistingInfo; +import com.gk.hotwork.specialWork.model.query.WorkHoistingQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkHoistingInfoRepository extends BaseMapper<WorkHoistingInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkHoistingInfo> listByConditions(@Param("query") WorkHoistingQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkHotInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkHotInfoRepository.java new file mode 100644 index 0000000..c9d7c14 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkHotInfoRepository.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkHotInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkHotQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkHotInfoRepository extends BaseMapper<WorkHotInfo> { + /** + * 删除-单条件 + * @param id + * @param + * @return + */ + int updateOneStatus(@Param("id") Long id, @Param("status") byte status); + + /** + * 批量删除 + * @param ids + * @param status + * @return + */ + int batchUpdateStatus(@Param("ids") List<Long> ids, @Param("status") byte status); + + /** + * + * @param query + * @return + */ + List<WorkHotInfo> listByConditions(WorkHotQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessDetectionInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessDetectionInfoRepository.java new file mode 100644 index 0000000..eb3c9ad --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessDetectionInfoRepository.java @@ -0,0 +1,19 @@ +package com.gk.hotwork.specialWork.repository; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessDetectionPageDBQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkProcessDetectionInfoRepository extends BaseMapper<WorkProcessDetectionInfo> { + + int insertWorkProcessDetectionInfo(WorkProcessDetectionInfo detectionEntity); + + List<WorkProcessDetectionInfo> listWorkDetectionInfoByPage(Page<WorkProcessDetectionInfo> page, @Param("query") WorkProcessDetectionPageDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessWarningInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessWarningInfoRepository.java new file mode 100644 index 0000000..1fbf31b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkProcessWarningInfoRepository.java @@ -0,0 +1,18 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWarningPageDBQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkProcessWarningInfoRepository extends BaseMapper<WorkProcessWarningInfo> { + + List<WorkProcessWarningInfo> listWorkProcessWarningInfoByPage(Page<WorkProcessWarningInfo> page, @Param("query") WorkProcessWarningPageDBQuery dbQuery); + + int insertWorkProcessWarningInfo(WorkProcessWarningInfo warningInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/repository/WorkTemporaryPowerInfoRepository.java b/src/main/java/com/gk/hotwork/specialWork/repository/WorkTemporaryPowerInfoRepository.java new file mode 100644 index 0000000..67e79b2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/repository/WorkTemporaryPowerInfoRepository.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.gk.hotwork.specialWork.entity.WorkTemporaryPowerInfo; +import com.gk.hotwork.specialWork.model.query.WorkTemporaryPowerQuery; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface WorkTemporaryPowerInfoRepository extends BaseMapper<WorkTemporaryPowerInfo> { + + /** + * 批量删除 + * @param idList + * @param status + * @return + */ + int updateStatutsByIds(@Param("idList") List<Long> idList, @Param("status") byte status); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkTemporaryPowerInfo> listByConditions(@Param("query") WorkTemporaryPowerQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/schedule/KeepAliveRobot.java b/src/main/java/com/gk/hotwork/specialWork/schedule/KeepAliveRobot.java new file mode 100644 index 0000000..241a03e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/schedule/KeepAliveRobot.java @@ -0,0 +1,27 @@ +package com.gk.hotwork.specialWork.schedule; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component("specialWorkKeepAlive") +@EnableScheduling +@ConditionalOnProperty(prefix = "threadPool.scheduling", name = "enabled", havingValue = "true") +public class KeepAliveRobot { + + @Autowired + private ApprovalRuleService approvalRuleService; + + // 30m + @Scheduled(cron = "0 0/30 * * * ?") + public void keepAlive(){ + // 查询一个 + approvalRuleService.getOne(new QueryWrapper<>()); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/ApprovalConfigService.java b/src/main/java/com/gk/hotwork/specialWork/service/ApprovalConfigService.java new file mode 100644 index 0000000..fa791a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/ApprovalConfigService.java @@ -0,0 +1,4 @@ +package com.gk.hotwork.specialWork.service; + +public interface ApprovalConfigService { +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/ApprovalWorkRocketMQService.java b/src/main/java/com/gk/hotwork/specialWork/service/ApprovalWorkRocketMQService.java new file mode 100644 index 0000000..8ddec85 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/ApprovalWorkRocketMQService.java @@ -0,0 +1,5 @@ +package com.gk.hotwork.specialWork.service; + +public interface ApprovalWorkRocketMQService { + public <T> void syncSend(T message); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/RuleItemService.java b/src/main/java/com/gk/hotwork/specialWork/service/RuleItemService.java new file mode 100644 index 0000000..55f56c8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/RuleItemService.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemListRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemPageRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemPageQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemQuery; + +import java.util.List; + +public interface RuleItemService { + + /** + * @Description: 新增审批项 + */ + void saveRuleItem(ContextCacheUser currentUser, ApprovalRuleItemAddReqDTO addReqDTO); + + /** + * @Description: 修改审批项 + */ + void updateRuleItem(ContextCacheUser currentUser, ApprovalRuleItemModReqDTO modReqDTO); + + /** + * @Description: 删除审批项 + */ + void deleteRuleItem(ContextCacheUser currentUser, DeleteForm deleteForm); + + /** + * @Description: 分页查询 + */ + SearchResultVO<List<ApprovalRuleUnitItemPageRespDTO>> listRuleItemByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleItemPageQuery> pageQuery); + + /** + * @Description: 根据 query 对象查找 list + */ + List<ApprovalRuleUnitItemListRespDTO> listRuleItem(ContextCacheUser currentUser, ApprovalRuleItemQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/RuleMeasureService.java b/src/main/java/com/gk/hotwork/specialWork/service/RuleMeasureService.java new file mode 100644 index 0000000..6122a64 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/RuleMeasureService.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasurePageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasureRespDTO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; + +import java.util.List; + +public interface RuleMeasureService { + /** + * 新增 + */ + ResultVO saveMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureAddReqDTO addReqDTO); + + + /** + * 修改 + */ + ResultVO modMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureModReqDTO modReqDTO); + + /** + * 删除 + */ + ResultVO deleteByIds(ContextCacheUser currentUser, DeleteForm deleteForm); + + + /** + * 列表 + */ + ResultVO<List<ApprovalRuleMeasureRespDTO>> listMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureQuery query); + + /** + * 分页 + */ + SearchResultVO<List<ApprovalRuleMeasurePageRespDTO>> listMeasureByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleItemMeasureQuery> query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/RuleService.java b/src/main/java/com/gk/hotwork/specialWork/service/RuleService.java new file mode 100644 index 0000000..96eb4b0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/RuleService.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.model.bo.ApprovalRuleBO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleRespDTO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery; + +import java.util.List; + +public interface RuleService { + //新增 + ResultVO save(ContextCacheUser currentUser, ApprovalRuleAddReqDTO ruleAddReqDTO); + + //更新 + ResultVO update(ContextCacheUser currentUser, ApprovalRuleModReqDTO ruleModReqDTO); + + //删除 + ResultVO removeBatchRule(DeleteForm deleteForm); + + //列表-分页 + SearchResultVO<List<ApprovalRuleRespDTO>> listRuleByPage(PageQuery<ApprovalRuleListDbQuery> pageQuery); + + /** + * @Description: 递归查找上级部门的审批规则 直到找到为止 + */ + ApprovalRuleBO recursiveQueryRule(Long depId, Byte workType, Byte workLevel); + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/RuleStandService.java b/src/main/java/com/gk/hotwork/specialWork/service/RuleStandService.java new file mode 100644 index 0000000..8bb617e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/RuleStandService.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleItemStandPageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleStandListRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandListQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandPageQuery; + +import java.util.List; + +public interface RuleStandService { + + /** + * @Description: 获取 审批规则 + */ + void saveRuleStand(ContextCacheUser currentUser, ApprovalRuleStandAddReqDTO addReqDTO); + + + /** + * @Description: 修改 审批规则 + */ + void updateRuleStand(ContextCacheUser currentUser, ApprovalRuleStandModReqDTO modReqDTO); + + /** + * @Description: 根据 query 对象查询 list + */ + List<ApprovalRuleStandListRespDTO> listRuleStand(ContextCacheUser currentUser, ApprovalRuleStandListQuery query); + + /** + * @Description: 分页查询 + */ + SearchResultVO<List<ApprovalRuleItemStandPageRespDTO>> listRuleStandByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleStandPageQuery> query); + + /** + * @Description: 删除 + */ + void deleteRuleStand(ContextCacheUser currentUser, DeleteForm deleteForm); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/SpecialWorkMinoService.java b/src/main/java/com/gk/hotwork/specialWork/service/SpecialWorkMinoService.java new file mode 100644 index 0000000..351babc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/SpecialWorkMinoService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.Domain.Vo.ResultVO; + +public interface SpecialWorkMinoService { + public ResultVO getPresignUrl(String suffixName); + public ResultVO viewFile(String fileName); + public ResultVO deleteFile(String fileName); + + String viewFiles(String fileNames); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRecordService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRecordService.java new file mode 100644 index 0000000..e5ab68d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRecordService.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.specialWork.enums.ProcessOperationEnum; +import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyRecordRespDTO; +import com.gk.hotwork.specialWork.model.query.WorkApplyRecordListQuery; + +import java.util.List; + +public interface WorkApplyRecordService { + + /** + * @Description: 操作人日志 + */ + void log(ContextCacheUser user, ProcessOperationEnum operation, Long workApplyId, Long currentStepId, String currentStepName, String content); + + + /** + * @Description: 系统自动驳回等日志 + */ + void log(ProcessOperationEnum operationEnum, Long workApplyId, Long currentStepId, String currentStepName, String content); + + + /** + * @Description: 查询 + */ + List<WorkApplyRecordRespDTO> list(ContextCacheUser currentUser, WorkApplyRecordListQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRocketMQService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRocketMQService.java new file mode 100644 index 0000000..be6223f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyRocketMQService.java @@ -0,0 +1,6 @@ +package com.gk.hotwork.specialWork.service; + +public interface WorkApplyRocketMQService { + public <T> void syncSend(T message); + + } diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyService.java new file mode 100644 index 0000000..2640739 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkApplyService.java @@ -0,0 +1,84 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalItemAbordDataReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalItemDataReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.WorkApplyEight; +import com.gk.hotwork.specialWork.model.dto.req.WorkApplyReqDTO; +import com.gk.hotwork.specialWork.model.dto.resp.*; +import com.gk.hotwork.specialWork.model.query.AllWorkApplyPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyApplyingPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyPendingPageQuery; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +public interface WorkApplyService { + + /** + * @Description: 作业申请 + */ + + void workApply(ContextCacheUser currentUser, WorkApplyReqDTO<? extends WorkApplyEight> applyReqDTO); + + /** + * @Description: 取消申请 + */ + void cancelWorkApply(ContextCacheUser currentUser, Long workApplyId); + + /** + * @Description: 申请中作业分页 + */ + ResultVO<List<WorkApplyPageRespDTO>> listApplyingWorkApplyByPage(ContextCacheUser currentUser, PageQuery<WorkApplyApplyingPageQuery> pageQuery); + + /** + * @Description: 待审批的作业分页 + */ + ResultVO<List<WorkApplyPendingPageRespDTO>> listPendingWorkApplyByPage(ContextCacheUser currentUser, PageQuery<WorkApplyPendingPageQuery> pageQuery); + + /** + * @Description: 获取已经审批的进度(申请人) + */ + ApplicantWorkApprovedApplyDetailRespDTO getApprovedApplyDetailForApplicant(ContextCacheUser currentUser, Long workApplyId); + + /** + * @Description: 获取已经审批的进度(审批人) + */ + ApproverWorkApprovedApplyDetailRespDTO getApprovedApplyDetailForApprover(ContextCacheUser currentUser, Long workApplyId); + + /** + * @Description: 获取作业当前待审批的内容(审批人) + */ + ApproverWorkPendingApprovalDataRespDTO getPendingApprovalData(ContextCacheUser currentUser, Long workApplyId); + + /** + * @Description: 审批接口 + */ + void approveItem(ContextCacheUser currentUser, ApprovalItemDataReqDTO approvalItemData); + + /** + * @Description: 终止 + */ + void abordItem(ContextCacheUser currentUser, ApprovalItemAbordDataReqDTO abordDataReqDTO); + + /** + * @Description: 所有作业申请查询 + */ + SearchResultVO<List<AllWorkApplyPageRespDTO>> listAllWorkApply(ContextCacheUser currentUser, PageQuery<AllWorkApplyPageQuery> pageQuery); + + + /** + * @Description: 给其他人查看的作业情况 + */ + OthersWorkApprovedApplyDetailRespDTO getWorkApplyDetailForOthers(ContextCacheUser currentUser, Long workApplyId); + + + /** + * 打印 + * @param currentUser + */ + void printing(ContextCacheUser currentUser, Long applyWorkId, HttpServletResponse response); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkAtHeightPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkAtHeightPrintService.java new file mode 100644 index 0000000..11b2860 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkAtHeightPrintService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkAtHeightPrintService { + Map<String,Object> workAtHeightPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkBlindPlatePluggingPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkBlindPlatePluggingPrintService.java new file mode 100644 index 0000000..d907b81 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkBlindPlatePluggingPrintService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkBlindPlatePluggingPrintService { + Map<String,Object> workBlindPlatePluggingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkBrokenCircuitPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkBrokenCircuitPrintService.java new file mode 100644 index 0000000..381a91b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkBrokenCircuitPrintService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkBrokenCircuitPrintService { + Map<String,Object> workBrokenCircuitPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkConfinedSpacePrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkConfinedSpacePrintService.java new file mode 100644 index 0000000..11fe974 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkConfinedSpacePrintService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.specialWork.service; + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkConfinedSpacePrintService { + Map<String,Object> workConfinedSpacePrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkGroundBreakingPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkGroundBreakingPrintService.java new file mode 100644 index 0000000..3a01336 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkGroundBreakingPrintService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkGroundBreakingPrintService { + Map<String,Object> workGroundBreakingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkHoistingPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkHoistingPrintService.java new file mode 100644 index 0000000..bfc8bbd --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkHoistingPrintService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkHoistingPrintService { + Map<String,Object> workHoistingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkHotPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkHotPrintService.java new file mode 100644 index 0000000..6f8b3c9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkHotPrintService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import java.util.Map; + +public interface WorkHotPrintService { + Map<String,Object> workHotPrint(WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkPrintService.java new file mode 100644 index 0000000..18a6203 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkPrintService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; + +public interface WorkPrintService { + void workPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkProcessService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkProcessService.java new file mode 100644 index 0000000..8414fba --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkProcessService.java @@ -0,0 +1,32 @@ +package com.gk.hotwork.specialWork.service; + + + +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.specialWork.model.dto.req.WorkProcessDetectionReqDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyReportableRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkProcessDetectionInfoRespDTO; +import com.gk.hotwork.specialWork.model.query.WorkProcessDetectionPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkProcessWorkApplyQuery; + +import java.util.List; + +public interface WorkProcessService { + + /** + * @Description: 检测上报 + */ + void detectionReport(ContextCacheUser currentUser, WorkProcessDetectionReqDTO reqDTO); + + /** + * @Description: 检测分页 + */ + SearchResultVO<List<WorkProcessDetectionInfoRespDTO>> listDetectionByPage(ContextCacheUser currentUser, PageQuery<WorkProcessDetectionPageQuery> pageQuery); + + /** + * @Description: 查询可上报的作业 + */ + List<WorkApplyReportableRespDTO> listReportableWorkApply(ContextCacheUser currentUser, WorkProcessWorkApplyQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkStatisticService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkStatisticService.java new file mode 100644 index 0000000..cf1ae41 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkStatisticService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkDepStatisticRespDTO; + +import java.util.List; + +public interface WorkStatisticService { + + ResultVO<List<WorkDepStatisticRespDTO>> getWorkApplyCountByDep(); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/WorkTemporaryPowerPrintService.java b/src/main/java/com/gk/hotwork/specialWork/service/WorkTemporaryPowerPrintService.java new file mode 100644 index 0000000..e68c657 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/WorkTemporaryPowerPrintService.java @@ -0,0 +1,11 @@ +package com.gk.hotwork.specialWork.service; + + +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +public interface WorkTemporaryPowerPrintService { + Map<String,Object> workTemporaryPowerPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleItemMeasureService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleItemMeasureService.java new file mode 100644 index 0000000..2952036 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleItemMeasureService.java @@ -0,0 +1,53 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasure; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasureDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; + +import java.util.List; +import java.util.Set; + +public interface ApprovalRuleItemMeasureService extends IService<ApprovalRuleItemMeasure> { + /** + * 新增 + */ + int saveOne(ApprovalRuleItemMeasure measure); + + /** + * 修改 + */ + int updateOne(ApprovalRuleItemMeasure measure); + + /** + * 删除 -批量 + */ + int updateStatusByIds(List<Long> ids); + + /** + * 删除 - 单条 + */ + int updateStatusById(Long id); + + /** + * 列表 + */ + List<ApprovalRuleItemMeasure> list(ApprovalRuleItemMeasureQuery query); + + /** + * 分页 + */ + List<ApprovalRuleItemMeasure> listBypage(Page<ApprovalRuleItemMeasure> page, ApprovalRuleItemMeasureQuery query); + + /** + * 获取安全措施id集合 + * @return + */ + List<Long> listMeasureId(); + + /** + * @Description: 根据 measureIds 获取 措施list + */ + List<ApprovalRuleItemMeasureDO> listItemMeasureByIds(Set<Long> measureIds); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleService.java new file mode 100644 index 0000000..70c161f --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleService.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRule; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery; + +import java.util.List; + +public interface ApprovalRuleService extends IService<ApprovalRule> { + /** + * 新增 + * @param rule + * @return + */ + int saveOneRule(ApprovalRule rule); + /** + * 更新 + * @param approvalRule + * @return + */ + int updateRule(ApprovalRule approvalRule); + + /** + * 批量删除 + * @param ruleIds + * @return + */ + int updateStutsByRuleIds(List<Long> ruleIds); + + /** + * 单挑删除 + * @param ruleId + * @return + */ + int updateStutsByRuleId(Long ruleId); + + List<ApprovalRule> listRule(ApprovalRuleListDbQuery query); + + List<ApprovalRule> listRuleByPage(Page<ApprovalRule> page, ApprovalRuleListDbQuery query); + + /** + * @Description: 根据 depId 获取 审批规则 + */ + ApprovalRule getApprovalRuleInfo(Long depId, Byte workType, Byte workLevel); + + int saveRuleInfo(ApprovalRule rule); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStandService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStandService.java new file mode 100644 index 0000000..d16635e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStandService.java @@ -0,0 +1,35 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStand; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandListDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; + +import java.util.List; +import java.util.Set; + +public interface ApprovalRuleStandService extends IService<ApprovalRuleItemStand> { + + + void saveRuleStand(ApprovalRuleItemStand itemStandEntity); + + ApprovalRuleItemStandDO getRuleStandDOById(Long ruleStandId); + + void updateRuleStand(ApprovalRuleItemStand itemStandEntity); + + List<ApprovalRuleItemStandDO> listRuleStandDO(ApprovalRuleStandListDBQuery dbQuery); + + List<ApprovalRuleItemStand> listRuleStandByPage(Page<ApprovalRuleItemStand> page, ApprovalRuleStandPageDBQuery dbQuery); + + void deleteBatch(EntityStatusBatchUO batchDeleteObj); + + List<Long> listStandId(); + + /** + * @Description: 根据 ids 获取 标准 list + */ + List<ApprovalRuleItemStandDO> listItemStandByIds(Set<Long> standIds); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStepService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStepService.java new file mode 100644 index 0000000..16ca13c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleStepService.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRuleStep; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStepListDbQuery; + +import java.util.List; + +public interface ApprovalRuleStepService extends IService<ApprovalRuleStep> { + /** + * 新增 + * @param step + * @return + */ + int saveOneStep(ApprovalRuleStep step); + + /** + * 更新 + */ + int updateOneStep(ApprovalRuleStep step); + /** + * 根据主键-批量删除 + * @param stepIds + * @return + */ + int updateStatusByStepIds(List<Long> stepIds); + + /** + * 根据主键-单条删除 + * @param stepId + * @return + */ + int updateStatusByStepId(Long stepId); + + + /** + * 删除-根据规则id + * @param ruleId + * @return + */ + int updateStatusByRuleId(Long ruleId); + + /** + * 批量删除-根据规则ids + * @param ruleIds + * @return + */ + int updateStatusByRuleIds(List<Long> ruleIds); + + /** + * 根据规则获取集合 + * @param ruleId + * @return + */ + List<ApprovalRuleStep> listByRuleId(Long ruleId); + + + + /** + * 根据规则id获取层级id + * @param ruleId + * @return + */ + List<Long> listStepIdByRuleId(Long ruleId); + + /** + * 条件查询 + * @param query + * @return + */ + List<ApprovalRuleStep> listStep(ApprovalRuleStepListDbQuery query); + + /** + * 无条件查询 + * @param + * @return + */ + List<ApprovalRuleStep> listStepByNoConditions(); + + /** + * @Description: 根据 ruleId 获取 steps + */ + List<ApprovalRuleStep> listApprovalRuleStepByRuleId(Long ruleId); + + /** + * 更新一条数据,将pre_step_id置空 + * @param step + * @return + */ + int updateStepAndEmptyPreStepId(ApprovalRuleStep step); + + /** + * 批量插入 + * @param saveStepList + */ + int saveStepList(List<ApprovalRuleStep> saveStepList); + + /** + * 批量更新 + * @param updateStepList + */ + int updateBatchStep(List<ApprovalRuleStep> updateStepList); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitItemService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitItemService.java new file mode 100644 index 0000000..fe4d46e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitItemService.java @@ -0,0 +1,96 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItemDO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; + +import java.util.List; + +public interface ApprovalRuleUnitItemService extends IService<ApprovalRuleUnitItem> { + + int saveOneItem(ApprovalRuleUnitItem item); + + int batchSaveItemList(List<ApprovalRuleUnitItem> itemList); + + List<ApprovalRuleUnitItem> listActiveByRuleStepId(Long stepId); + + List<ApprovalRuleUnitItem> listByRuleId(Long ruleId); + + int updateStatusById(Long itemId); + int updateStatusByIds(List<Long> itemIds); + + int updateStatusByRuleId(Long ruleId); + + List<ApprovalRuleUnitItem> listActiveByRuleStandIds(List<Long> standIdList); + + /** + * 根据规则ids-批量删除审批项 + */ + int updateStatusByRuleIds(List<Long> ruleIds); + + int updateStatusByStepId(Long stepId); + /** + * 根据层级删除 stepIds + */ + int updateStatusByStepIds(List<Long> stepIds); + + /** + * @Description: 保存审批项 + */ + void saveRuleItem(ApprovalRuleUnitItem itemEntity); + + /** + * @Description: 更新审批项 + */ + void updateRuleItem(ApprovalRuleUnitItem itemEntity); + + /** + * @Description: 根据 ruleItemId 获取审批项 + */ + ApprovalRuleUnitItemDO getApprovalRuleUnitItemDOById(Long ruleItemId); + + /** + * @Description: 批量删除 + */ + void deleteBatch(EntityStatusBatchUO entityBatchDeleteObject); + + /** + * @Description: 分页查询 + */ + List<ApprovalRuleUnitItem> listRuleItemByPage(Page<ApprovalRuleUnitItem> page, ApprovalRuleItemPageDBQuery dbQuery); + + /** + * @Description: 根据 dbQuery 查询 do 对象 + */ + List<ApprovalRuleUnitItemDO> listRuleItem(ApprovalRuleItemDBQuery dbQuery); + + + /** + * @Description: 根据 ruleStandId 查询审批项个数 + */ + long countByRuleStandId(Long ruleStandId); + + /** + * 根据安全措施ids 查询审批项的个数 + */ + int countByMeasureIds(List<Long> measureIds); + + /** + * @Description: 根据 ruleId 获取 审批项 + */ + List<ApprovalRuleUnitItem> listApprovalRuleUnitItemByRuleId(Long ruleId); + /** + * 批量修改 + */ + int updateBatchItem(List<ApprovalRuleUnitItem> itemList); + + /** + * 无条件查询 + * @return + */ + List<ApprovalRuleUnitItem> listByNoConditions(); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitService.java new file mode 100644 index 0000000..53f9e72 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/ApprovalRuleUnitService.java @@ -0,0 +1,65 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnit; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleUnitDbQuery; + +import java.util.List; + +public interface ApprovalRuleUnitService extends IService<ApprovalRuleUnit> { + + int saveOneUnit(ApprovalRuleUnit unit); + + int updateOneUnit(ApprovalRuleUnit unit); + + int saveUnitList(List<ApprovalRuleUnit> unitList); + + List<ApprovalRuleUnit> listByRuleStepId(Long ruleStepId); + + int updateStatusByRuleStepId(Long ruleStepId); + + int updateStatusByStepIds(List<Long> stepIds); + + int updateStatusByRuleId(Long ruleId); + + /** + * 根据规则id批量删除 + * @param ruleIds + * @return + */ + int updateStatusByRuleIds(List<Long> ruleIds); + + /** + * 根据stepId获取单元主键集合 + * @param stepId + * @return + */ + List<Long> listUnitIdByStepId(Long stepId); + + /** + * 根据单元unitIds 删除 + * @param unitIds + * @return + */ + int updateStatusByUnitIds(List<Long> unitIds); + + /** + * 根据规则id查询单元 + * @param ruleId + * @return + */ + List<ApprovalRuleUnit> listByRuleId(Long ruleId); + + List<ApprovalRuleUnit> listByConditions(ApprovalRuleUnitDbQuery query); + + /** + * @Description: 根据 ruleId 获取 unit + */ + List<ApprovalRuleUnit> listApprovalUnitByRuleId(Long ruleId); + + /** + * 无条件查询 + * @return + */ + List<ApprovalRuleUnit> listByNoConditions(); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyInfoService.java new file mode 100644 index 0000000..f59c82e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyInfoService.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApplyCountDO; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApplyReportableDO; +import com.gk.hotwork.specialWork.enums.WorkStatusEnum; +import com.gk.hotwork.specialWork.model.bo.WorkApplyPendingInfoBO; +import com.gk.hotwork.specialWork.model.query.db.AllWorkApplyPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyApplyingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyPendingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWorkApplyDBQuery; + +import java.util.List; + +public interface WorkApplyInfoService extends IService<WorkApplyInfo> { + + void saveWorkApplyInfo(WorkApplyInfo applyEntity); + + void updateStatusById(Long workApplyId, WorkStatusEnum statusEnum); + + List<WorkApplyInfo> listWorkApplyInfoByPage(Page<WorkApplyInfo> page, WorkApplyApplyingPageDBQuery dbQuery); + + List<WorkApplyPendingInfoBO> listPendingWorkApplyInfo(Page<WorkApplyPendingInfoBO> page, WorkApplyPendingPageDBQuery dbQuery); + + WorkApplyInfo getWorkApprovalByApprovalUid(Long workApplyId, Long approvalUid); + + int countWorkApplyInfo(); + + void updateApprovalStepIdById(Long id, Long nextStepId); + + List<WorkApplyInfo> listAllWorkApplyByPage(Page<WorkApplyInfo> page, AllWorkApplyPageDBQuery dbQuery); + + List<WorkApplyCountDO> getWorkApplyCountByDep(); + + WorkApplyInfo getApplyInfoByWorkPermitNo(String workPermitNo); + + List<WorkApplyReportableDO> listReportableWorkApply(WorkProcessWorkApplyDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyOperatorInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyOperatorInfoService.java new file mode 100644 index 0000000..7e39115 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyOperatorInfoService.java @@ -0,0 +1,14 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApplyOperatorInfo; + +import java.util.List; + +public interface WorkApplyOperatorInfoService extends IService<WorkApplyOperatorInfo> { + + +// void saveBatchOperator(List<WorkApplyOperatorInfo> operatorEntities); + +// List<WorkApplyOperatorInfo> listWorkOperatorByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyRecordInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyRecordInfoService.java new file mode 100644 index 0000000..aa8256a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApplyRecordInfoService.java @@ -0,0 +1,12 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApplyRecordInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyRecordListDBQuery; + +import java.util.List; + +public interface WorkApplyRecordInfoService extends IService<WorkApplyRecordInfo> { + + List<WorkApplyRecordInfo> listByConditions(WorkApplyRecordListDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalFilledItemInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalFilledItemInfoService.java new file mode 100644 index 0000000..ab1637b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalFilledItemInfoService.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalFilledItemInfo; + +import java.util.List; + +public interface WorkApprovalFilledItemInfoService extends IService<WorkApprovalFilledItemInfo> { + + List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByWorkApplyId(Long workApplyId); + + List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByUnitId(Long unitId); + + void saveBatchFilledItemInfo(List<WorkApprovalFilledItemInfo> filledItemInfos); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemInfoService.java new file mode 100644 index 0000000..b01dc48 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemInfoService.java @@ -0,0 +1,16 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo; + +import java.util.List; + +public interface WorkApprovalItemInfoService extends IService<WorkApprovalItemInfo> { + + + void saveBatchRuleItem(List<WorkApprovalItemInfo> workApprovalItemInfos); + + List<WorkApprovalItemInfo> listWorkApprovalItemByWorkApplyId(Long workApplyId); + + List<WorkApprovalItemInfo> listWorkApprovalItemInfoByStepId(Long stepId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemMeasureInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemMeasureInfoService.java new file mode 100644 index 0000000..d24deed --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemMeasureInfoService.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemMeasureInfo; + +import java.util.List; + +public interface WorkApprovalItemMeasureInfoService extends IService<WorkApprovalItemMeasureInfo> { + + void saveBatchMeasure(List<WorkApprovalItemMeasureInfo> measureEntities); + + List<WorkApprovalItemMeasureInfo> listWorkApprovalItemMeasureByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemStandInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemStandInfoService.java new file mode 100644 index 0000000..ce10d3b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalItemStandInfoService.java @@ -0,0 +1,13 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo; + +import java.util.List; + +public interface WorkApprovalItemStandInfoService extends IService<WorkApprovalItemStandInfo> { + + void saveBatchStand(List<WorkApprovalItemStandInfo> standEntities); + + List<WorkApprovalItemStandInfo> listWorkApprovalItemStandByWorkApplyId(Long workApplyId); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalRuleInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalRuleInfoService.java new file mode 100644 index 0000000..fb5e4aa --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalRuleInfoService.java @@ -0,0 +1,10 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalRuleInfo; + +public interface WorkApprovalRuleInfoService extends IService<WorkApprovalRuleInfo> { + + + void saveRule(WorkApprovalRuleInfo ruleEntity); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalStepInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalStepInfoService.java new file mode 100644 index 0000000..52a4ba9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalStepInfoService.java @@ -0,0 +1,21 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalStepResultEnum; + +import java.time.LocalDateTime; +import java.util.List; + +public interface WorkApprovalStepInfoService extends IService<WorkApprovalStepInfo> { + + void saveBatchRuleStep(List<WorkApprovalStepInfo> ruleStepEntities); + + List<WorkApprovalStepInfo> listApprovalRuleStepByWorkApplyId(Long workApplyId); + + void updateStatusById(Long id, WorkApprovalStepResultEnum result); + + void updateFinishApprovalTimeById(Long id, LocalDateTime now); + + void updateStartApprovalTimeById(Long id, LocalDateTime now); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalUnitInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalUnitInfoService.java new file mode 100644 index 0000000..8bdbe67 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkApprovalUnitInfoService.java @@ -0,0 +1,28 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalUnitResultEnum; + +import java.util.List; + +public interface WorkApprovalUnitInfoService extends IService<WorkApprovalUnitInfo> { + + void saveBatchRuleUnit(List<WorkApprovalUnitInfo> workApprovalUnitInfos); + + List<WorkApprovalUnitInfo> listApprovalRuleUnitByWorkApplyId(Long workApplyId); + + WorkApprovalUnitInfo getWorkApprovalUnitByStepIdAndUid(Long stepId, Long approvalUid); + + void updateStatusById(Long unitId, WorkApprovalUnitResultEnum resultStatus); + + List<WorkApprovalUnitInfo> listApprovalRuleUnitByStepId(Long stepId); + + void updateStatusByStepId(Long stepId, WorkApprovalUnitResultEnum result); + + void updateStatusByIds(List<Long> unitIds, WorkApprovalUnitResultEnum result); + + void updateStatusAndFillContentById(Long id, String unitFillContent, WorkApprovalUnitResultEnum resultSuccess); + + void batchUpdateStatusByIds(List<Long> otherUnApprovalUnitIds, WorkApprovalUnitResultEnum result); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkAtHeightInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkAtHeightInfoService.java new file mode 100644 index 0000000..a7bfa9a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkAtHeightInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkAtHeightInfo; +import com.gk.hotwork.specialWork.model.query.WorkAtHeightQuery; + +import java.util.List; + +public interface WorkAtHeightInfoService extends IService<WorkAtHeightInfo> { + /** + * 新增 + * @param workAtHeightInfo + * @return + */ + int saveOne(WorkAtHeightInfo workAtHeightInfo); + + /** + * 修改 + * @param workAtHeightInfo + * @return + */ + int updateOne(WorkAtHeightInfo workAtHeightInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkAtHeightInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkAtHeightInfo> getListByConditions(WorkAtHeightQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBlindPlatePluggingInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBlindPlatePluggingInfoService.java new file mode 100644 index 0000000..b26a823 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBlindPlatePluggingInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkBlindPlatePluggingInfo; +import com.gk.hotwork.specialWork.model.query.WorkBlindPlatePluggingQuery; + +import java.util.List; + +public interface WorkBlindPlatePluggingInfoService extends IService<WorkBlindPlatePluggingInfo> { + /** + * 新增 + * @param workBlindPlatePluggingInfo + * @return + */ + int saveOne(WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo); + + /** + * 修改 + * @param workBlindPlatePluggingInfo + * @return + */ + int updateOne(WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkBlindPlatePluggingInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkBlindPlatePluggingInfo> getListByConditions(WorkBlindPlatePluggingQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBrokenCircuitInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBrokenCircuitInfoService.java new file mode 100644 index 0000000..dcf8aba --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkBrokenCircuitInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkBrokenCircuitInfo; +import com.gk.hotwork.specialWork.model.query.WorkBrokenCircuitQuery; + +import java.util.List; + +public interface WorkBrokenCircuitInfoService extends IService<WorkBrokenCircuitInfo> { + /** + * 新增 + * @param workBrokenCircuitInfo + * @return + */ + int saveOne(WorkBrokenCircuitInfo workBrokenCircuitInfo); + + /** + * 修改 + * @param workBrokenCircuitInfo + * @return + */ + int updateOne(WorkBrokenCircuitInfo workBrokenCircuitInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkBrokenCircuitInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkBrokenCircuitInfo> getListByConditions(WorkBrokenCircuitQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkConfinedSpaceInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkConfinedSpaceInfoService.java new file mode 100644 index 0000000..b4c226c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkConfinedSpaceInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkConfinedSpaceInfo; +import com.gk.hotwork.specialWork.model.query.WorkConfinedSpaceQuery; + +import java.util.List; + +public interface WorkConfinedSpaceInfoService extends IService<WorkConfinedSpaceInfo> { + /** + * 新增 + * @param workConfinedSpaceInfo + * @return + */ + int saveOne(WorkConfinedSpaceInfo workConfinedSpaceInfo); + + /** + * 修改 + * @param workConfinedSpaceInfo + * @return + */ + int updateOne(WorkConfinedSpaceInfo workConfinedSpaceInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkConfinedSpaceInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkConfinedSpaceInfo> getListByConditions(WorkConfinedSpaceQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkGroundBreakingInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkGroundBreakingInfoService.java new file mode 100644 index 0000000..ac1e28c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkGroundBreakingInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkGroundBreakingInfo; +import com.gk.hotwork.specialWork.model.query.WorkGroundBreakingQuery; + +import java.util.List; + +public interface WorkGroundBreakingInfoService extends IService<WorkGroundBreakingInfo> { + /** + * 新增 + * @param workGroundBreakingInfo + * @return + */ + int saveOne(WorkGroundBreakingInfo workGroundBreakingInfo); + + /** + * 修改 + * @param workGroundBreakingInfo + * @return + */ + int updateOne(WorkGroundBreakingInfo workGroundBreakingInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkGroundBreakingInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkGroundBreakingInfo> getListByConditions(WorkGroundBreakingQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHoistingInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHoistingInfoService.java new file mode 100644 index 0000000..a3ce956 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHoistingInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkHoistingInfo; +import com.gk.hotwork.specialWork.model.query.WorkHoistingQuery; + +import java.util.List; + +public interface WorkHoistingInfoService extends IService<WorkHoistingInfo> { + /** + * 新增 + * @param workHoistingInfo + * @return + */ + int saveOne(WorkHoistingInfo workHoistingInfo); + + /** + * 修改 + * @param workHoistingInfo + * @return + */ + int updateOne(WorkHoistingInfo workHoistingInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ +// WorkHoistingInfo getById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkHoistingInfo> getListByConditions(WorkHoistingQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHotInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHotInfoService.java new file mode 100644 index 0000000..e1d0b10 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkHotInfoService.java @@ -0,0 +1,43 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkHotInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkHotQuery; + +import java.util.List; + +public interface WorkHotInfoService extends IService<WorkHotInfo> { + + /** + * 新增 + */ + int saveOne(WorkHotInfo workHotInfo); + + /** + * 更新 + * @param workHotInfo + * @return + */ + int updateOne(WorkHotInfo workHotInfo); + + /** + * 删除 - 单条 + * @param id + * @return + */ + int updateOneStatus(Long id); + + /** + * 删除 - 批量 + * @param ids + * @return + */ + int batchUpdateStatus(List<Long> ids); + + /** + * + * @param query + * @return + */ + List<WorkHotInfo> listWorkHot(WorkHotQuery query); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessDetectionInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessDetectionInfoService.java new file mode 100644 index 0000000..2f234a8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessDetectionInfoService.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessDetectionPageDBQuery; + +import java.util.List; + +public interface WorkProcessDetectionInfoService extends IService<WorkProcessDetectionInfo> { + + void saveWorkProcessDetectionInfo(WorkProcessDetectionInfo detectionEntity); + + List<WorkProcessDetectionInfo> listWorkDetectionInfoByPage(Page<WorkProcessDetectionInfo> page, WorkProcessDetectionPageDBQuery dbQuery); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessWarningInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessWarningInfoService.java new file mode 100644 index 0000000..4db793d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkProcessWarningInfoService.java @@ -0,0 +1,15 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWarningPageDBQuery; + +import java.util.List; + +public interface WorkProcessWarningInfoService extends IService<WorkProcessWarningInfo> { + + List<WorkProcessWarningInfo> listWorkProcessWarningInfoByPage(Page<WorkProcessWarningInfo> page, WorkProcessWarningPageDBQuery dbQuery); + + void saveWorkProcessWarningInfo(WorkProcessWarningInfo warningInfo); +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkTemporaryPowerInfoService.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkTemporaryPowerInfoService.java new file mode 100644 index 0000000..1043ee1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/WorkTemporaryPowerInfoService.java @@ -0,0 +1,52 @@ +package com.gk.hotwork.specialWork.service.baseService; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.specialWork.entity.WorkTemporaryPowerInfo; +import com.gk.hotwork.specialWork.model.query.WorkTemporaryPowerQuery; + +import java.util.List; + +public interface WorkTemporaryPowerInfoService extends IService<WorkTemporaryPowerInfo> { + /** + * 新增 + * @param workTemporaryPowerInfo + * @return + */ + int saveOne(WorkTemporaryPowerInfo workTemporaryPowerInfo); + + /** + * 修改 + * @param workTemporaryPowerInfo + * @return + */ + int updateOne(WorkTemporaryPowerInfo workTemporaryPowerInfo); + + /** + * 单条删除 + * @param id + * @return + */ + int updateStatusById(Long id); + + /** + * 批量删除 + * @param idList + * @return + */ + int updateStatutsByIds(List<Long> idList); + + /** + * 根据id获取数据 + * @param id + * @return + */ + WorkTemporaryPowerInfo getWorkTemporaryPowerInfoById(Long id); + + /** + * 条件查询 + * @param query + * @return + */ + List<WorkTemporaryPowerInfo> getListByConditions(WorkTemporaryPowerQuery query); + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleItemMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleItemMeasureServiceImpl.java new file mode 100644 index 0000000..c79e32e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleItemMeasureServiceImpl.java @@ -0,0 +1,77 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasure; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasureDO; +import com.gk.hotwork.specialWork.enums.RuleMeasureStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; +import com.gk.hotwork.specialWork.repository.ApprovalRuleItemMeasureRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleItemMeasureService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Set; + +@Service("ApprovalRuleItemMeasureService") +public class ApprovalRuleItemMeasureServiceImpl extends ServiceImpl<ApprovalRuleItemMeasureRepository, ApprovalRuleItemMeasure> implements ApprovalRuleItemMeasureService { + + @Autowired + private ApprovalRuleItemMeasureRepository approvalRuleItemMeasureRepository; + + @Override + public int saveOne(ApprovalRuleItemMeasure measure) { + measure.setStatus(RuleMeasureStatusEnum.VALID.getCode()); + measure.setGmtCreate(LocalDateTime.now()); + return baseMapper.insert(measure); + } + + @Override + public int updateOne(ApprovalRuleItemMeasure measure) { + if(null == measure.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + measure.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(measure); + } + + @Override + public int updateStatusByIds(List<Long> ids) { + return baseMapper.updateStatusByIds(ids,RuleMeasureStatusEnum.ABANDONED.getCode()); + } + + @Override + public int updateStatusById(Long id) { + return baseMapper.updateStatusById(id,RuleMeasureStatusEnum.ABANDONED.getCode()); + } + + @Override + public List<ApprovalRuleItemMeasure> list(ApprovalRuleItemMeasureQuery query) { + query.setStatus(RuleMeasureStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } + + @Override + public List<ApprovalRuleItemMeasure> listBypage(Page<ApprovalRuleItemMeasure> page, ApprovalRuleItemMeasureQuery query) { + query.setStatus(RuleMeasureStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(page,query); + } + + @Override + public List<Long> listMeasureId() { + return baseMapper.listMeasureId(RuleMeasureStatusEnum.VALID.getCode()); + } + + @Override + public List<ApprovalRuleItemMeasureDO> listItemMeasureByIds(Set<Long> measureIds) { + if (measureIds == null || measureIds.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleItemMeasureRepository.listItemMeasureByIds(measureIds); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleServiceImpl.java new file mode 100644 index 0000000..6dc0810 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleServiceImpl.java @@ -0,0 +1,109 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRule; +import com.gk.hotwork.specialWork.enums.RuleStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleListDbQuery; +import com.gk.hotwork.specialWork.repository.ApprovalRuleRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("ApprovalRuleService") +public class ApprovalRuleServiceImpl extends ServiceImpl<ApprovalRuleRepository, ApprovalRule> implements ApprovalRuleService { + + @Autowired + private ApprovalRuleRepository approvalRuleRepository; + + /** + * 规则新增 + * @param rule + * @return + */ + @Override + public int saveOneRule(ApprovalRule rule) { + rule.setStatus(RuleStatusEnum.VALID.getCode()); + rule.setGmtCreate(LocalDateTime.now()); + return baseMapper.insert(rule); + } + /** + * 更新 + * @param rule + * @return + */ + @Override + public int updateRule(ApprovalRule rule) { + rule.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(rule); + } + /** + * 逻辑删除 批量删除 + */ + @Override + public int updateStutsByRuleIds(List<Long> ruleIds) { + + return baseMapper.updateStutsByRuleIds(ruleIds,RuleStatusEnum.ABANDONED.getCode()); + } + + /** + * 删除-单条 + */ + @Override + public int updateStutsByRuleId(Long ruleId) { + + return baseMapper.updateStutsByRuleId(ruleId,RuleStatusEnum.ABANDONED.getCode()); + } + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<ApprovalRule> listRule(ApprovalRuleListDbQuery query) { + query.setStatus(RuleStatusEnum.VALID.getCode()); + List<ApprovalRule> approvalRuleList = baseMapper.listByConditions(query); + return approvalRuleList; + } + + @Override + public List<ApprovalRule> listRuleByPage(Page<ApprovalRule> page, ApprovalRuleListDbQuery query) { + query.setStatus(RuleStatusEnum.VALID.getCode()); + List<ApprovalRule> approvalRuleList = baseMapper.listByConditions(page,query); + return approvalRuleList; + } + + @Override + public ApprovalRule getApprovalRuleInfo(Long depId, Byte workType, Byte workLevel) { + if (depId == null || workLevel == null || workType == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleRepository.selectOne(new LambdaQueryWrapper<ApprovalRule>() + // 部门id + .eq(ApprovalRule::getDepId,depId) + // 作业等级 + .eq(ApprovalRule::getWorkLevel,workLevel) + // 作业类型 + .eq(ApprovalRule::getWorkType,workType) + // 状态 + .eq(ApprovalRule::getStatus,RuleStatusEnum.VALID.getCode())); + } + + @Override + public int saveRuleInfo(ApprovalRule rule) { + if (rule.getRuleId() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + rule.setStatus(RuleStatusEnum.VALID.getCode()); + rule.setGmtCreate(LocalDateTime.now()); + return approvalRuleRepository.insertRuleInfo(rule); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStandServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStandServiceImpl.java new file mode 100644 index 0000000..9fe2962 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStandServiceImpl.java @@ -0,0 +1,110 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStand; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO; +import com.gk.hotwork.specialWork.enums.RuleItemStandStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandListDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import com.gk.hotwork.specialWork.repository.ApprovalRuleItemStandRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleStandService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +@Service("ApprovalRuleStandService") +public class ApprovalRuleStandServiceImpl extends ServiceImpl<ApprovalRuleItemStandRepository, ApprovalRuleItemStand> implements ApprovalRuleStandService { + + @Autowired + private ApprovalRuleItemStandRepository approvalRuleItemStandRepository; + + @Override + public void saveRuleStand(ApprovalRuleItemStand itemStandEntity) { + if (itemStandEntity == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleItemStandRepository.insert(itemStandEntity); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public ApprovalRuleItemStandDO getRuleStandDOById(Long ruleStandId) { + if (ruleStandId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleItemStandRepository.getRuleStandDOById(ruleStandId, RuleItemStandStatusEnum.VALID.getCode()); + } + + @Override + public void updateRuleStand(ApprovalRuleItemStand itemStandEntity) { + if (itemStandEntity == null || itemStandEntity.getId() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleItemStandRepository.updateById(itemStandEntity); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public List<ApprovalRuleItemStandDO> listRuleStandDO(ApprovalRuleStandListDBQuery dbQuery) { + if (dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleItemStandRepository.listRuleStandDO(dbQuery); + } + + @Override + public List<ApprovalRuleItemStand> listRuleStandByPage(Page<ApprovalRuleItemStand> page, ApprovalRuleStandPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleItemStandRepository.listRuleStandByPage(page,dbQuery); + } + + @Override + public void deleteBatch(EntityStatusBatchUO batchDeleteObj) { + if (batchDeleteObj == null || + batchDeleteObj.getIds() == null || + batchDeleteObj.getIds().size() == 0 || + batchDeleteObj.getStatus() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleItemStandRepository.updateStatusBatch(batchDeleteObj); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i != batchDeleteObj.getIds().size()) { + throw new BusinessException(ResultCodes.SERVER_BATCH_UPDATE_ERROR); + } + + } + + /** + * 获取标准列表 无条件 + * @return + */ + @Override + public List<Long> listStandId() { + return baseMapper.listStandId(RuleItemStandStatusEnum.VALID.getCode()); + } + + @Override + public List<ApprovalRuleItemStandDO> listItemStandByIds(Set<Long> standIds) { + if (standIds == null || standIds.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleItemStandRepository.listItemStandByIds(standIds); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStepServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStepServiceImpl.java new file mode 100644 index 0000000..d880fa1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleStepServiceImpl.java @@ -0,0 +1,152 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRuleStep; +import com.gk.hotwork.specialWork.enums.RuleStatusEnum; +import com.gk.hotwork.specialWork.enums.RuleStepStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStepListDbQuery; +import com.gk.hotwork.specialWork.repository.ApprovalRuleStepRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleStepService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("ApprovalRuleStepService") +public class ApprovalRuleStepServiceImpl extends ServiceImpl<ApprovalRuleStepRepository, ApprovalRuleStep> implements ApprovalRuleStepService { + + @Autowired + private ApprovalRuleStepRepository approvalRuleStepRepository; + + + @Override + public int saveOneStep(ApprovalRuleStep step) { + step.setStatus(RuleStepStatusEnum.VALID.getCode()); + step.setGmtCreate(LocalDateTime.now()); + return baseMapper.insert(step); + } + /** + * 更新 + */ + @Override + public int updateOneStep(ApprovalRuleStep step) { + step.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(step); + } + + /** + * 批量删除 + * @param stepIds 主键 + * @return + */ + @Override + public int updateStatusByStepIds(List<Long> stepIds) { + return baseMapper.updateStatusByStepIds(stepIds,RuleStepStatusEnum.ABANDONED.getCode()); + } + + /** + * 单挑删除 + * @param stepId + * @return + */ + @Override + public int updateStatusByStepId(Long stepId) { + return baseMapper.updateStatusByStepId(stepId,RuleStepStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据规则 ruleIds 删除层级数据 + * @param ruleIds 规则ids + * @return + */ + @Override + public int updateStatusByRuleIds(List<Long> ruleIds) { + return baseMapper.updateStatusByRuleIds(ruleIds,RuleStepStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据规则 ruleId 删除层级数据 + * @param ruleId 规则id + * @return + */ + @Override + public int updateStatusByRuleId(Long ruleId) { + return baseMapper.updateStatusByRuleId(ruleId,RuleStepStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据规则id获取集合 + * @param ruleId + * @return + */ + @Override + public List<ApprovalRuleStep> listByRuleId(Long ruleId) { + return baseMapper.listByRuleId(ruleId,RuleStepStatusEnum.VALID.getCode()); + } + /** + * 根据规则id获取层级集合id + * @param ruleId + * @return + */ + @Override + public List<Long> listStepIdByRuleId(Long ruleId) { + return baseMapper.listStepIdByRuleId(ruleId,RuleStatusEnum.VALID.getCode()); + } + + @Override + public List<ApprovalRuleStep> listStep(ApprovalRuleStepListDbQuery query){ + query.setStatus(RuleStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } + + @Override + public List<ApprovalRuleStep> listStepByNoConditions() { + return baseMapper.selectList(new LambdaQueryWrapper<ApprovalRuleStep>() + .eq(ApprovalRuleStep::getStatus,RuleStepStatusEnum.VALID.getCode()) + ); + } + + + @Override + public List<ApprovalRuleStep> listApprovalRuleStepByRuleId(Long ruleId) { + if (ruleId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleStepRepository.selectList(new LambdaQueryWrapper<ApprovalRuleStep>() + // 规则id + .eq(ApprovalRuleStep::getRuleId,ruleId) + // 状态 + .eq(ApprovalRuleStep::getStatus,RuleStepStatusEnum.VALID.getCode()) + ); + } + + /** + * 更新一条数据(将pre_step_id置空) + */ + @Override + public int updateStepAndEmptyPreStepId(ApprovalRuleStep step) { + return baseMapper.updateStepAndEmptyPreStepId(step); + } + + @Override + public int saveStepList(List<ApprovalRuleStep> saveStepList) { + + return baseMapper.saveStepList( saveStepList); + } + + /** + * 批量更新 + * @param updateStepList + * @return + */ + @Override + public int updateBatchStep(List<ApprovalRuleStep> updateStepList) { + return baseMapper.updateBatchStep(updateStepList); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitItemServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitItemServiceImpl.java new file mode 100644 index 0000000..eeecebd --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitItemServiceImpl.java @@ -0,0 +1,236 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItemDO; +import com.gk.hotwork.specialWork.enums.RuleItemStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import com.gk.hotwork.specialWork.repository.ApprovalRuleUnitItemRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleUnitItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("ApprovalRuleUnitItemService") +public class ApprovalRuleUnitItemServiceImpl extends ServiceImpl<ApprovalRuleUnitItemRepository, ApprovalRuleUnitItem> implements ApprovalRuleUnitItemService { + + @Autowired + private ApprovalRuleUnitItemRepository approvalRuleUnitItemRepository; + + /** + * 新增 + * @param item + * @return + */ + @Override + public int saveOneItem(ApprovalRuleUnitItem item) { + item.setStatus(RuleItemStatusEnum.VALID.getCode()); + item.setGmtCreate(LocalDateTime.now()); + return baseMapper.insert(item); + } + + @Override + public int batchSaveItemList(List<ApprovalRuleUnitItem> itemList) { + return baseMapper.batchInsert(itemList); + } + + + @Override + public List<ApprovalRuleUnitItem> listActiveByRuleStepId(Long stepId) { + return baseMapper.listActiveByRuleStepId(stepId,RuleItemStatusEnum.VALID.getCode()); + } + + @Override + public List<ApprovalRuleUnitItem> listByRuleId(Long ruleId) { + return baseMapper.listActiveByRuleId(ruleId,RuleItemStatusEnum.VALID.getCode()); + } + /** + * 根据审批项删除 + * @param itemId + * @return + */ + @Override + public int updateStatusById(Long itemId) { + return baseMapper.updateStatusById(itemId,RuleItemStatusEnum.ABANDONED.getCode()); + } + + /** + * 审批项删除 + * @param itemIds + * @return + */ + @Override + public int updateStatusByIds(List<Long> itemIds) { + return baseMapper.updateStatusByIds(itemIds,RuleItemStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据标准id获取数据 + * @param standIdList + * @return + */ + @Override + public List<ApprovalRuleUnitItem> listActiveByRuleStandIds(List<Long> standIdList) { + List<ApprovalRuleUnitItem> approvalRuleUnitItems = baseMapper.listActiveByRuleStandId(standIdList,RuleItemStatusEnum.VALID.getCode()); + return approvalRuleUnitItems; + } + + /** + * 根据ruleIds 批量删除 + * @param ruleIds + * @return + */ + @Override + public int updateStatusByRuleIds(List<Long> ruleIds) { + return baseMapper.updateStatusByRuleIds(ruleIds,RuleItemStatusEnum.ABANDONED.getCode()); + } + /** + * 根据规则删除 + * @param ruleId + * @return + */ + @Override + public int updateStatusByRuleId(Long ruleId) { + return baseMapper.updateStatusByRuleId(ruleId,RuleItemStatusEnum.ABANDONED.getCode()); + } + /** + * 根据层级删除 stepId + */ + @Override + public int updateStatusByStepId(Long stepId) { + return baseMapper.updateStatusByStepId(stepId,RuleItemStatusEnum.ABANDONED.getCode()); + } + /** + * 根据层级删除 stepIds + */ + @Override + public int updateStatusByStepIds(List<Long> stepIds) { + return baseMapper.updateStatusByStepIds(stepIds,RuleItemStatusEnum.ABANDONED.getCode()); + } + + + @Override + public void saveRuleItem(ApprovalRuleUnitItem itemEntity) { + if (itemEntity == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleUnitItemRepository.insertRuleItem(itemEntity); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public void updateRuleItem(ApprovalRuleUnitItem itemEntity) { + if (itemEntity == null || itemEntity.getId() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleUnitItemRepository.updateRuleItem(itemEntity); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public ApprovalRuleUnitItemDO getApprovalRuleUnitItemDOById(Long ruleItemId) { + if (ruleItemId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleUnitItemRepository.getApprovalRuleUnitItemDOById(ruleItemId); + } + + @Override + public void deleteBatch(EntityStatusBatchUO entityBatchDeleteObject) { + if (entityBatchDeleteObject == null || + entityBatchDeleteObject.getIds() == null || + entityBatchDeleteObject.getIds().size() == 0 || + entityBatchDeleteObject.getStatus() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = approvalRuleUnitItemRepository.updateStatusBatch(entityBatchDeleteObject); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i != entityBatchDeleteObject.getIds().size()) { + throw new BusinessException(ResultCodes.SERVER_BATCH_UPDATE_ERROR); + } + + } + + @Override + public List<ApprovalRuleUnitItem> listRuleItemByPage(Page<ApprovalRuleUnitItem> page, ApprovalRuleItemPageDBQuery dbQuery) { + if (dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleUnitItemRepository.listRuleItemByPage(page,dbQuery); + } + + @Override + public List<ApprovalRuleUnitItemDO> listRuleItem(ApprovalRuleItemDBQuery dbQuery) { + if (dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + dbQuery.setStatus(RuleItemStatusEnum.VALID.getCode()); + return approvalRuleUnitItemRepository.listRuleItemDO(dbQuery); + } + + @Override + public long countByRuleStandId(Long ruleStandId) { + if (ruleStandId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleUnitItemRepository.selectCount(new LambdaQueryWrapper<ApprovalRuleUnitItem>() + // 审批项标准id + .eq(ApprovalRuleUnitItem::getStandId, ruleStandId) + // 状态 + .eq(ApprovalRuleUnitItem::getStatus,RuleItemStatusEnum.VALID.getCode())); + } + + /** + * 根据措施ids统计数据 + * @param measureIds + * @return + */ + @Override + public int countByMeasureIds(List<Long> measureIds) { + return baseMapper.countByMeasureIds(measureIds,RuleItemStatusEnum.VALID.getCode()); + } + + @Override + public int updateBatchItem(List<ApprovalRuleUnitItem> itemList) { + return baseMapper.updateItemBatch(itemList); + } + + @Override + public List<ApprovalRuleUnitItem> listByNoConditions() { + return baseMapper.selectList(new LambdaQueryWrapper<ApprovalRuleUnitItem>() + .eq(ApprovalRuleUnitItem::getStatus,RuleItemStatusEnum.VALID.getCode())); + } + + @Override + public List<ApprovalRuleUnitItem> listApprovalRuleUnitItemByRuleId(Long ruleId) { + if (ruleId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + + return approvalRuleUnitItemRepository.selectList(new LambdaQueryWrapper<ApprovalRuleUnitItem>() + // 规则id + .eq(ApprovalRuleUnitItem::getRuleId,ruleId) + // 状态 + .eq(ApprovalRuleUnitItem::getStatus,RuleItemStatusEnum.VALID.getCode()) + ); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitServiceImpl.java new file mode 100644 index 0000000..decf106 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/ApprovalRuleUnitServiceImpl.java @@ -0,0 +1,142 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnit; +import com.gk.hotwork.specialWork.enums.RuleUnitStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleUnitDbQuery; +import com.gk.hotwork.specialWork.repository.ApprovalRuleUnitRepository; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleUnitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("ApprovalRuleUnitService") +public class ApprovalRuleUnitServiceImpl extends ServiceImpl<ApprovalRuleUnitRepository, ApprovalRuleUnit> implements ApprovalRuleUnitService { + + @Autowired + private ApprovalRuleUnitRepository approvalRuleUnitRepository; + + + /** + * 新增 + * @param unit + * @return + */ + @Override + public int saveOneUnit(ApprovalRuleUnit unit) { + unit.setStatus(RuleUnitStatusEnum.VALID.getCode()); + unit.setGmtCreate(LocalDateTime.now()); + return baseMapper.insert(unit); + } + /** + * 修改 + */ + @Override + public int updateOneUnit(ApprovalRuleUnit unit) { + unit.setGmtModified(LocalDateTime.now()); + return baseMapper.insert(unit); + } + /** + * 批量更新 + * @param unitList + * @return + */ + @Override + public int saveUnitList(List<ApprovalRuleUnit> unitList) { + + return baseMapper.batchInsert(unitList); + } + + @Override + public List<ApprovalRuleUnit> listByRuleStepId(Long stepId) { + List<ApprovalRuleUnit> unitList = baseMapper.listActiveByRuleStepId(stepId,RuleUnitStatusEnum.VALID.getCode()); + return unitList; + } + /** + * 根据stepIds获取 + * @param stepId + * @return + */ + @Override + public List<Long> listUnitIdByStepId(Long stepId) { + return baseMapper.listUnitIdByStepId(stepId,RuleUnitStatusEnum.VALID.getCode()); + } + + @Override + public int updateStatusByRuleStepId(Long stepId) { + return baseMapper.updateStatusByRuleStepId(stepId,RuleUnitStatusEnum.ABANDONED.getCode()); + } + + @Override + public int updateStatusByStepIds(List<Long> stepIds) { + return baseMapper.updateStatusByStepIds(stepIds,RuleUnitStatusEnum.ABANDONED.getCode()); + } + + @Override + public int updateStatusByRuleId(Long ruleId) { + return baseMapper.updateStatusByRuleId(ruleId,RuleUnitStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据规则ruleIds删除数据 + * @param ruleIds + * @return + */ + @Override + public int updateStatusByRuleIds(List<Long> ruleIds) { + return baseMapper.updateStatusByRuleIds(ruleIds,RuleUnitStatusEnum.ABANDONED.getCode()); + } + + /** + * 批量删除 + * @param unitIds + * @return + */ + @Override + public int updateStatusByUnitIds(List<Long> unitIds) { + return baseMapper.updateStatusByUnitIds(unitIds,RuleUnitStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据规则id获取集合 + * @param ruleId + * @return + */ + @Override + public List<ApprovalRuleUnit> listByRuleId(Long ruleId) { + return baseMapper.listActiveByRuleId(ruleId,RuleUnitStatusEnum.VALID.getCode()); + } + + @Override + public List<ApprovalRuleUnit> listByConditions(ApprovalRuleUnitDbQuery query) { + query.setStatus(RuleUnitStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } + + @Override + public List<ApprovalRuleUnit> listApprovalUnitByRuleId(Long ruleId) { + if (ruleId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return approvalRuleUnitRepository.selectList(new LambdaQueryWrapper<ApprovalRuleUnit>() + // 规则id + .eq(ApprovalRuleUnit::getRuleId,ruleId) + + // 状态 + .eq(ApprovalRuleUnit::getStatus,RuleUnitStatusEnum.VALID.getCode()) + ); + } + + @Override + public List<ApprovalRuleUnit> listByNoConditions() { + return baseMapper.selectList(new LambdaQueryWrapper<ApprovalRuleUnit>() + .eq(ApprovalRuleUnit::getStatus,RuleUnitStatusEnum.VALID.getCode())); + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyInfoServiceImpl.java new file mode 100644 index 0000000..dd5aa7d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyInfoServiceImpl.java @@ -0,0 +1,139 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApplyCountDO; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApplyReportableDO; +import com.gk.hotwork.specialWork.enums.WorkStatusEnum; +import com.gk.hotwork.specialWork.model.bo.WorkApplyPendingInfoBO; +import com.gk.hotwork.specialWork.model.query.db.AllWorkApplyPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyApplyingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyPendingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWorkApplyDBQuery; +import com.gk.hotwork.specialWork.repository.WorkApplyInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyInfoService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workInfoService") +public class WorkApplyInfoServiceImpl extends ServiceImpl<WorkApplyInfoRepository, WorkApplyInfo> implements WorkApplyInfoService { + + @Autowired + private WorkApplyInfoRepository workApplyInfoRepository; + + + @Override + public void saveWorkApplyInfo(WorkApplyInfo applyEntity) { + if (applyEntity == null || applyEntity.getId() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApplyInfoRepository.insertWorkApplyInfo(applyEntity); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public void updateStatusById(Long workApplyId, WorkStatusEnum statusEnum) { + if (workApplyId == null || statusEnum == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApplyInfoRepository.updateStatusById(workApplyId, statusEnum.getStatus()); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public List<WorkApplyInfo> listWorkApplyInfoByPage(Page<WorkApplyInfo> page, WorkApplyApplyingPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApplyInfoRepository.listWorkApplyInfoByPage(page,dbQuery); + } + + @Override + public List<WorkApplyPendingInfoBO> listPendingWorkApplyInfo(Page<WorkApplyPendingInfoBO> page, WorkApplyPendingPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApplyInfoRepository.listPendingWorkApplyInfo(page,dbQuery); + } + + @Override + public WorkApplyInfo getWorkApprovalByApprovalUid(Long workApplyId, Long approvalUid) { + if (workApplyId == null || approvalUid == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApplyInfoRepository.getWorkApprovalByApprovalUid(workApplyId,approvalUid); + } + + @Override + public int countWorkApplyInfo() { + return workApplyInfoRepository.countWorkApplyInfo(); + } + + @Override + public void updateApprovalStepIdById(Long workApplyId, Long nextStepId) { + if (workApplyId == null || nextStepId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApplyInfoRepository.updateApprovalStepIdById(workApplyId, nextStepId); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public List<WorkApplyInfo> listAllWorkApplyByPage(Page<WorkApplyInfo> page, AllWorkApplyPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApplyInfoRepository.listAllWorkApplyByPage(page,dbQuery); + } + + @Override + public List<WorkApplyCountDO> getWorkApplyCountByDep() { + return workApplyInfoRepository.getWorkApplyCountByDep(); + } + + @Override + public WorkApplyInfo getApplyInfoByWorkPermitNo(String workPermitNo) { + if (StringUtils.isBlank(workPermitNo)) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + List<WorkApplyInfo> workApplyInfos = workApplyInfoRepository.selectList(new LambdaQueryWrapper<WorkApplyInfo>() + // 编号 + .eq(WorkApplyInfo::getWorkPermitNo, workPermitNo)); + + if (workApplyInfos.size() == 0) { + return null; + } + if (workApplyInfos.size() > 1) { + throw new BusinessException(ResultCodes.SERVER_DATABASE_DATA_DUPLICATED); + } + + return workApplyInfos.get(0); + } + + @Override + public List<WorkApplyReportableDO> listReportableWorkApply(WorkProcessWorkApplyDBQuery dbQuery) { + if (dbQuery == null || dbQuery.getNow() == null || dbQuery.getStatus() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApplyInfoRepository.listReportableWorkApply(dbQuery); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyOperatorInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyOperatorInfoServiceImpl.java new file mode 100644 index 0000000..57b92d7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyOperatorInfoServiceImpl.java @@ -0,0 +1,38 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApplyOperatorInfo; +import com.gk.hotwork.specialWork.repository.WorkApplyOperatorInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyOperatorInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApplyOperatorInfoService") +public class WorkApplyOperatorInfoServiceImpl extends ServiceImpl<WorkApplyOperatorInfoRepository, WorkApplyOperatorInfo> implements WorkApplyOperatorInfoService { + + @Autowired + private WorkApplyOperatorInfoRepository workApplyOperatorInfoRepository; + +// @Override +// public void saveBatchOperator(List<WorkApplyOperatorInfo> operatorEntities) { +// if (operatorEntities == null || operatorEntities.size() == 0) { +// throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); +// } +// int i = workApplyOperatorInfoRepository.insertBatchOperator(operatorEntities); +// if (i != operatorEntities.size()) { +// throw new BusinessException(ResultCodes.SERVER_BATCH_ADD_ERROR); +// } +// } +// +// @Override +// public List<WorkApplyOperatorInfo> listWorkOperatorByWorkApplyId(Long workApplyId) { +// if (workApplyId == null) { +// throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); +// } +// return workApplyOperatorInfoRepository.listWorkOperatorByWorkApplyId(workApplyId); +// } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyRecordInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyRecordInfoServiceImpl.java new file mode 100644 index 0000000..fe75a78 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApplyRecordInfoServiceImpl.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApplyRecordInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyRecordListDBQuery; +import com.gk.hotwork.specialWork.repository.WorkApplyRecordInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyRecordInfoService; +import org.apache.commons.lang3.ObjectUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApplyRecordInfoService") +public class WorkApplyRecordInfoServiceImpl extends ServiceImpl<WorkApplyRecordInfoRepository, WorkApplyRecordInfo> implements WorkApplyRecordInfoService { + + + @Autowired + private WorkApplyRecordInfoRepository workApplyRecordInfoRepository; + + @Override + public List<WorkApplyRecordInfo> listByConditions(WorkApplyRecordListDBQuery dbQuery) { + if (dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + + return workApplyRecordInfoRepository.selectList(new LambdaQueryWrapper<WorkApplyRecordInfo>() + + .eq(WorkApplyRecordInfo::getWorkApplyId, dbQuery.getWorkApplyId()) + + .eq(WorkApplyRecordInfo::getSysten,dbQuery.isSystemEnable()) + + .eq(!ObjectUtils.isEmpty(dbQuery.getStepId()), WorkApplyRecordInfo::getStepId, dbQuery.getStepId()) + + .like(!ObjectUtils.isEmpty(dbQuery.getOperatorName()), WorkApplyRecordInfo::getOperatorUname, dbQuery.getOperatorName()) + + .orderByAsc(WorkApplyRecordInfo::getOperationTime)); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalFilledItemInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalFilledItemInfoServiceImpl.java new file mode 100644 index 0000000..c309ffb --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalFilledItemInfoServiceImpl.java @@ -0,0 +1,48 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalFilledItemInfo; +import com.gk.hotwork.specialWork.repository.WorkApprovalFilledItemInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalFilledItemInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApprovalFilledItemInfoService") +public class WorkApprovalFilledItemInfoServiceImpl extends ServiceImpl<WorkApprovalFilledItemInfoRepository, WorkApprovalFilledItemInfo> implements WorkApprovalFilledItemInfoService { + + + @Autowired + private WorkApprovalFilledItemInfoRepository workApprovalFilledItemInfoRepository; + + + @Override + public List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalFilledItemInfoRepository.listApprovalFilledItemInfoByWorkApplyId(workApplyId); + } + + @Override + public List<WorkApprovalFilledItemInfo> listApprovalFilledItemInfoByUnitId(Long unitId) { + if (unitId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalFilledItemInfoRepository.listApprovalFilledItemInfoByUnitId(unitId); + } + + @Override + public void saveBatchFilledItemInfo(List<WorkApprovalFilledItemInfo> filledItemInfos) { + if (filledItemInfos == null || filledItemInfos.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalFilledItemInfoRepository.insertBatchFilledItemInfo(filledItemInfos); + if (i != filledItemInfos.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemInfoServiceImpl.java new file mode 100644 index 0000000..8ad67d1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemInfoServiceImpl.java @@ -0,0 +1,47 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemInfo; +import com.gk.hotwork.specialWork.repository.WorkApprovalItemInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalItemInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApprovalItemInfoService") +public class WorkApprovalItemInfoServiceImpl extends ServiceImpl<WorkApprovalItemInfoRepository, WorkApprovalItemInfo> implements WorkApprovalItemInfoService { + + + @Autowired + private WorkApprovalItemInfoRepository workApprovalItemInfoRepository; + + @Override + public void saveBatchRuleItem(List<WorkApprovalItemInfo> workApprovalItemInfos) { + if (workApprovalItemInfos == null || workApprovalItemInfos.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalItemInfoRepository.insertBatch(workApprovalItemInfos); + if (i != workApprovalItemInfos.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkApprovalItemInfo> listWorkApprovalItemByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalItemInfoRepository.listWorkApprovalItemByWorkApplyId(workApplyId); + } + + @Override + public List<WorkApprovalItemInfo> listWorkApprovalItemInfoByStepId(Long stepId) { + if (stepId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalItemInfoRepository.listWorkApprovalItemInfoByStepId(stepId); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemMeasureInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemMeasureInfoServiceImpl.java new file mode 100644 index 0000000..2bf2ffe --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemMeasureInfoServiceImpl.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemMeasureInfo; +import com.gk.hotwork.specialWork.repository.WorkApprovalItemMeasureInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalItemMeasureInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApprovalItemMeasureInfoService") +public class WorkApprovalItemMeasureInfoServiceImpl extends ServiceImpl<WorkApprovalItemMeasureInfoRepository, WorkApprovalItemMeasureInfo> implements WorkApprovalItemMeasureInfoService { + + + @Autowired + private WorkApprovalItemMeasureInfoRepository workApprovalItemMeasureInfoRepository; + + @Override + public void saveBatchMeasure(List<WorkApprovalItemMeasureInfo> measureEntities) { + if (measureEntities == null || measureEntities.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalItemMeasureInfoRepository.insertBatch(measureEntities); + if (i != measureEntities.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkApprovalItemMeasureInfo> listWorkApprovalItemMeasureByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalItemMeasureInfoRepository.listWorkApprovalItemMeasureByWorkApplyId(workApplyId); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemStandInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemStandInfoServiceImpl.java new file mode 100644 index 0000000..7c5ddcc --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalItemStandInfoServiceImpl.java @@ -0,0 +1,40 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalItemStandInfo; +import com.gk.hotwork.specialWork.repository.WorkApprovalItemStandInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalItemStandInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApprovalItemStandInfoService") +public class WorkApprovalItemStandInfoServiceImpl extends ServiceImpl<WorkApprovalItemStandInfoRepository, WorkApprovalItemStandInfo> implements WorkApprovalItemStandInfoService { + + + @Autowired + private WorkApprovalItemStandInfoRepository workApprovalItemStandInfoRepository; + + + @Override + public void saveBatchStand(List<WorkApprovalItemStandInfo> standEntities) { + if (standEntities == null || standEntities.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalItemStandInfoRepository.insertBatch(standEntities); + if (i != standEntities.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkApprovalItemStandInfo> listWorkApprovalItemStandByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalItemStandInfoRepository.listWorkApprovalItemStandByWorkApplyId(workApplyId); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalRuleInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalRuleInfoServiceImpl.java new file mode 100644 index 0000000..6db6256 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalRuleInfoServiceImpl.java @@ -0,0 +1,30 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalRuleInfo; +import com.gk.hotwork.specialWork.repository.WorkApprovalRuleInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalRuleInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service("workApprovalRuleInfoService") +public class WorkApprovalRuleInfoServiceImpl extends ServiceImpl<WorkApprovalRuleInfoRepository, WorkApprovalRuleInfo> implements WorkApprovalRuleInfoService { + + @Autowired + private WorkApprovalRuleInfoRepository workApprovalRuleInfoRepository; + + + @Override + public void saveRule(WorkApprovalRuleInfo ruleEntity) { + if (ruleEntity == null || ruleEntity.getId() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalRuleInfoRepository.insert(ruleEntity); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalStepInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalStepInfoServiceImpl.java new file mode 100644 index 0000000..b9f2dc4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalStepInfoServiceImpl.java @@ -0,0 +1,83 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkApprovalStepInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalStepResultEnum; +import com.gk.hotwork.specialWork.repository.WorkApprovalStepInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalStepInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("workApprovalStepInfoService") +public class WorkApprovalStepInfoServiceImpl extends ServiceImpl<WorkApprovalStepInfoRepository, WorkApprovalStepInfo> implements WorkApprovalStepInfoService { + + @Autowired + private WorkApprovalStepInfoRepository workApprovalStepInfoRepository; + + @Override + public void saveBatchRuleStep(List<WorkApprovalStepInfo> ruleStepEntities) { + if (ruleStepEntities == null || ruleStepEntities.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalStepInfoRepository.insertBatch(ruleStepEntities); + if (i != ruleStepEntities.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkApprovalStepInfo> listApprovalRuleStepByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalStepInfoRepository.listApprovalRuleStepByWorkApplyId(workApplyId); + } + + @Override + public void updateStatusById(Long stepId, WorkApprovalStepResultEnum result) { + if (stepId == null || result == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalStepInfoRepository.updateStatusById(stepId, result.getResult()); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public void updateFinishApprovalTimeById(Long stepId, LocalDateTime now) { + if (stepId == null || now == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalStepInfoRepository.updateFinishApprovalTimeById(stepId, now); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public void updateStartApprovalTimeById(Long stepId, LocalDateTime now) { + if (stepId == null || now == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalStepInfoRepository.updateStartApprovalTimeById(stepId, now); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalUnitInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalUnitInfoServiceImpl.java new file mode 100644 index 0000000..8cbb2b4 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkApprovalUnitInfoServiceImpl.java @@ -0,0 +1,125 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.specialWork.entity.WorkApprovalUnitInfo; +import com.gk.hotwork.specialWork.enums.WorkApprovalUnitResultEnum; +import com.gk.hotwork.specialWork.repository.WorkApprovalUnitInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkApprovalUnitInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workApprovalUnitInfoService") +public class WorkApprovalUnitInfoServiceImpl extends ServiceImpl<WorkApprovalUnitInfoRepository, WorkApprovalUnitInfo> implements WorkApprovalUnitInfoService { + + @Autowired + private WorkApprovalUnitInfoRepository workApprovalUnitInfoRepository; + + @Override + public void saveBatchRuleUnit(List<WorkApprovalUnitInfo> workApprovalUnitInfos) { + if (workApprovalUnitInfos == null || workApprovalUnitInfos.size() == 0) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalUnitInfoRepository.insertBatch(workApprovalUnitInfos); + if (i != workApprovalUnitInfos.size()) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkApprovalUnitInfo> listApprovalRuleUnitByWorkApplyId(Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalUnitInfoRepository.listApprovalRuleUnitByWorkApplyId(workApplyId); + } + + @Override + public WorkApprovalUnitInfo getWorkApprovalUnitByStepIdAndUid(Long stepId, Long approvalUid) { + if (stepId == null || approvalUid == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + List<WorkApprovalUnitInfo> workApprovalUnitInfos = workApprovalUnitInfoRepository.listWorkApprovalUnitByStepIdAndUid(stepId, approvalUid); + if (workApprovalUnitInfos.size() == 0) { + return null; + } + if (workApprovalUnitInfos.size() > 1) { + throw new BusinessException(ResultCodes.SERVER_DATABASE_DATA_DUPLICATED); + } + return workApprovalUnitInfos.get(0); + } + + @Override + public void updateStatusById(Long unitId, WorkApprovalUnitResultEnum resultStatus) { + if (unitId == null || resultStatus == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalUnitInfoRepository.updateStatusById(unitId, resultStatus.getResult()); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i > 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public List<WorkApprovalUnitInfo> listApprovalRuleUnitByStepId(Long stepId) { + if (stepId == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workApprovalUnitInfoRepository.listApprovalRuleUnitByStepId(stepId); + } + + @Override + public void updateStatusByStepId(Long stepId, WorkApprovalUnitResultEnum result) { + if (stepId == null || result == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + // 不考虑数量 + workApprovalUnitInfoRepository.updateStatusByStepId(stepId, result.getResult()); + } + + @Override + public void updateStatusByIds(List<Long> unitIds, WorkApprovalUnitResultEnum result) { + if (unitIds == null || unitIds.size() == 0 || result == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalUnitInfoRepository.updateStatusByIds(unitIds, result.getResult()); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i != unitIds.size()) { + throw new BusinessException(ResultCodes.SERVER_BATCH_UPDATE_ERROR); + } + } + + @Override + public void updateStatusAndFillContentById(Long unitId, String unitFillContent, WorkApprovalUnitResultEnum result) { + if (unitId == null || StringUtils.isBlank(unitFillContent) || result == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalUnitInfoRepository.updateStatusAndFillContentById(unitId, unitFillContent, result.getResult()); + if (i == 0) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_DATA_NO_CHANGE); + } + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); + } + } + + @Override + public void batchUpdateStatusByIds(List<Long> unitIds, WorkApprovalUnitResultEnum result) { + if (unitIds == null || unitIds.size() == 0 || result == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workApprovalUnitInfoRepository.batchUpdateStatusByIds(unitIds, result.getResult()); + if (i != unitIds.size()) { + throw new BusinessException(ResultCodes.SERVER_BATCH_UPDATE_ERROR); + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkAtHeightInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkAtHeightInfoServiceImpl.java new file mode 100644 index 0000000..45e650d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkAtHeightInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkAtHeightInfo; +import com.gk.hotwork.specialWork.enums.WorkAtHeightStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkAtHeightQuery; +import com.gk.hotwork.specialWork.repository.WorkAtHeightInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkAtHeightInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkAtHeightInfoService") +public class WorkAtHeightInfoServiceImpl extends ServiceImpl<WorkAtHeightInfoRepository, WorkAtHeightInfo> implements WorkAtHeightInfoService { + + /** + * 新增 + * @param workAtHeightInfo + * @return + */ + @Override + public int saveOne(WorkAtHeightInfo workAtHeightInfo) { + workAtHeightInfo.setGmtCreate(LocalDateTime.now()); + workAtHeightInfo.setStatus(WorkAtHeightStatusEnum.VALID.getCode()); + return baseMapper.insert(workAtHeightInfo); + } + + /** + * 修改 + * @param workAtHeightInfo + * @return + */ + @Override + public int updateOne(WorkAtHeightInfo workAtHeightInfo) { + if(null == workAtHeightInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workAtHeightInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workAtHeightInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkAtHeightInfo workAtHeightInfo = new WorkAtHeightInfo(); + workAtHeightInfo.setId(id); + workAtHeightInfo.setStatus(WorkAtHeightStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workAtHeightInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkAtHeightStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkAtHeightInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkAtHeightInfo>() +// .eq(WorkAtHeightInfo::getId,id) +// .eq(WorkAtHeightInfo::getStatus,WorkAtHeightStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkAtHeightInfo> getListByConditions(WorkAtHeightQuery query) { + query.setStatus(WorkAtHeightStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBlindPlatePluggingInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBlindPlatePluggingInfoServiceImpl.java new file mode 100644 index 0000000..3fe1bd0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBlindPlatePluggingInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkBlindPlatePluggingInfo; +import com.gk.hotwork.specialWork.enums.WorkBlindPlatePluggingStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkBlindPlatePluggingQuery; +import com.gk.hotwork.specialWork.repository.WorkBlindPlatePluggingInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkBlindPlatePluggingInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkBlindPlatePluggingInfoService") +public class WorkBlindPlatePluggingInfoServiceImpl extends ServiceImpl<WorkBlindPlatePluggingInfoRepository, WorkBlindPlatePluggingInfo> implements WorkBlindPlatePluggingInfoService { + + /** + * 新增 + * @param workBlindPlatePluggingInfo + * @return + */ + @Override + public int saveOne(WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo) { + workBlindPlatePluggingInfo.setGmtCreate(LocalDateTime.now()); + workBlindPlatePluggingInfo.setStatus(WorkBlindPlatePluggingStatusEnum.VALID.getCode()); + return baseMapper.insert(workBlindPlatePluggingInfo); + } + + /** + * 修改 + * @param workBlindPlatePluggingInfo + * @return + */ + @Override + public int updateOne(WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo) { + if(null == workBlindPlatePluggingInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workBlindPlatePluggingInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workBlindPlatePluggingInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo = new WorkBlindPlatePluggingInfo(); + workBlindPlatePluggingInfo.setId(id); + workBlindPlatePluggingInfo.setStatus(WorkBlindPlatePluggingStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workBlindPlatePluggingInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkBlindPlatePluggingStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkBlindPlatePluggingInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkBlindPlatePluggingInfo>() +// .eq(WorkBlindPlatePluggingInfo::getId,id) +// .eq(WorkBlindPlatePluggingInfo::getStatus,WorkBlindPlatePluggingStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkBlindPlatePluggingInfo> getListByConditions(WorkBlindPlatePluggingQuery query) { + query.setStatus(WorkBlindPlatePluggingStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBrokenCircuitInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBrokenCircuitInfoServiceImpl.java new file mode 100644 index 0000000..864c5ee --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkBrokenCircuitInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkBrokenCircuitInfo; +import com.gk.hotwork.specialWork.enums.WorkBrokenCircuitStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkBrokenCircuitQuery; +import com.gk.hotwork.specialWork.repository.WorkBrokenCircuitInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkBrokenCircuitInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkBrokenCircuitInfoService") +public class WorkBrokenCircuitInfoServiceImpl extends ServiceImpl<WorkBrokenCircuitInfoRepository, WorkBrokenCircuitInfo> implements WorkBrokenCircuitInfoService { + + /** + * 新增 + * @param workBrokenCircuitInfo + * @return + */ + @Override + public int saveOne(WorkBrokenCircuitInfo workBrokenCircuitInfo) { + workBrokenCircuitInfo.setGmtCreate(LocalDateTime.now()); + workBrokenCircuitInfo.setStatus(WorkBrokenCircuitStatusEnum.VALID.getCode()); + return baseMapper.insert(workBrokenCircuitInfo); + } + + /** + * 修改 + * @param workBrokenCircuitInfo + * @return + */ + @Override + public int updateOne(WorkBrokenCircuitInfo workBrokenCircuitInfo) { + if(null == workBrokenCircuitInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workBrokenCircuitInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workBrokenCircuitInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkBrokenCircuitInfo workBrokenCircuitInfo = new WorkBrokenCircuitInfo(); + workBrokenCircuitInfo.setId(id); + workBrokenCircuitInfo.setStatus(WorkBrokenCircuitStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workBrokenCircuitInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkBrokenCircuitStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkBrokenCircuitInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkBrokenCircuitInfo>() +// .eq(WorkBrokenCircuitInfo::getId,id) +// .eq(WorkBrokenCircuitInfo::getStatus,WorkBrokenCircuitStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkBrokenCircuitInfo> getListByConditions(WorkBrokenCircuitQuery query) { + query.setStatus(WorkBrokenCircuitStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkConfinedSpaceInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkConfinedSpaceInfoServiceImpl.java new file mode 100644 index 0000000..3c0a3a3 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkConfinedSpaceInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkConfinedSpaceInfo; +import com.gk.hotwork.specialWork.enums.WorkConfinedSpaceStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkConfinedSpaceQuery; +import com.gk.hotwork.specialWork.repository.WorkConfinedSpaceInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkConfinedSpaceInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkConfinedSpaceInfoService") +public class WorkConfinedSpaceInfoServiceImpl extends ServiceImpl<WorkConfinedSpaceInfoRepository, WorkConfinedSpaceInfo> implements WorkConfinedSpaceInfoService { + + /** + * 新增 + * @param workConfinedSpaceInfo + * @return + */ + @Override + public int saveOne(WorkConfinedSpaceInfo workConfinedSpaceInfo) { + workConfinedSpaceInfo.setGmtCreate(LocalDateTime.now()); + workConfinedSpaceInfo.setStatus(WorkConfinedSpaceStatusEnum.VALID.getCode()); + return baseMapper.insert(workConfinedSpaceInfo); + } + + /** + * 修改 + * @param workConfinedSpaceInfo + * @return + */ + @Override + public int updateOne(WorkConfinedSpaceInfo workConfinedSpaceInfo) { + if(null == workConfinedSpaceInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workConfinedSpaceInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workConfinedSpaceInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkConfinedSpaceInfo workConfinedSpaceInfo = new WorkConfinedSpaceInfo(); + workConfinedSpaceInfo.setId(id); + workConfinedSpaceInfo.setStatus(WorkConfinedSpaceStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workConfinedSpaceInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkConfinedSpaceStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkConfinedSpaceInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkConfinedSpaceInfo>() +// .eq(WorkConfinedSpaceInfo::getId,id) +// .eq(WorkConfinedSpaceInfo::getStatus,WorkConfinedSpaceStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkConfinedSpaceInfo> getListByConditions(WorkConfinedSpaceQuery query) { + query.setStatus(WorkConfinedSpaceStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkGroundBreakingInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkGroundBreakingInfoServiceImpl.java new file mode 100644 index 0000000..116a6d9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkGroundBreakingInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkGroundBreakingInfo; +import com.gk.hotwork.specialWork.enums.WorkGroundBreakingStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkGroundBreakingQuery; +import com.gk.hotwork.specialWork.repository.WorkGroundBreakingInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkGroundBreakingInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkGroundBreakingInfoService") +public class WorkGroundBreakingInfoServiceImpl extends ServiceImpl<WorkGroundBreakingInfoRepository, WorkGroundBreakingInfo> implements WorkGroundBreakingInfoService { + + /** + * 新增 + * @param workGroundBreakingInfo + * @return + */ + @Override + public int saveOne(WorkGroundBreakingInfo workGroundBreakingInfo) { + workGroundBreakingInfo.setGmtCreate(LocalDateTime.now()); + workGroundBreakingInfo.setStatus(WorkGroundBreakingStatusEnum.VALID.getCode()); + return baseMapper.insert(workGroundBreakingInfo); + } + + /** + * 修改 + * @param workGroundBreakingInfo + * @return + */ + @Override + public int updateOne(WorkGroundBreakingInfo workGroundBreakingInfo) { + if(null == workGroundBreakingInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workGroundBreakingInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workGroundBreakingInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkGroundBreakingInfo workGroundBreakingInfo = new WorkGroundBreakingInfo(); + workGroundBreakingInfo.setId(id); + workGroundBreakingInfo.setStatus(WorkGroundBreakingStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workGroundBreakingInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkGroundBreakingStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkGroundBreakingInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkGroundBreakingInfo>() +// .eq(WorkGroundBreakingInfo::getId,id) +// .eq(WorkGroundBreakingInfo::getStatus,WorkGroundBreakingStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkGroundBreakingInfo> getListByConditions(WorkGroundBreakingQuery query) { + query.setStatus(WorkGroundBreakingStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHoistingInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHoistingInfoServiceImpl.java new file mode 100644 index 0000000..ae91237 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHoistingInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkHoistingInfo; +import com.gk.hotwork.specialWork.enums.WorkHoistingStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkHoistingQuery; +import com.gk.hotwork.specialWork.repository.WorkHoistingInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkHoistingInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkHoistingInfoService") +public class WorkHoistingInfoServiceImpl extends ServiceImpl<WorkHoistingInfoRepository, WorkHoistingInfo> implements WorkHoistingInfoService { + + /** + * 新增 + * @param workHoistingInfo + * @return + */ + @Override + public int saveOne(WorkHoistingInfo workHoistingInfo) { + workHoistingInfo.setGmtCreate(LocalDateTime.now()); + workHoistingInfo.setStatus(WorkHoistingStatusEnum.VALID.getCode()); + return baseMapper.insert(workHoistingInfo); + } + + /** + * 修改 + * @param workHoistingInfo + * @return + */ + @Override + public int updateOne(WorkHoistingInfo workHoistingInfo) { + if(null == workHoistingInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workHoistingInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workHoistingInfo); + } + + /** + * 删除-单条 + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkHoistingInfo workHoistingInfo = new WorkHoistingInfo(); + workHoistingInfo.setId(id); + workHoistingInfo.setStatus(WorkHoistingStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workHoistingInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList, WorkHoistingStatusEnum.ABANDONED.getCode()); + } + + + /** + * 根据id获取单条数据 + * @param id + * @return + */ +// @Override +// public WorkHoistingInfo getById(Long id) { +// if(null == id){ +// throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); +// } +// return baseMapper.selectOne(new LambdaQueryWrapper<WorkHoistingInfo>() +// .eq(WorkHoistingInfo::getId,id) +// .eq(WorkHoistingInfo::getStatus,WorkHoistingStatusEnum.VALID.getCode()) +// ); +// } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkHoistingInfo> getListByConditions(WorkHoistingQuery query) { + query.setStatus(WorkHoistingStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHotInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHotInfoServiceImpl.java new file mode 100644 index 0000000..4b4ee4c --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkHotInfoServiceImpl.java @@ -0,0 +1,77 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkHotInfo; +import com.gk.hotwork.specialWork.enums.WorkHotStatusEnum; +import com.gk.hotwork.specialWork.model.query.db.WorkHotQuery; +import com.gk.hotwork.specialWork.repository.WorkHotInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkHotInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkHotInfoService") +public class WorkHotInfoServiceImpl extends ServiceImpl<WorkHotInfoRepository, WorkHotInfo> implements WorkHotInfoService { + /** + * 新增 + */ + @Override + public int saveOne(WorkHotInfo workHotInfo){ + workHotInfo.setGmtCreate(LocalDateTime.now()); + workHotInfo.setStatus(WorkHotStatusEnum.VALID.getCode()); + return baseMapper.insert(workHotInfo); + } + + /** + * 更新 + * @param workHotInfo + * @return + */ + @Override + public int updateOne(WorkHotInfo workHotInfo){ + if(null == workHotInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workHotInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workHotInfo); + } + + /** + * 删除 - 单条 + * @param id + * @return + */ + @Override + public int updateOneStatus(Long id){ + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateOneStatus(id,WorkHotStatusEnum.ABANDONED.getCode()); + } + + /** + * 删除 - 批量 + * @param ids + * @return + */ + @Override + public int batchUpdateStatus(List<Long> ids){ + if(ids.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.batchUpdateStatus(ids, WorkHotStatusEnum.ABANDONED.getCode()); + } + + /** + * 列表 + */ + @Override + public List<WorkHotInfo> listWorkHot(WorkHotQuery query){ + query.setStatus(WorkHotStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessDetectionInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessDetectionInfoServiceImpl.java new file mode 100644 index 0000000..219bd34 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessDetectionInfoServiceImpl.java @@ -0,0 +1,42 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessDetectionPageDBQuery; +import com.gk.hotwork.specialWork.repository.WorkProcessDetectionInfoRepository; + +import com.gk.hotwork.specialWork.service.baseService.WorkProcessDetectionInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workProcessDetectionInfoService") +public class WorkProcessDetectionInfoServiceImpl extends ServiceImpl<WorkProcessDetectionInfoRepository, WorkProcessDetectionInfo> implements WorkProcessDetectionInfoService { + + @Autowired + private WorkProcessDetectionInfoRepository workProcessDetectionInfoRepository; + + @Override + public void saveWorkProcessDetectionInfo(WorkProcessDetectionInfo detectionEntity) { + if (detectionEntity == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workProcessDetectionInfoRepository.insertWorkProcessDetectionInfo(detectionEntity); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } + + @Override + public List<WorkProcessDetectionInfo> listWorkDetectionInfoByPage(Page<WorkProcessDetectionInfo> page, WorkProcessDetectionPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workProcessDetectionInfoRepository.listWorkDetectionInfoByPage(page,dbQuery); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessWarningInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessWarningInfoServiceImpl.java new file mode 100644 index 0000000..f959190 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkProcessWarningInfoServiceImpl.java @@ -0,0 +1,41 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWarningPageDBQuery; +import com.gk.hotwork.specialWork.repository.WorkProcessWarningInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkProcessWarningInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("workProcessWarningInfoService") +public class WorkProcessWarningInfoServiceImpl extends ServiceImpl<WorkProcessWarningInfoRepository, WorkProcessWarningInfo> implements WorkProcessWarningInfoService { + + @Autowired + private WorkProcessWarningInfoRepository workProcessWarningInfoRepository; + + + @Override + public List<WorkProcessWarningInfo> listWorkProcessWarningInfoByPage(Page<WorkProcessWarningInfo> page, WorkProcessWarningPageDBQuery dbQuery) { + if (page == null || dbQuery == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + return workProcessWarningInfoRepository.listWorkProcessWarningInfoByPage(page,dbQuery); + } + + @Override + public void saveWorkProcessWarningInfo(WorkProcessWarningInfo warningInfo) { + if (warningInfo == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + int i = workProcessWarningInfoRepository.insertWorkProcessWarningInfo(warningInfo); + if (i != 1) { + throw new BusinessException(ResultCodes.SERVER_ADD_ERROR); + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkTemporaryPowerInfoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkTemporaryPowerInfoServiceImpl.java new file mode 100644 index 0000000..1df7f51 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/baseService/impl/WorkTemporaryPowerInfoServiceImpl.java @@ -0,0 +1,103 @@ +package com.gk.hotwork.specialWork.service.baseService.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.specialWork.entity.WorkTemporaryPowerInfo; +import com.gk.hotwork.specialWork.enums.WorkTemporaryPowerStatusEnum; +import com.gk.hotwork.specialWork.model.query.WorkTemporaryPowerQuery; +import com.gk.hotwork.specialWork.repository.WorkTemporaryPowerInfoRepository; +import com.gk.hotwork.specialWork.service.baseService.WorkTemporaryPowerInfoService; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service("WorkTemporaryPowerInfoService") +public class WorkTemporaryPowerInfoServiceImpl extends ServiceImpl<WorkTemporaryPowerInfoRepository, WorkTemporaryPowerInfo> implements WorkTemporaryPowerInfoService { + + /** + * 新增 + * @param workTemporaryPowerInfo + * @return + */ + @Override + public int saveOne(WorkTemporaryPowerInfo workTemporaryPowerInfo) { + workTemporaryPowerInfo.setGmtCreate(LocalDateTime.now()); + workTemporaryPowerInfo.setStatus(WorkTemporaryPowerStatusEnum.VALID.getCode()); + return baseMapper.insert(workTemporaryPowerInfo); + } + + /** + * 修改 + * @param workTemporaryPowerInfo + * @return + */ + @Override + public int updateOne(WorkTemporaryPowerInfo workTemporaryPowerInfo) { + if(null == workTemporaryPowerInfo.getId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + workTemporaryPowerInfo.setGmtModified(LocalDateTime.now()); + return baseMapper.updateById(workTemporaryPowerInfo); + } + + /** + * 删除-单条+ + * + * @param id + * @return + */ + + @Override + public int updateStatusById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkTemporaryPowerInfo workTemporaryPowerInfo = new WorkTemporaryPowerInfo(); + workTemporaryPowerInfo.setId(id); + workTemporaryPowerInfo.setStatus(WorkTemporaryPowerStatusEnum.ABANDONED.getCode()); + return baseMapper.updateById(workTemporaryPowerInfo); + } + + /** + * 批量删除 + * @param idList + * @return + */ + @Override + public int updateStatutsByIds(List<Long> idList) { + if(null == idList || idList.size() == 0){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.updateStatutsByIds(idList,WorkTemporaryPowerStatusEnum.ABANDONED.getCode()); + } + + /** + * 根据id获取单条数据 + * @param id + * @return + */ + @Override + public WorkTemporaryPowerInfo getWorkTemporaryPowerInfoById(Long id) { + if(null == id){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + return baseMapper.selectOne(new LambdaQueryWrapper<WorkTemporaryPowerInfo>() + .eq(WorkTemporaryPowerInfo::getId,id) + .eq(WorkTemporaryPowerInfo::getStatus,WorkTemporaryPowerStatusEnum.VALID.getCode()) + ); + } + + /** + * 条件查询 + * @param query + * @return + */ + @Override + public List<WorkTemporaryPowerInfo> getListByConditions(WorkTemporaryPowerQuery query) { + query.setStatus(WorkTemporaryPowerStatusEnum.VALID.getCode()); + return baseMapper.listByConditions(query); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/ApprovalWorkRocketMQServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/ApprovalWorkRocketMQServiceImpl.java new file mode 100644 index 0000000..a380aa6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/ApprovalWorkRocketMQServiceImpl.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.specialWork.service.ApprovalWorkRocketMQService; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.support.TransactionSynchronizationAdapter; + +/** + * 发送作业审批消息 + */ +@Service +public class ApprovalWorkRocketMQServiceImpl implements ApprovalWorkRocketMQService { + + private Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.approvalSpecialWorkTopic}") + private String approvalSpecialWorkTopic; + @Autowired + private RocketMQTemplate rocketMQTemplate; + + /** + * 事务提交后发送MQ + * @param message + * @param <T> + */ + public <T> void syncSend(T message) { + // 是否开启事务判断 + if (org.springframework.transaction.support.TransactionSynchronizationManager.isSynchronizationActive()) { + org.springframework.transaction.support.TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override + public void afterCommit() { + SendResult sendResult = rocketMQTemplate.syncSend(approvalSpecialWorkTopic, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + logger.error("【特殊作业】审批作业发送rocketMQ消息失败!"+message); + }else { + logger.info("【特殊作业】审批作业发送rocketMQ消息成功!"+message); + } + } + }); + } else { + SendResult sendResult = rocketMQTemplate.syncSend(approvalSpecialWorkTopic, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + logger.error("【特殊作业】审批作业发送rocketMQ消息失败!"+message); + }else { + logger.info("【特殊作业】审批作业发送rocketMQ消息成功!"+message); + } + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleItemServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleItemServiceImpl.java new file mode 100644 index 0000000..355186a --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleItemServiceImpl.java @@ -0,0 +1,338 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItem; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnitItemDO; +import com.gk.hotwork.specialWork.enums.RuleItemStandStatusEnum; +import com.gk.hotwork.specialWork.enums.RuleItemStatusEnum; +import com.gk.hotwork.specialWork.enums.RuleItemTypeEnum; +import com.gk.hotwork.specialWork.enums.WorkStandTypeEnum; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleItemModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleStandListRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemListRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemPageRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemPageQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleItemQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import com.gk.hotwork.specialWork.service.RuleItemService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleStandService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleUnitItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("ruleItemService") +public class RuleItemServiceImpl implements RuleItemService { + + @Autowired + private ApprovalRuleUnitItemService approvalRuleUnitItemService; + + @Autowired + private ApprovalRuleStandService approvalRuleStandService; + + @Override + public void saveRuleItem(ContextCacheUser currentUser, ApprovalRuleItemAddReqDTO addReqDTO) { + ; + if (addReqDTO.getItemStandId() == null || addReqDTO.getItemType() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (StringUtils.isBlank(addReqDTO.getItemName())) { + throw new BusinessException(E.DATA_PARAM_NULL, "填报项名称不可为空"); + } + // 填报类型判断 + RuleItemTypeEnum typeEnum = RuleItemTypeEnum.parse(addReqDTO.getItemType()); + if (typeEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "填报项类型校验非法"); + } + // 判断填报项标准是否存在 + ApprovalRuleItemStandDO ruleItemStand = approvalRuleStandService.getRuleStandDOById(addReqDTO.getItemStandId()); + if (ruleItemStand == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "填报项标准不存在"); + } + if (!ruleItemStand.getStatus().equals(RuleItemStandStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID, "填报项标准不存在"); + } + // 1.新增审批项 + ApprovalRuleUnitItem itemEntity = new ApprovalRuleUnitItem(); + itemEntity.setItemName(addReqDTO.getItemName().trim()); + itemEntity.setType(addReqDTO.getItemType()); + itemEntity.setStandId(addReqDTO.getItemStandId()); + itemEntity.setGmtCreate(LocalDateTime.now()); + itemEntity.setCreateUid(currentUser.getUid()); + itemEntity.setCreateUname(currentUser.getRealName()); + itemEntity.setStatus(RuleItemStatusEnum.VALID.getCode()); + approvalRuleUnitItemService.saveRuleItem(itemEntity); + } + + @Override + public void updateRuleItem(ContextCacheUser currentUser, ApprovalRuleItemModReqDTO modReqDTO) { + ; + if (modReqDTO.getItemId() == null || + modReqDTO.getItemType() == null || + modReqDTO.getItemStandId() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (StringUtils.isBlank(modReqDTO.getItemName())) { + throw new BusinessException(E.DATA_PARAM_NULL, "填报项名称不可为空"); + } + // 填报类型判断 + RuleItemTypeEnum typeEnum = RuleItemTypeEnum.parse(modReqDTO.getItemType()); + if (typeEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "填报项类型校验非法"); + } + ApprovalRuleUnitItemDO item = approvalRuleUnitItemService.getApprovalRuleUnitItemDOById(modReqDTO.getItemId()); + if (item == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "填报项不存在"); + } + if (!item.getStatus().equals(RuleItemStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID, "填报项不存在"); + } + // 判断填报项标准是否存在 + ApprovalRuleItemStandDO ruleItemStand = approvalRuleStandService.getRuleStandDOById(modReqDTO.getItemStandId()); + if (ruleItemStand == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "填报项标准不存在"); + } + if (!ruleItemStand.getStatus().equals(RuleItemStandStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID, "填报项标准不存在"); + } + + // 1.更新审批项 + ApprovalRuleUnitItem itemEntity = new ApprovalRuleUnitItem(); + itemEntity.setId(modReqDTO.getItemId()); + itemEntity.setItemName(modReqDTO.getItemName()); + itemEntity.setType(modReqDTO.getItemType()); + itemEntity.setGmtModified(LocalDateTime.now()); + itemEntity.setModifiedUname(currentUser.getRealName()); + itemEntity.setModifiedUid(currentUser.getUid()); + approvalRuleUnitItemService.updateRuleItem(itemEntity); + } + + @Override + public void deleteRuleItem(ContextCacheUser currentUser, DeleteForm deleteForm) { + ; + if (deleteForm.getIds() == null) { + throw new BusinessException(ResultCodes.SERVER_PARAM_NULL); + } + if (deleteForm.getIds().size() > 10) { + throw new BusinessException(ResultCodes.SERVER_DEL_OVER_SIZE); + } + // 1.id合法 + for (Long ruleItemId : deleteForm.getIds()) { + ApprovalRuleUnitItemDO ruleUnitItemDO = approvalRuleUnitItemService.getApprovalRuleUnitItemDOById(ruleItemId); + if (ruleUnitItemDO == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "填报项不存在"); + } + if (!ruleUnitItemDO.getStatus().equals(RuleItemStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID, "填报项不存在"); + } + // 2.todo 是否被占用 + } + EntityStatusBatchUO entityBatchDeleteObject = new EntityStatusBatchUO(); + entityBatchDeleteObject.setIds(deleteForm.getIds()); + entityBatchDeleteObject.setModifiedUid(currentUser.getUid()); + entityBatchDeleteObject.setModifiedUname(currentUser.getRealName()); + entityBatchDeleteObject.setGmtModified(LocalDateTime.now()); + approvalRuleUnitItemService.deleteBatch(entityBatchDeleteObject); + + } + + @Override + public SearchResultVO<List<ApprovalRuleUnitItemPageRespDTO>> listRuleItemByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleItemPageQuery> pageQuery) { + ; + // 查询对象 + ApprovalRuleItemPageDBQuery dbQuery = new ApprovalRuleItemPageDBQuery(); + if (pageQuery.getSearchParams() != null) { + dbQuery.setItemName(pageQuery.getSearchParams().getItemName()); + dbQuery.setItemStandId(pageQuery.getSearchParams().getItemStandId()); + dbQuery.setItemType(pageQuery.getSearchParams().getItemType()); + dbQuery.setStatus(RuleItemStatusEnum.VALID.getCode()); + } + // 分页对象 + Page<ApprovalRuleUnitItem> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<ApprovalRuleUnitItem> dbData = approvalRuleUnitItemService.listRuleItemByPage(page, dbQuery); + + List<ApprovalRuleUnitItemPageRespDTO> respDTOs = new ArrayList<>(dbData.size()); + ApprovalRuleUnitItemPageRespDTO respDTO; + RuleItemTypeEnum itemTypeEnum; + RuleItemStatusEnum statusEnum; + RuleItemStandStatusEnum standStatusEnum; + WorkStandTypeEnum standTypeEnum; + ApprovalRuleItemStandDO ruleStandDO; + Map<Long, ApprovalRuleStandListRespDTO> standPool = null; + if (pageQuery.getSearchParams().isContainItemStandEnable()) { + standPool = new HashMap<>(); + } + if (dbData.size() > 0) { + for (ApprovalRuleUnitItem item : dbData) { + respDTO = new ApprovalRuleUnitItemPageRespDTO(); + respDTO.setItemId(item.getId()); + respDTO.setItemName(item.getItemName()); + respDTO.setItemStandId(item.getStandId()); + respDTO.setRuleId(item.getRuleId()); + respDTO.setStepId(item.getStepId()); + respDTO.setUnitId(item.getUnitId()); + respDTO.setCreateUid(item.getCreateUid()); + respDTO.setCreateUname(item.getCreateUname()); + respDTO.setGmtCreate(item.getGmtCreate()); + respDTO.setModifiedUid(item.getModifiedUid()); + respDTO.setModifiedUname(item.getModifiedUname()); + respDTO.setGmtModified(item.getGmtModified()); + respDTO.setItemType(item.getType()); + respDTO.setStatus(item.getStatus()); + itemTypeEnum = RuleItemTypeEnum.parse(item.getType()); + if (itemTypeEnum != null) { + respDTO.setItemTypeDesc(itemTypeEnum.getValue()); + } + statusEnum = RuleItemStatusEnum.parse(item.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getValue()); + } + + // 是否包含审批项标准 + if (pageQuery.getSearchParams().isContainItemStandEnable()) { + assert standPool != null; + if (item.getStandId() != null) { + if (!standPool.containsKey(item.getStandId())) { + ruleStandDO = approvalRuleStandService.getRuleStandDOById(item.getStandId()); + if (ruleStandDO != null && ruleStandDO.getStatus().equals(RuleItemStatusEnum.VALID.getCode())) { + ApprovalRuleStandListRespDTO standListRespDTO = new ApprovalRuleStandListRespDTO(); + standListRespDTO.setRuleStandId(ruleStandDO.getId()); + standListRespDTO.setRuleStandType(ruleStandDO.getType()); + standListRespDTO.setTitle(ruleStandDO.getTitle()); + standListRespDTO.setMinVal(ruleStandDO.getMinVal()); + standListRespDTO.setMinValMatchPattern(ruleStandDO.getMinValMatchPattern()); + standListRespDTO.setMaxVal(ruleStandDO.getMaxVal()); + standListRespDTO.setMaxValMatchPattern(ruleStandDO.getMaxValMatchPattern()); + standListRespDTO.setStatus(ruleStandDO.getStatus()); + standStatusEnum = RuleItemStandStatusEnum.parse(ruleStandDO.getStatus()); + if (standStatusEnum != null) { + standListRespDTO.setStatusDesc(standStatusEnum.getValue()); + } + standTypeEnum = WorkStandTypeEnum.parse(ruleStandDO.getType()); + if (standTypeEnum != null) { + standListRespDTO.setRuleStandTypeDesc(standTypeEnum.getDesc()); + } + standPool.put(item.getStandId(), standListRespDTO); + } + respDTO.setItemStand(standPool.get(item.getStandId())); + + } + } + } + + + respDTOs.add(respDTO); + } + } + + return new SearchResultVO<>( + true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respDTOs, + ResultCodes.OK); + } + + @Override + public List<ApprovalRuleUnitItemListRespDTO> listRuleItem(ContextCacheUser currentUser, ApprovalRuleItemQuery query) { + ; + ApprovalRuleItemDBQuery dbQuery = new ApprovalRuleItemDBQuery(); + dbQuery.setItemName(query.getItemName()); + dbQuery.setItemStandId(query.getItemStandId()); + dbQuery.setItemType(query.getItemType()); + dbQuery.setStatus(RuleItemStatusEnum.VALID.getCode()); + // db查询 + List<ApprovalRuleUnitItemDO> dbData = approvalRuleUnitItemService.listRuleItem(dbQuery); + List<ApprovalRuleUnitItemListRespDTO> respDTOs = new ArrayList<>(dbData.size()); + ApprovalRuleUnitItemListRespDTO respDTO; + RuleItemTypeEnum itemTypeEnum; + RuleItemStatusEnum statusEnum; + RuleItemStandStatusEnum standStatusEnum; + WorkStandTypeEnum standTypeEnum; + ApprovalRuleItemStandDO ruleStandDO; + Map<Long, ApprovalRuleStandListRespDTO> standPool = null; + if (query.isContainItemStandEnable()) { + standPool = new HashMap<>(); + } + if (dbData.size() > 0) { + for (ApprovalRuleUnitItemDO itemDO : dbData) { + respDTO = new ApprovalRuleUnitItemListRespDTO(); + respDTO.setItemId(itemDO.getId()); + respDTO.setItemName(itemDO.getItemName()); + respDTO.setItemStandId(itemDO.getStandId()); + respDTO.setRuleId(itemDO.getRuleId()); + respDTO.setStepId(itemDO.getStepId()); + respDTO.setUnitId(itemDO.getUnitId()); + respDTO.setItemType(itemDO.getType()); + respDTO.setStatus(itemDO.getStatus()); + itemTypeEnum = RuleItemTypeEnum.parse(itemDO.getType()); + if (itemTypeEnum != null) { + respDTO.setItemTypeDesc(itemTypeEnum.getValue()); + } + statusEnum = RuleItemStatusEnum.parse(itemDO.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getValue()); + } + + // 是否包含审批项标准 + if (query.isContainItemStandEnable()) { + assert standPool != null; + if (itemDO.getStandId() != null) { + if (!standPool.containsKey(itemDO.getStandId())) { + ruleStandDO = approvalRuleStandService.getRuleStandDOById(itemDO.getStandId()); + if (ruleStandDO != null && ruleStandDO.getStatus().equals(RuleItemStatusEnum.VALID.getCode())) { + ApprovalRuleStandListRespDTO standListRespDTO = new ApprovalRuleStandListRespDTO(); + standListRespDTO.setRuleStandId(ruleStandDO.getId()); + standListRespDTO.setRuleStandType(ruleStandDO.getType()); + standListRespDTO.setTitle(ruleStandDO.getTitle()); + standListRespDTO.setMinVal(ruleStandDO.getMinVal()); + standListRespDTO.setMinValMatchPattern(ruleStandDO.getMinValMatchPattern()); + standListRespDTO.setMaxVal(ruleStandDO.getMaxVal()); + standListRespDTO.setMaxValMatchPattern(ruleStandDO.getMaxValMatchPattern()); + standListRespDTO.setStatus(ruleStandDO.getStatus()); + standStatusEnum = RuleItemStandStatusEnum.parse(ruleStandDO.getStatus()); + if (standStatusEnum != null) { + standListRespDTO.setStatusDesc(standStatusEnum.getValue()); + } + standTypeEnum = WorkStandTypeEnum.parse(ruleStandDO.getType()); + if (standTypeEnum != null) { + standListRespDTO.setRuleStandTypeDesc(standTypeEnum.getDesc()); + } + standPool.put(itemDO.getStandId(), standListRespDTO); + } + respDTO.setItemStand(standPool.get(itemDO.getStandId())); + + } + } + } + + + + respDTOs.add(respDTO); + } + } + return respDTOs; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleMeasureServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleMeasureServiceImpl.java new file mode 100644 index 0000000..48c81df --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleMeasureServiceImpl.java @@ -0,0 +1,143 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemMeasure; +import com.gk.hotwork.specialWork.enums.MeasureTypeEnum; +import com.gk.hotwork.specialWork.enums.RuleMeasureOptEnum; +import com.gk.hotwork.specialWork.enums.WorkTypeEnum; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasurePageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleMeasureRespDTO; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleItemMeasureQuery; +import com.gk.hotwork.specialWork.service.RuleMeasureService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleItemMeasureService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleUnitItemService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service("ruleMeasureServiceImpl") +public class RuleMeasureServiceImpl implements RuleMeasureService { + + @Autowired + private ApprovalRuleItemMeasureService approvalRuleItemMeasureService; + @Autowired + private ApprovalRuleUnitItemService approvalRuleUnitItemService; + @Override + public ResultVO saveMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureAddReqDTO addReqDTO) { + if (!WorkTypeEnum.checkWorkType(addReqDTO.getWorkType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"作业类型不合法!"); + } + if(!MeasureTypeEnum.checkMeasureType(addReqDTO.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型不合法!"); + } + + ApprovalRuleItemMeasure measure = new ApprovalRuleItemMeasure(); + //如果是选择类型,正确值就不能为空 + if(addReqDTO.getType().equals(MeasureTypeEnum.TYPE_CHOSE.getType())){ + if(null == RuleMeasureOptEnum.parse(addReqDTO.getCorrectVal())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"正确值不合法!"); + } + measure.setCorrectVal(addReqDTO.getCorrectVal()); + } + measure.setContext(addReqDTO.getContext()); + measure.setWorkType(addReqDTO.getWorkType()); + measure.setType(addReqDTO.getType()); + measure.setCreateUid(currentUser.getUid()); + measure.setCreateUname(currentUser.getUsername()); + int i = approvalRuleItemMeasureService.saveOne(measure); + if(i > 0){ + return new ResultVO(ResultCodes.OK); + } + return new ResultVO(ResultCodes.SERVER_ADD_ERROR); + } + + @Override + public ResultVO modMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureModReqDTO modReqDTO) { + if (!WorkTypeEnum.checkWorkType(modReqDTO.getWorkType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"作业类型不合法!"); + } + if(!MeasureTypeEnum.checkMeasureType(modReqDTO.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型不合法!"); + } + ApprovalRuleItemMeasure measure = new ApprovalRuleItemMeasure(); + + //如果是选择类型,正确值就不能为空 + if(modReqDTO.getType().equals(MeasureTypeEnum.TYPE_CHOSE.getType())){ + if(null == RuleMeasureOptEnum.parse(modReqDTO.getCorrectVal())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"正确值不合法!"); + + } + measure.setCorrectVal(modReqDTO.getCorrectVal()); + } + measure.setId(modReqDTO.getId()); + measure.setContext(modReqDTO.getContext()); + measure.setWorkType(modReqDTO.getWorkType()); + measure.setType(modReqDTO.getType()); + measure.setModifiedUid(currentUser.getUid()); + measure.setModifiedUname(currentUser.getUsername()); + int i = approvalRuleItemMeasureService.updateOne(measure); + if(i > 0){ + return new ResultVO(ResultCodes.OK); + } + return new ResultVO(ResultCodes.SERVER_UPDATE_ERROR); + } + + @Override + public ResultVO deleteByIds(ContextCacheUser currentUser, DeleteForm deleteForm) { + //判断是否被审批项绑定 + int count = approvalRuleUnitItemService.countByMeasureIds(deleteForm.getIds()); + if(count > 0){ + throw new BusinessException(E.DATA_BING_RELATION,"存在安全措施被审批项绑定,不可删除!"); + } + int i = approvalRuleItemMeasureService.updateStatusByIds(deleteForm.getIds()); + if(i > 0){ + return new ResultVO(ResultCodes.OK); + } + return new ResultVO(ResultCodes.SERVER_DEL_ERROR); + } + + @Override + public ResultVO<List<ApprovalRuleMeasureRespDTO>> listMeasure(ContextCacheUser currentUser, ApprovalRuleItemMeasureQuery query) { + List<ApprovalRuleItemMeasure> list = approvalRuleItemMeasureService.list(query); + List<ApprovalRuleMeasureRespDTO> respList = new ArrayList<>(); + list.forEach(measure -> { + ApprovalRuleMeasureRespDTO respDTO = new ApprovalRuleMeasureRespDTO(); + BeanUtils.copyProperties(measure,respDTO); + respList.add(respDTO); + }); + return new ResultVO<>(ResultCodes.OK,respList); + } + + @Override + public SearchResultVO<List<ApprovalRuleMeasurePageRespDTO>> listMeasureByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleItemMeasureQuery> query) { + + Page<ApprovalRuleItemMeasure> page = new Page<>(query.getPageIndex(), query.getPageSize()); + List<ApprovalRuleItemMeasure> list = approvalRuleItemMeasureService.listBypage(page,query.getSearchParams()); + List<ApprovalRuleMeasurePageRespDTO> respList = new ArrayList<>(); + list.forEach(measure -> { + ApprovalRuleMeasurePageRespDTO respDTO = new ApprovalRuleMeasurePageRespDTO(); + BeanUtils.copyProperties(measure,respDTO); + respList.add(respDTO); + }); + return new SearchResultVO<>( + true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respList, + ResultCodes.OK); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleServiceImpl.java new file mode 100644 index 0000000..b9a7e73 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleServiceImpl.java @@ -0,0 +1,884 @@ +package com.gk.hotwork.specialWork.service.impl; + +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.dto.UserInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.entity.ApprovalRule; +import com.gk.hotwork.specialWork.entity.ApprovalRuleStep; +import com.gk.hotwork.specialWork.entity.ApprovalRuleUnit; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.enums.ApprovalStepTypeEnum; +import com.gk.hotwork.specialWork.enums.RuleContinueTimeUnitEnum; +import com.gk.hotwork.specialWork.enums.WorkTypeEnum; +import com.gk.hotwork.specialWork.model.bo.ApprovalRuleBO; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleStepRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitItemRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleUnitRespDTO; +import com.gk.hotwork.specialWork.model.query.db.*; +import com.gk.hotwork.specialWork.service.RuleService; +import com.gk.hotwork.specialWork.service.baseService.*; +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + + +@Service("ruleService") +public class RuleServiceImpl implements RuleService { + + @Autowired + private ApprovalRuleService approvalRuleService; + + @Autowired + private ApprovalRuleStepService approvalRuleStepService; + + @Autowired + private ApprovalRuleUnitItemService approvalRuleUnitItemService; + + @Autowired + private ApprovalRuleUnitService approvalRuleUnitService; + + @Autowired + private ApprovalRuleStandService approvalRuleStandService; + + @Autowired + private ApprovalRuleItemMeasureService approvalRuleItemMeasureService; + + @Autowired + private RedissonClient redissonClient; + + @Autowired + private AccountAuthService accountUserService; + + @Autowired + private AccountDepartmentService accountDepartmentService; + + + @Override + @Transactional + public ResultVO save(ContextCacheUser currentUser, ApprovalRuleAddReqDTO ruleReqDTO) { + + //加分布式锁,防止重复创建规则 + RLock lock = redissonClient.getLock("LOCK_RULE_INSERT"); + try { + lock.lock(10, TimeUnit.SECONDS); + //部门验证 + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null, ruleReqDTO.getDepId()); + DepInfoRPCRespDTO depInfoByDepId = (DepInfoRPCRespDTO) resultVO.getData(); + if (null == depInfoByDepId) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "部门不存在!"); + } + //作业类型验证 + if (!WorkTypeEnum.checkWorkType(ruleReqDTO.getWorkType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业类型不合法!"); + } + //作业等级验证 + if (null != ruleReqDTO.getWorkLevel()) {//如果作业级别不为空 + if (!WorkLevelEnum.checkWorkLevel(ruleReqDTO.getWorkLevel())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业级别不合法!"); + } + } + //验证该部门下是否创建审批流程 + ApprovalRuleListDbQuery query = new ApprovalRuleListDbQuery(); + query.setDepId(ruleReqDTO.getDepId()); + query.setWorkType(ruleReqDTO.getWorkType()); + query.setWorkLevel(ruleReqDTO.getWorkLevel()); + List<ApprovalRule> ruleList = approvalRuleService.listRule(query); + if (ruleList.size() > 0) { + throw new BusinessException(E.DATA_DATABASE_EXIST, "该部门下该项已存在,不可重复"); + } + //填充规则信息 + ApprovalRule rule = new ApprovalRule(); + rule.setRuleId(IdUtil.getSnowflake(0, 0).nextId()); + rule.setDepId(ruleReqDTO.getDepId()); + rule.setRuleName(ruleReqDTO.getRuleName()); + rule.setWorkType(ruleReqDTO.getWorkType()); + if (null == ruleReqDTO.getWorkLevel()) { + rule.setWorkLevel((byte) 0); + } else { + rule.setWorkLevel(ruleReqDTO.getWorkLevel()); + } + rule.setCreateUid(currentUser.getUid()); + rule.setCreateUname(currentUser.getRealName()); + + //层级List + List<ApprovalRuleStep> saveStepList = new ArrayList<>(); + //单元List + List<ApprovalRuleUnit> saveUnitList = new ArrayList<>(); + //审批项List + List<ApprovalRuleUnitItem> saveUnitItemList = new ArrayList<>(); + + //层级 + List<ApprovalRuleStepAddReqDTO> stepReqDTOList = ruleReqDTO.getStepList(); + if (stepReqDTOList != null && stepReqDTOList.size() > 0) { + List<Long> uIdList = new ArrayList<>(); + Set<Long> mIdList = new HashSet<>(); + Set<Long> sIdList = new HashSet<>(); + //循环出数据用于后面验证 + + stepReqDTOList.forEach(step -> { + //单元 + List<ApprovalRuleUnitAddReqDTO> units = step.getUnitList(); + if (null != units && units.size() > 0) { + units.forEach(unit -> { + uIdList.add(unit.getBindUid()); + }); + } + + //审批项 + List<ApprovalRuleUnitItemAddReqDTO> items = step.getItemList(); + if (null != items && items.size() > 0) { + items.forEach(item -> { + if (null != item.getMeasureId()) { + mIdList.add(item.getMeasureId()); + } + if (null != item.getStandId()) { + sIdList.add(item.getStandId()); + } + }); + } + + + }); + //用于后面验证 + List<UserInfoRPCRespDTO> userList = new ArrayList<>(); + List<ApprovalRuleItemMeasureDO> measureList = new ArrayList<>(); + List<ApprovalRuleItemStandDO> standList = new ArrayList<>(); + if (uIdList.size() > 0) { + userList = (List<UserInfoRPCRespDTO>) accountUserService.listUserInfoByUids(uIdList).getData(); + } + if (mIdList.size() > 0) { + measureList = approvalRuleItemMeasureService.listItemMeasureByIds(mIdList); + } + if (sIdList.size() > 0) { + standList = approvalRuleStandService.listItemStandByIds(sIdList); + } + + //检查序号是否存在重复 + List<Integer> collect = stepReqDTOList.stream().map(ApprovalRuleStepAddReqDTO::getStepSerial).distinct().collect(Collectors.toList()); + if (stepReqDTOList.size() > collect.size()) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "排序号不可重复!"); + } + //按照升序排序 + Collections.sort(stepReqDTOList, new Comparator<ApprovalRuleStepAddReqDTO>() { + @Override + public int compare(ApprovalRuleStepAddReqDTO o1, ApprovalRuleStepAddReqDTO o2) { + //升序 + return o1.getStepSerial().compareTo(o2.getStepSerial()); + } + }); + //循环层级 + Long stepId = null; + for (ApprovalRuleStepAddReqDTO stepReqDTO : stepReqDTOList) { + //填充层级 + ApprovalRuleStep step = new ApprovalRuleStep(); + + if (!ApprovalStepTypeEnum.checkStepType(stepReqDTO.getType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批类型层级类型不合法!"); + } + //如果是分析人审批,有效时间,以及有效时间单位必须传 + if (stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) { + if (null == stepReqDTO.getContinueTime() || null == stepReqDTO.getContinueTimeUnit()) { + throw new BusinessException(E.DATA_PARAM_NULL, "当前是分析审批人层级,有效时间或者有效时间单位不可为空!"); + } + if (!RuleContinueTimeUnitEnum.checkTimeUnitType(stepReqDTO.getType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "有效时间单位不合法!"); + } + //如果是分析人审批审批项不可为空 + if(null == stepReqDTO.getItemList() || stepReqDTO.getItemList().size() == 0 ){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析审批人层级,请添加审批项!"); + } + step.setAuditType(stepReqDTO.getAuditType()); + } + //如果是多人审批并行审核不可为空 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_MULTIPLE_PEOPLE.getType())){ + if(null == stepReqDTO.getAuditType() ){ + throw new BusinessException(E.DATA_PARAM_NULL,"多人审批时审核类型不可为空!"); + } + if(null == AuditTypeEnum.parse(stepReqDTO.getAuditType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"审核类型不合法!"); + } + step.setAuditType(stepReqDTO.getAuditType()); + } + //填充规则id + step.setStepId(IdUtil.getSnowflake(0, 0).nextId()); + step.setRuleId(rule.getRuleId()); + step.setStepName(stepReqDTO.getStepName()); + step.setStepSerial(stepReqDTO.getStepSerial()); + step.setType(stepReqDTO.getType()); + step.setContinueTime(stepReqDTO.getContinueTime()); + step.setContinueTimeUnit(stepReqDTO.getContinueTimeUnit()); + step.setGmtCreate(LocalDateTime.now()); + step.setStatus(RuleStepStatusEnum.VALID.getCode()); + step.setCreateUname(currentUser.getRealName()); + step.setCreateUid(currentUser.getUid()); + if (null != stepId) { + step.setPreStepId(stepId); + } + saveStepList.add(step); + stepId = step.getStepId(); + + //单元 + List<ApprovalRuleUnitAddReqDTO> unitReqDTOList = stepReqDTO.getUnitList(); + //遍历审批单元 + if (unitReqDTOList != null && unitReqDTOList.size() > 0) { + //单人审批 + if (stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_SINGLE_PERSON.getType())) { + if (unitReqDTOList.size() > 1) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "单人审批类型或者分析审批类型时不可设置多人!"); + } + } + //分析人审批有可能是单人,也可能是多人 + //多人审批 + if (stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_MULTIPLE_PEOPLE.getType())) { + if (unitReqDTOList.size() < 2) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "多人审批类型时,需设置多人!"); + } + } + for (ApprovalRuleUnitAddReqDTO unitReqDTO : unitReqDTOList) { + List<UserInfoRPCRespDTO> uList = userList.stream().filter(user -> user.getUid().equals(unitReqDTO.getBindUid())).collect(Collectors.toList()); + if (uList.size() == 0) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "审批人员不存在!"); + } + //填充单元数据 + ApprovalRuleUnit unit = new ApprovalRuleUnit(); + unit.setUnitId(IdUtil.getSnowflake(0, 0).nextId()); + unit.setRuleId(rule.getRuleId()); + unit.setStepId(step.getStepId()); + unit.setBindDepId(ruleReqDTO.getDepId()); + unit.setBindDepName(depInfoByDepId.getDepName()); + unit.setBindUid(unitReqDTO.getBindUid()); + unit.setBindUname(uList.get(0).getRealName()); + unit.setGmtCreate(LocalDateTime.now()); + unit.setStatus(RuleUnitStatusEnum.VALID.getCode()); + unit.setCreateUid(currentUser.getUid()); + unit.setCreateUname(currentUser.getRealName()); + saveUnitList.add(unit); + + } + } else { + throw new BusinessException(E.DATA_PARAM_NULL, step.getStepName() + "未选择审批人!"); + } + + + //审批项 + List<ApprovalRuleUnitItemAddReqDTO> itemReqDTOList = stepReqDTO.getItemList(); + //遍历审批项 + if (itemReqDTOList != null && itemReqDTOList.size() > 0) { + for (ApprovalRuleUnitItemAddReqDTO item : itemReqDTOList) { + //验证类型是否合法 + if (null == RuleItemTypeEnum.parse(item.getType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批项类型不合法!"); + } + + //填充审批项数据 + ApprovalRuleUnitItem itemVo = new ApprovalRuleUnitItem(); + itemVo.setId(IdUtil.getSnowflake(0, 0).nextId()); + itemVo.setItemName(item.getItemName()); + itemVo.setRuleId(rule.getRuleId()); + itemVo.setStepId(step.getStepId()); + itemVo.setType(item.getType()); + itemVo.setStatus(RuleItemStatusEnum.VALID.getCode()); + itemVo.setGmtCreate(LocalDateTime.now()); + itemVo.setCreateUid(currentUser.getUid()); + itemVo.setCreateUname(currentUser.getRealName()); + + //是否分析人审批 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())){//分析人 + //数值 + if(item.getType().equals(RuleItemTypeEnum.NUMERIC.getCode())) { + //验证标准是否为空 + if(null == item.getStandId()){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析人审批层级和审批项类型不对应,未关联标准项!"); + } + //验证审批标准是否存在 + List<ApprovalRuleItemStandDO> sList = standList.stream().filter(stand -> stand.getId().equals(item.getStandId())).collect(Collectors.toList()); + if(sList.size() == 0){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"标准不存在,请联系管理员!"); + } + itemVo.setStandId(item.getStandId()); + } + //选项 + if(item.getType().equals(RuleItemTypeEnum.OPTION.getCode())){ + throw new BusinessException(E.DATA_PARAM_NULL,"审批项类型与分析人类型不一致,请重新选择!"); + } + //填空暂时不操作 + if(item.getType().equals(RuleItemTypeEnum.FILL.getCode())){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析人层级暂不支持填空,请重新选择!"); + } + + }else{//非分析人 + //验证安全措施是否为空 + if(null == item.getMeasureId()){ + throw new BusinessException(E.DATA_PARAM_NULL,"多人或单人审批层级和审批项类型不对应,未关联安全措施项!"); + } + //验证安全措施类型是否存在 + List<ApprovalRuleItemMeasureDO> mList = measureList.stream().filter(measure -> measure.getId().equals(item.getMeasureId())).collect(Collectors.toList()); + if(mList.size() == 0){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"安全措施不存在,请联系管理员!"); + } + //选项 + if(item.getType().equals(RuleItemTypeEnum.OPTION.getCode())){ + //验证审批项类型是否与安全措施一致 + if(!mList.get(0).getType().equals(MeasureTypeEnum.TYPE_CHOSE.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型与审批项类型不一致!"); + } + } + //填空 + if(item.getType().equals(RuleItemTypeEnum.FILL.getCode())){ + //验证审批项类型是否与安全措施一致 + if(!mList.get(0).getType().equals(MeasureTypeEnum.TYPE_INPUT.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型与审批项类型不一致!"); + } + } + itemVo.setMeasureId(item.getMeasureId()); + } + saveUnitItemList.add(itemVo); + } + } + } + } + //插入规则 + approvalRuleService.saveRuleInfo(rule); + //批量插入层级 + if (saveStepList.size() > 0) { + approvalRuleStepService.saveStepList(saveStepList); + } + //批量插入单元 + if (saveUnitList.size() > 0) { + approvalRuleUnitService.saveUnitList(saveUnitList); + } + //批量插入审批项 + if (saveUnitItemList.size() > 0) { + approvalRuleUnitItemService.batchSaveItemList(saveUnitItemList); + } + + //创建成功,释放锁 + lock.unlock(); + + } catch (BusinessException e) { + e.printStackTrace(); + throw new BusinessException(e.getCode(), e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + throw new BusinessException(ResultCodes.SERVER_ERROR); + } finally { + if (lock.isLocked()) { + lock.unlock(); + } + } + + return new ResultVO(ResultCodes.OK); + } + + @Override + @Transactional + public ResultVO update(ContextCacheUser currentUser,ApprovalRuleModReqDTO ruleReqDTO) { + + //主键 + if(null == ruleReqDTO.getRuleId()){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + //部门验证 + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null,ruleReqDTO.getDepId()); + DepInfoRPCRespDTO depInfoByDepId= (DepInfoRPCRespDTO)resultVO.getData(); + if(null == depInfoByDepId){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"部门不存在!"); + } + + + //根据规则id获取所有层级 + List<ApprovalRuleStep> stepList = approvalRuleStepService.listByRuleId(ruleReqDTO.getRuleId()); + //根据规则id获取所有单元 + List<ApprovalRuleUnit> unitList = approvalRuleUnitService.listByRuleId(ruleReqDTO.getRuleId()); + //根据规则id获取所有审批项 + List<ApprovalRuleUnitItem> unitItemList = approvalRuleUnitItemService.listByRuleId(ruleReqDTO.getRuleId()); + + //填充规则信息 + ApprovalRule rule = new ApprovalRule(); + rule.setRuleId(ruleReqDTO.getRuleId()); + rule.setRuleName(ruleReqDTO.getRuleName()); + rule.setModifiedUid(currentUser.getUid()); + rule.setModifiedUname(currentUser.getRealName()); + + //层级List + List<ApprovalRuleStep> saveStepList = new ArrayList<>(); + List<ApprovalRuleStep> updateStepList = new ArrayList<>(); + //单元List + List<ApprovalRuleUnit> saveUnitList = new ArrayList<>(); + //审批项List + List<ApprovalRuleUnitItem> saveUnitItemList = new ArrayList<>(); + List<ApprovalRuleUnitItem> updateUnitItemList = new ArrayList<>(); + + //层级 + List<ApprovalRuleStepModReqDTO> stepModReqDTOList = ruleReqDTO.getStepList(); + if(stepModReqDTOList != null && stepModReqDTOList.size()>0) { + + List<Long> uIdList = new ArrayList<>(); + Set<Long> mIdList = new HashSet<>(); + Set<Long> sIdList = new HashSet<>(); + //循环出数据用于后面验证 + stepModReqDTOList.forEach(step ->{ + //单元 + List<ApprovalRuleUnitModReqDTO> units = step.getUnitList(); + if(null != units && units.size()>0){ + units.forEach(unit ->{ + uIdList.add(unit.getBindUid()); + }); + } + + //审批项 + List<ApprovalRuleUnitItemModReqDTO> items = step.getItemList(); + if(null != items && items.size()>0){ + items.forEach(item ->{ + if (null != item.getMeasureId()){ + mIdList.add(item.getMeasureId()); + } + if (null != item.getStandId()){ + sIdList.add(item.getStandId()); + } + }); + } + + + }); + //用于后面验证 + List<UserInfoRPCRespDTO> userList = new ArrayList<>(); + List<ApprovalRuleItemMeasureDO> measureList = new ArrayList<>(); + List<ApprovalRuleItemStandDO> standList = new ArrayList<>(); + if(uIdList.size()>0){ + userList= (List<UserInfoRPCRespDTO>)accountUserService.listUserInfoByUids(uIdList).getData(); + } + if(mIdList.size()>0){ + measureList = approvalRuleItemMeasureService.listItemMeasureByIds(mIdList); + } + if(sIdList.size()>0){ + standList = approvalRuleStandService.listItemStandByIds(sIdList); + } + //检查序号是否存在重复 + List<Integer> collect = stepModReqDTOList.stream().map(ApprovalRuleStepModReqDTO::getStepSerial).distinct().collect(Collectors.toList()); + if (stepModReqDTOList.size() > collect.size()) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "排序号不可重复!"); + } + //按照升序排序 + Collections.sort(stepModReqDTOList, new Comparator<ApprovalRuleStepModReqDTO>() { + @Override + public int compare(ApprovalRuleStepModReqDTO o1, ApprovalRuleStepModReqDTO o2) { + //升序 + return o1.getStepSerial().compareTo(o2.getStepSerial()); + } + }); + + //过滤出要删除的层级 做删除以及解绑操作 + List<ApprovalRuleStep> deleteOldStepList = stepList.stream().parallel().filter(a -> + stepModReqDTOList.stream().noneMatch(b -> + a.getStepId().equals(b.getStepId()))) + .collect(Collectors.toList()); + List<Long> deleteOldStepIdList = deleteOldStepList.stream().map(step -> step.getStepId()).collect(Collectors.toList()); + if(deleteOldStepIdList != null && deleteOldStepIdList.size()>0){ + //删除关联的审批项 + approvalRuleUnitItemService.updateStatusByStepIds(deleteOldStepIdList); + //删除关联的单元 + approvalRuleUnitService.updateStatusByStepIds(deleteOldStepIdList); + //先删除原有层级 + approvalRuleStepService.updateStatusByStepIds(deleteOldStepIdList); + } + + Long stepId = null; + //循环层级 更新的层级 + for (ApprovalRuleStepModReqDTO stepReqDTO : stepModReqDTOList) { + //填充层级数据 + ApprovalRuleStep step = new ApprovalRuleStep(); + + //校验 + if (!ApprovalStepTypeEnum.checkStepType(stepReqDTO.getType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批类型层级类型不合法!"); + } + //如果是分析人审批,有效时间,以及有效时间单位必须传 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())){ + if(null == stepReqDTO.getContinueTime() || null == stepReqDTO.getContinueTimeUnit()){ + throw new BusinessException(E.DATA_PARAM_NULL,"当前是分析审批人层级,有效时间或者有效时间单位不可为空!"); + } + if(!RuleContinueTimeUnitEnum.checkTimeUnitType(stepReqDTO.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"有效时间单位不合法!"); + } + //如果是分析人审批审批项不可为空 + if(null == stepReqDTO.getItemList() || stepReqDTO.getItemList().size() == 0 ){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析审批人层级,请添加审批项!"); + } + step.setAuditType(AuditTypeEnum.CONCURRENT_JOINT_TRIAL.getType()); + } + //如果是多人审批并行审核不可为空 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_MULTIPLE_PEOPLE.getType())){ + if(null == stepReqDTO.getAuditType() ){ + throw new BusinessException(E.DATA_PARAM_NULL,"多人审批时并行审核类型不可为空!"); + } + if(null == AuditTypeEnum.parse(stepReqDTO.getAuditType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"审核类型不合法!"); + } + step.setAuditType(stepReqDTO.getAuditType()); + } + //单人审核默认为空 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_SINGLE_PERSON.getType())){ + step.setAuditType(null); + } + List<ApprovalRuleUnit> oldUnitList = new ArrayList<>(); + List<ApprovalRuleUnitItem> oldUnitItemList = new ArrayList<>(); + + //填充规则id + step.setRuleId(rule.getRuleId()); + step.setStepName(stepReqDTO.getStepName()); + step.setStepSerial(stepReqDTO.getStepSerial()); + step.setType(stepReqDTO.getType()); + step.setContinueTime(stepReqDTO.getContinueTime()); + step.setContinueTimeUnit(stepReqDTO.getContinueTimeUnit()); + + //判断是否第一个节点 + if (null != stepId) { + step.setPreStepId(stepId); + } + //层级主键不为空 做更新操作 + if(null != stepReqDTO.getStepId()){ + step.setModifiedUid(currentUser.getUid()); + step.setModifiedUname(currentUser.getRealName()); + step.setStepId(stepReqDTO.getStepId()); + updateStepList.add(step); + + //过滤出层级原有的单元人员 + oldUnitList = unitList.stream().filter(unit -> unit.getStepId().equals(stepReqDTO.getStepId())).collect(Collectors.toList()); + //过滤出层级原有的审批项 + oldUnitItemList = unitItemList.stream().filter(item -> item.getStepId().equals(stepReqDTO.getStepId())).collect(Collectors.toList()); + }else{ + step.setStepId(IdUtil.getSnowflake(0,0).nextId()); + step.setStatus(RuleStepStatusEnum.VALID.getCode()); + step.setGmtCreate(LocalDateTime.now()); + step.setCreateUid(currentUser.getUid()); + step.setCreateUname(currentUser.getRealName()); + saveStepList.add(step); + + } + //赋值 + stepId = step.getStepId(); + + //单元 + List<ApprovalRuleUnitModReqDTO> unitModReqDTOList = stepReqDTO.getUnitList(); + if(unitModReqDTOList != null && unitModReqDTOList.size()>0){ + //单人审批 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_SINGLE_PERSON.getType())){ + if(unitModReqDTOList.size()>1){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"单人审批类型或者分析审批类型时不可设置多人!"); + } + } + //多人审批 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_MULTIPLE_PEOPLE.getType())){ + if(unitModReqDTOList.size() < 2){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"多人审批类型时,需设置多人!"); + } + } + //过滤出原来存在的单元 + List<ApprovalRuleUnit> undeleteOldUnitList = oldUnitList.stream().parallel().filter(oldUnit -> unitModReqDTOList.stream() + .anyMatch(newUnit-> newUnit.getBindUid().equals(oldUnit.getBindUid()))).collect(Collectors.toList()); + //过滤出要删除的单元 做删除操作 + List<ApprovalRuleUnit> deleteOldUnitList = oldUnitList.stream().parallel().filter(a -> + unitModReqDTOList.stream().noneMatch(b -> + a.getBindUid().equals(b.getBindUid()))) + .collect(Collectors.toList()); + if(deleteOldUnitList.size()>0 && deleteOldUnitList != null){ + List<Long> deleteOldUnitIdList = deleteOldUnitList.stream().map(unit->unit.getUnitId()).collect(Collectors.toList()); + //删除审批单元 + approvalRuleUnitService.updateStatusByUnitIds(deleteOldUnitIdList); + } + + //遍历单元 + for (ApprovalRuleUnitModReqDTO unitReqDTO : unitModReqDTOList) { + List<UserInfoRPCRespDTO> uList = userList.stream().filter(user -> user.getUid().equals(unitReqDTO.getBindUid())).collect(Collectors.toList()); + if (uList.size() == 0) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "审批人员不存在!"); + } + List<ApprovalRuleUnit> selectUnit = undeleteOldUnitList.stream().filter(u -> u.getBindUid().equals(unitReqDTO.getBindUid())).collect(Collectors.toList()); + if(selectUnit.size() == 0){ //如果非原有单元,则插入 + ApprovalRuleUnit unit = new ApprovalRuleUnit(); + unit.setUnitId(IdUtil.getSnowflake(0,0).nextId()); + unit.setRuleId(rule.getRuleId()); + unit.setStepId(step.getStepId()); + unit.setBindDepId(ruleReqDTO.getDepId()); + unit.setBindDepName(depInfoByDepId.getDepName()); + unit.setBindUid(unitReqDTO.getBindUid()); + unit.setBindUname(uList.get(0).getRealName()); + unit.setGmtCreate(LocalDateTime.now()); + unit.setStatus(RuleUnitStatusEnum.VALID.getCode()); + unit.setCreateUid(currentUser.getUid()); + unit.setCreateUname(currentUser.getRealName()); + saveUnitList.add(unit); + } + } + + }else{ + throw new BusinessException(E.DATA_PARAM_NULL, step.getStepName()+"未选择审批人!"); + } + //审批项 + List<ApprovalRuleUnitItemModReqDTO> itemModReqDTOList = stepReqDTO.getItemList(); + if(itemModReqDTOList != null){ + //过滤出要删除的审批项 做删除操作 + List<ApprovalRuleUnitItem> deleteOldItemList = oldUnitItemList.stream().parallel().filter(a -> + itemModReqDTOList.stream().noneMatch(b -> + a.getId().equals(b.getId()))) + .collect(Collectors.toList()); + if(deleteOldItemList.size()>0 && deleteOldItemList != null){ + List<Long> deleteOldUnitIdList = deleteOldItemList.stream().map(item->item.getId()).collect(Collectors.toList()); + //删除审批项 + approvalRuleUnitItemService.updateStatusByIds(deleteOldUnitIdList); + + } + //遍历审批项 + for (ApprovalRuleUnitItemModReqDTO itemReqDTO : itemModReqDTOList) { + //验证类型是否合法 + if(null == RuleItemTypeEnum.parse(itemReqDTO.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"审批项类型不合法!"); + } + + ApprovalRuleUnitItem itemVo = new ApprovalRuleUnitItem(); + itemVo.setItemName(itemReqDTO.getItemName()); + itemVo.setRuleId(rule.getRuleId()); + itemVo.setStepId(step.getStepId()); + itemVo.setType(itemReqDTO.getType()); + //是否分析人审批 + if(stepReqDTO.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())){//分析人 + //数值 + if(itemReqDTO.getType().equals(RuleItemTypeEnum.NUMERIC.getCode())) { + //验证标准是否为空 + if(null == itemReqDTO.getStandId()){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析人审批层级未关联标准项!"); + } + //验证审批标准是否存在 + List<ApprovalRuleItemStandDO> sList = standList.stream().filter(stand -> stand.getId().equals(itemReqDTO.getStandId())).collect(Collectors.toList()); + if(sList.size() == 0){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"标准不存在,请联系管理员!"); + } + itemVo.setStandId(itemReqDTO.getStandId()); + } + + //选项 + if(itemReqDTO.getType().equals(RuleItemTypeEnum.OPTION.getCode())){ + throw new BusinessException(E.DATA_PARAM_NULL,"审批项类型与分析人类型不一致,请重新选择!"); + } + //填空 + if(itemReqDTO.getType().equals(RuleItemTypeEnum.FILL.getCode())){ + throw new BusinessException(E.DATA_PARAM_NULL,"分析人层级暂不支持填空,请重新选择!"); + } + //填空暂不操作 + + }else{//非分析人 + //验证安全措施是否为空 + if(null == itemReqDTO.getMeasureId()){ + throw new BusinessException(E.DATA_PARAM_NULL,"多人或单人审批层级未关联安全措施项!"); + } + //验证安全措施类型是否存在 + List<ApprovalRuleItemMeasureDO> mList = measureList.stream().filter(measure -> measure.getId().equals(itemReqDTO.getMeasureId())).collect(Collectors.toList()); + if(mList.size() == 0){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"安全措施不存在,请联系管理员!"); + } + //选项 + if(itemReqDTO.getType().equals(RuleItemTypeEnum.OPTION.getCode())){ + //验证审批项类型是否与安全措施一致 + if(!mList.get(0).getType().equals(MeasureTypeEnum.TYPE_CHOSE.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型与审批项类型不一致!"); + } + } + //填空 + if(itemReqDTO.getType().equals(RuleItemTypeEnum.FILL.getCode())){ + //验证审批项类型是否与安全措施一致 + if(!mList.get(0).getType().equals(MeasureTypeEnum.TYPE_INPUT.getType())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID,"安全措施类型与审批项类型不一致!"); + } + } + itemVo.setMeasureId(itemReqDTO.getMeasureId()); + } + //主键为空 则新增 + if(null == itemReqDTO.getId()){ + itemVo.setId(IdUtil.getSnowflake(0,0).nextId()); + itemVo.setStatus(RuleItemStatusEnum.VALID.getCode()); + itemVo.setGmtCreate(LocalDateTime.now()); + itemVo.setCreateUid(currentUser.getUid()); + itemVo.setCreateUname(currentUser.getRealName()); + saveUnitItemList.add(itemVo); + }else{ //修改操作 + //填充主键 + itemVo.setId(itemReqDTO.getId()); + itemVo.setGmtModified(LocalDateTime.now()); + itemVo.setModifiedUid(currentUser.getUid()); + itemVo.setModifiedUname(currentUser.getRealName()); + updateUnitItemList.add(itemVo); + } + } + } + } + } + //更新规则 + approvalRuleService.updateRule(rule); + + if(saveStepList.size()>0){ + //批量插入层级 + approvalRuleStepService.saveStepList(saveStepList); + } + if(updateStepList.size()>0){ + //批量更新层级 + approvalRuleStepService.updateBatchStep(updateStepList); + } + if(saveUnitList.size()>0){ + //批量插入单元 + approvalRuleUnitService.saveUnitList(saveUnitList); + } + if(saveUnitItemList.size()>0){ + //批量插入审批项 + approvalRuleUnitItemService.batchSaveItemList(saveUnitItemList); + } + if(updateUnitItemList.size()>0){ + //批量更新审批项 + approvalRuleUnitItemService.updateBatchItem(updateUnitItemList); + } + return new ResultVO<>(ResultCodes.OK); + } + + @Override + @Transactional + public ResultVO removeBatchRule(DeleteForm deleteForm) { + + //删除规则表中数据 + approvalRuleService.updateStutsByRuleIds(deleteForm.getIds()); + + //删除关联该规则的层级 + approvalRuleStepService.updateStatusByRuleIds(deleteForm.getIds()); + + //删除单元 + approvalRuleUnitService.updateStatusByRuleIds(deleteForm.getIds()); + + //删除审批项 + approvalRuleUnitItemService.updateStatusByRuleIds(deleteForm.getIds()); + + return new ResultVO<>(ResultCodes.OK); + } + + + + @Override + public SearchResultVO<List<ApprovalRuleRespDTO>> listRuleByPage(PageQuery<ApprovalRuleListDbQuery> pageQuery) { + Page<ApprovalRule> page = new Page<>(pageQuery.getPageIndex(),pageQuery.getPageSize()); + List<ApprovalRule> approvalRules = approvalRuleService.listRuleByPage(page,pageQuery.getSearchParams()); + //获取层级列表 + List<ApprovalRuleStep> stepList = approvalRuleStepService.listStepByNoConditions(); + //获取单元列表 + List<ApprovalRuleUnit> unitList = approvalRuleUnitService.listByNoConditions(); + //获取审批项列表 + List<ApprovalRuleUnitItem> itemList = approvalRuleUnitItemService.listByNoConditions(); + //获取对应的审批标准 + //获取安全措施列表 + + List<ApprovalRuleRespDTO> ruleRespList = new ArrayList<>(); + for (ApprovalRule rule : approvalRules) { + //复制 + ApprovalRuleRespDTO ruleRespDTO = new ApprovalRuleRespDTO(); + BeanUtils.copyProperties(rule,ruleRespDTO); + //刷选层级 + List<ApprovalRuleStep> selectStepList = stepList.stream().filter(step -> step.getRuleId().equals(rule.getRuleId())).collect(Collectors.toList()); + List<ApprovalRuleStepRespDTO> stepRespList = new ArrayList<>(); + for (ApprovalRuleStep step : selectStepList) { + //复制 + ApprovalRuleStepRespDTO stepRespDTO = new ApprovalRuleStepRespDTO(); + BeanUtils.copyProperties(step,stepRespDTO); + //过滤单元 + List<ApprovalRuleUnit> selectUnitList = unitList.stream().filter(unit -> unit.getStepId().equals(step.getStepId())).collect(Collectors.toList()); + List<ApprovalRuleUnitRespDTO> unitRespDTOList = new ArrayList<>(); + for (ApprovalRuleUnit unit: selectUnitList) { + //复制 + ApprovalRuleUnitRespDTO unitRespDTO = new ApprovalRuleUnitRespDTO(); + BeanUtils.copyProperties(unit,unitRespDTO); + unitRespDTOList.add(unitRespDTO); + } + //过滤审批项 + List<ApprovalRuleUnitItem> selectItemList = itemList.stream().filter(item -> item.getStepId().equals(step.getStepId())).collect(Collectors.toList()); + List<ApprovalRuleUnitItemRespDTO> itemRespDTOList = new ArrayList<>(); + for (ApprovalRuleUnitItem item: selectItemList) { + //复制 + ApprovalRuleUnitItemRespDTO itemRespDTO = new ApprovalRuleUnitItemRespDTO(); + BeanUtils.copyProperties(item,itemRespDTO); + itemRespDTOList.add(itemRespDTO); + } + stepRespDTO.setUnitList(unitRespDTOList); + stepRespDTO.setItemList(itemRespDTOList); + stepRespList.add(stepRespDTO); + } + ruleRespDTO.setStepList(stepRespList); + ruleRespList.add(ruleRespDTO); + } + + //需要获取层级、单元、审批项、以及审批规则 等后面封装进去 + return new SearchResultVO<>(true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + ruleRespList, + ResultCodes.OK); + } + + @Override + public ApprovalRuleBO recursiveQueryRule(Long depId, Byte workType, Byte workLevel) { + ApprovalRuleBO ruleBO = null; + // rpc获取部门 + if (depId == null) { + return null; + } + ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(null,depId); + + if (rpcResult.getCode().equals(ResultCodes.OK.getCode())) { + if (rpcResult.getData() != null) { + DepInfoRPCRespDTO department = (DepInfoRPCRespDTO)rpcResult.getData(); + ApprovalRule rule = approvalRuleService.getApprovalRuleInfo(depId, workType, workLevel); + if (rule == null) { + ruleBO = recursiveQueryRule(department.getParentDepId(), workType, workLevel); + }else{ + ruleBO = new ApprovalRuleBO(); + ruleBO.setDepId(rule.getDepId()); + ruleBO.setDepName(department.getDepName()); + ruleBO.setEid(rule.getEid()); + ruleBO.setRuleId(rule.getRuleId()); + ruleBO.setRuleName(rule.getRuleName()); + ruleBO.setStatus(rule.getStatus()); + ruleBO.setWorkLevel(rule.getWorkLevel()); + ruleBO.setWorkType(rule.getWorkType()); + } + } + }else{ + throw new BusinessException(rpcResult.getCode(), rpcResult.getMsg()); + } + + + return ruleBO; + + + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleStandServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleStandServiceImpl.java new file mode 100644 index 0000000..1905cf6 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/RuleStandServiceImpl.java @@ -0,0 +1,253 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStand; +import com.gk.hotwork.specialWork.entity.ApprovalRuleItemStandDO; +import com.gk.hotwork.specialWork.enums.RuleItemStandStatusEnum; +import com.gk.hotwork.specialWork.enums.WorkStandTypeEnum; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandAddReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.ApprovalRuleStandModReqDTO; +import com.gk.hotwork.specialWork.model.dto.req.DeleteForm; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleItemStandPageRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.ApprovalRuleStandListRespDTO; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandListQuery; +import com.gk.hotwork.specialWork.model.query.ApprovalRuleStandPageQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandListDBQuery; +import com.gk.hotwork.specialWork.model.query.db.ApprovalRuleStandPageDBQuery; +import com.gk.hotwork.specialWork.model.update.EntityStatusBatchUO; +import com.gk.hotwork.specialWork.service.RuleStandService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleStandService; +import com.gk.hotwork.specialWork.service.baseService.ApprovalRuleUnitItemService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +@Service("ruleStandService") +public class RuleStandServiceImpl implements RuleStandService { + + @Autowired + private AccountDepartmentService accountDepartmentService; + @Autowired + private ApprovalRuleStandService approvalRuleStandService; + @Autowired + private ApprovalRuleUnitItemService approvalRuleUnitItemService; + + + @Override + public void saveRuleStand(ContextCacheUser currentUser, ApprovalRuleStandAddReqDTO addReqDTO) { + ; + if (addReqDTO.getRuleStandType() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (StringUtils.isBlank(addReqDTO.getTitle())) { + throw new BusinessException(E.DATA_PARAM_NULL, "标题为空"); + } + WorkStandTypeEnum standTypeEnum = WorkStandTypeEnum.parse(addReqDTO.getRuleStandType()); + if (standTypeEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "标准类型参数不合法"); + } + + // 1.保存审批项标准 + ApprovalRuleItemStand itemStandEntity = new ApprovalRuleItemStand(); +// itemStandEntity.setDepId(addReqDTO.getDepId()); + itemStandEntity.setType(addReqDTO.getRuleStandType()); +// itemStandEntity.setEid(addReqDTO.getEid()); + itemStandEntity.setMaxVal(addReqDTO.getMaxVal()); + itemStandEntity.setMaxValMatchPattern(addReqDTO.getMaxValMatchPattern()); + itemStandEntity.setMinVal(addReqDTO.getMinVal()); + itemStandEntity.setMinValMatchPattern(addReqDTO.getMinValMatchPattern()); + itemStandEntity.setTitle(addReqDTO.getTitle()); + itemStandEntity.setInfo(addReqDTO.getInfo()); + itemStandEntity.setCreateUid(currentUser.getUid()); + itemStandEntity.setCreateUname(currentUser.getRealName()); + itemStandEntity.setGmtCreate(LocalDateTime.now()); + itemStandEntity.setStatus(RuleItemStandStatusEnum.VALID.getCode()); + approvalRuleStandService.saveRuleStand(itemStandEntity); + } + + @Override + public void updateRuleStand(ContextCacheUser currentUser, ApprovalRuleStandModReqDTO modReqDTO) { + ; + if (modReqDTO.getRuleStandType() == null || + modReqDTO.getRuleStandId() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (StringUtils.isBlank(modReqDTO.getTitle())) { + throw new BusinessException(E.DATA_PARAM_NULL, "标题为空"); + } + WorkStandTypeEnum standTypeEnum = WorkStandTypeEnum.parse(modReqDTO.getRuleStandType()); + if (standTypeEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "标准类型参数不合法"); + } + ApprovalRuleItemStandDO ruleStandDO = approvalRuleStandService.getRuleStandDOById(modReqDTO.getRuleStandId()); + if (ruleStandDO == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "审批标准不存在"); + } + if (!ruleStandDO.getStatus().equals(RuleItemStandStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID, "审批标准不存在"); + } + + if (!WorkStandTypeEnum.checkWorkStandType(modReqDTO.getRuleStandType())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "标准类型参数不合法"); + } + // 更新 + ApprovalRuleItemStand itemStandEntity = new ApprovalRuleItemStand(); + itemStandEntity.setId(modReqDTO.getRuleStandId()); +// itemStandEntity.setDepId(modReqDTO.getDepId()); + itemStandEntity.setTitle(modReqDTO.getTitle()); + itemStandEntity.setMinVal(modReqDTO.getMinVal()); + itemStandEntity.setMinValMatchPattern(modReqDTO.getMinValMatchPattern()); + itemStandEntity.setMaxVal(modReqDTO.getMaxVal()); + itemStandEntity.setMaxValMatchPattern(modReqDTO.getMaxValMatchPattern()); + itemStandEntity.setType(modReqDTO.getRuleStandType()); + itemStandEntity.setGmtModified(LocalDateTime.now()); + itemStandEntity.setModifiedUid(currentUser.getUid()); + itemStandEntity.setModifiedUname(currentUser.getRealName()); + itemStandEntity.setInfo(modReqDTO.getInfo()); + approvalRuleStandService.updateRuleStand(itemStandEntity); + } + + @Override + public List<ApprovalRuleStandListRespDTO> listRuleStand(ContextCacheUser currentUser,ApprovalRuleStandListQuery query) { + ; + // 查询对象 + ApprovalRuleStandListDBQuery dbQuery = new ApprovalRuleStandListDBQuery(); + dbQuery.setRuleStandType(query.getRuleStandType()); + dbQuery.setStatus(RuleItemStandStatusEnum.VALID.getCode()); + dbQuery.setTitle(query.getTitle()); + // 执行 + List<ApprovalRuleItemStandDO> dbData = approvalRuleStandService.listRuleStandDO(dbQuery); + List<ApprovalRuleStandListRespDTO> respDTOs = new ArrayList<>(dbData.size()); + ApprovalRuleStandListRespDTO respDTO; + RuleItemStandStatusEnum itemStandStatusEnum; + WorkStandTypeEnum standTypeEnum; + if (dbData.size() > 0) { + for (ApprovalRuleItemStandDO ruleItemStandDO : dbData) { + respDTO = new ApprovalRuleStandListRespDTO(); + respDTO.setTitle(ruleItemStandDO.getTitle()); + respDTO.setRuleStandId(ruleItemStandDO.getId()); + respDTO.setTitle(ruleItemStandDO.getTitle()); + respDTO.setMaxVal(ruleItemStandDO.getMaxVal()); + respDTO.setMaxValMatchPattern(ruleItemStandDO.getMaxValMatchPattern()); + respDTO.setMinVal(ruleItemStandDO.getMinVal()); + respDTO.setMinValMatchPattern(ruleItemStandDO.getMinValMatchPattern()); + respDTO.setRuleStandType(ruleItemStandDO.getType()); + respDTO.setStatus(ruleItemStandDO.getStatus()); + respDTO.setInfo(ruleItemStandDO.getInfo()); + standTypeEnum = WorkStandTypeEnum.parse(ruleItemStandDO.getType()); + if (standTypeEnum != null) { + respDTO.setRuleStandTypeDesc(standTypeEnum.getDesc()); + } + itemStandStatusEnum = RuleItemStandStatusEnum.parse(ruleItemStandDO.getStatus()); + if (itemStandStatusEnum != null) { + respDTO.setStatusDesc(itemStandStatusEnum.getValue()); + } + respDTOs.add(respDTO); + } + } + return respDTOs; + } + + @Override + public SearchResultVO<List<ApprovalRuleItemStandPageRespDTO>> listRuleStandByPage(ContextCacheUser currentUser, PageQuery<ApprovalRuleStandPageQuery> query) { + ; + // 查询对象 + ApprovalRuleStandPageDBQuery dbQuery = new ApprovalRuleStandPageDBQuery(); + dbQuery.setStatus(RuleItemStandStatusEnum.VALID.getCode()); + if (query.getSearchParams() != null) { + dbQuery.setTitle(query.getSearchParams().getTitle()); + dbQuery.setRuleStandType(query.getSearchParams().getRuleStandType()); + } + // 分页对象 + Page<ApprovalRuleItemStand> page = new Page<>(query.getPageIndex(), query.getPageSize()); + List<ApprovalRuleItemStand> dbData = approvalRuleStandService.listRuleStandByPage(page, dbQuery); + List<ApprovalRuleItemStandPageRespDTO> respDTOs = new ArrayList<>(dbData.size()); + ApprovalRuleItemStandPageRespDTO respDTO; + RuleItemStandStatusEnum itemStandStatusEnum; + WorkStandTypeEnum standTypeEnum; + if (dbData.size() > 0) { + for (ApprovalRuleItemStand ruleItemStandDO : dbData) { + respDTO = new ApprovalRuleItemStandPageRespDTO(); + respDTO.setRuleStandId(ruleItemStandDO.getId()); + respDTO.setMaxVal(ruleItemStandDO.getMaxVal()); + respDTO.setMaxValMatchPattern(ruleItemStandDO.getMaxValMatchPattern()); + respDTO.setMinVal(ruleItemStandDO.getMinVal()); + respDTO.setMinValMatchPattern(ruleItemStandDO.getMinValMatchPattern()); + respDTO.setRuleStandType(ruleItemStandDO.getType()); + respDTO.setTitle(ruleItemStandDO.getTitle()); + respDTO.setInfo(ruleItemStandDO.getInfo()); + respDTO.setStatus(ruleItemStandDO.getStatus()); + respDTO.setCreateUid(ruleItemStandDO.getCreateUid()); + respDTO.setCreateUname(ruleItemStandDO.getCreateUname()); + respDTO.setGmtCreate(ruleItemStandDO.getGmtCreate()); + respDTO.setModifiedUid(ruleItemStandDO.getModifiedUid()); + respDTO.setModifiedUname(ruleItemStandDO.getModifiedUname()); + respDTO.setGmtModified(ruleItemStandDO.getGmtModified()); + standTypeEnum = WorkStandTypeEnum.parse(ruleItemStandDO.getType()); + if (standTypeEnum != null) { + respDTO.setRuleStandTypeDesc(standTypeEnum.getDesc()); + } + itemStandStatusEnum = RuleItemStandStatusEnum.parse(ruleItemStandDO.getStatus()); + if (itemStandStatusEnum != null) { + respDTO.setStatusDesc(itemStandStatusEnum.getValue()); + } + respDTOs.add(respDTO); + } + } + + return new SearchResultVO<>( + true,page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respDTOs, + ResultCodes.OK); + } + + @Override + public void deleteRuleStand(ContextCacheUser currentUser, DeleteForm deleteForm) { + ; + if (deleteForm.getIds() == null || deleteForm.getIds().size() == 0) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (deleteForm.getIds().size() > 10) { + throw new BusinessException(ResultCodes.SERVER_DEL_OVER_SIZE); + } + ApprovalRuleItemStandDO ruleItemStandDO; + long count; + for (Long ruleStandId : deleteForm.getIds()) { + ruleItemStandDO = approvalRuleStandService.getRuleStandDOById(ruleStandId); + if (ruleItemStandDO == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"审批项标准不存在"); + } + if (!ruleItemStandDO.getStatus().equals(RuleItemStandStatusEnum.VALID.getCode())) { + throw new BusinessException(E.DATA_DATABASE_EXIST_BUT_NOT_VALID,"审批项标准不存在"); + } + // 是否被审批项占用 + count = approvalRuleUnitItemService.countByRuleStandId(ruleStandId); + if (count > 0) { + throw new BusinessException(E.DATA_BING_RELATION, "审批项关联,无法删除"); + } + } + EntityStatusBatchUO batchDeleteObj = new EntityStatusBatchUO(); + batchDeleteObj.setIds(deleteForm.getIds()); + batchDeleteObj.setModifiedUname(currentUser.getRealName()); + batchDeleteObj.setGmtModified(LocalDateTime.now()); + batchDeleteObj.setModifiedUid(currentUser.getUid()); + batchDeleteObj.setStatus(RuleItemStandStatusEnum.ABANDONED.getCode()); + approvalRuleStandService.deleteBatch(batchDeleteObj); + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/SpecialWorkMinoServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/SpecialWorkMinoServiceImpl.java new file mode 100644 index 0000000..5cfba54 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/SpecialWorkMinoServiceImpl.java @@ -0,0 +1,134 @@ +//package com.gk.hotwork.specialWork.service.impl; +// +//import com.gk.hotwork.commons.config.file.MinioConfig; +//import com.gk.hotwork.Domain.Enum.ResultCodes; +//import com.gk.hotwork.Domain.Utils.StringUtils; +//import com.gk.hotwork.commons.utils.UUIDUtil; +//import com.gk.hotwork.Domain.Vo.ResultVO; +//import com.gk.hotwork.specialWork.service.SpecialWorkMinoService; +//import io.minio.GetPresignedObjectUrlArgs; +//import io.minio.MinioClient; +//import io.minio.RemoveObjectArgs; +//import io.minio.errors.*; +//import io.minio.http.Method; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.stereotype.Service; +// +//import java.text.SimpleDateFormat; +//import java.util.Date; +//import java.util.HashMap; +//import java.util.Map; +// +// +//@Service +//public class SpecialWorkMinoServiceImpl implements SpecialWorkMinoService { +// +// private Logger logger = LoggerFactory.getLogger(this.getClass()); +// +// @Autowired +// private MinioClient minioClient; +// +// @Autowired +// private MinioConfig minioConfig; +// +// @Value("${specailworkmino.floders.specialwork}") +// private String minioFloders; +// +// /** +// * 获取对象上传路径 +// */ +// @Override +// public ResultVO getPresignUrl(String suffixName){ +// +// String uuid= UUIDUtil.initUUID(); +// SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS"); +// String objName = formatter.format(new Date())+"-"+uuid+"."+suffixName; +// String url = null; +// Map<String,String> resMap = new HashMap<>(); +// resMap.put("fileName",objName); +// try { +// Map<String, String> reqParams = new HashMap<>(); +// reqParams.put("response-content-type", "application/json"); +// url = minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() +// .method(Method.PUT) +// .bucket(minioConfig.getBucketName()) +// .object(minioFloders+objName) +// .expiry(60*2) +// .extraQueryParams(reqParams) +// .build()); +// resMap.put("uploadUrl",url); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// return new ResultVO<>(ResultCodes.OK,resMap); +// } +// +// /** +// * @description 获取文件下载地址 +// */ +// @Override +// public ResultVO viewFile(String fileName){ +// String url = null; +// try { +// url = minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() +// .method(Method.GET) +// .bucket(minioConfig.getBucketName()) +// .object(minioFloders+fileName) +// .expiry(60*5).build()); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// url = minioConfig.getUrlPrefix() + url.substring((url.indexOf("//") + 2)).substring(url.substring((url.indexOf("//") + 2)).indexOf( +// "/")); +// return new ResultVO(ResultCodes.OK,url); +// } +// +// /** +// * @description 删除文件 +// */ +// @Override +// public ResultVO deleteFile(String fileName) { +// try { +// minioClient.removeObject(RemoveObjectArgs.builder() +// .bucket(minioConfig.getBucketName()) +// .object(minioFloders+fileName) +// .build()); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// return new ResultVO<>(ResultCodes.OK); +// } +// +// /** +// * 批量获取文件 +// */ +// public String viewFiles(String fileNames){ +// +// StringBuffer stringBuffer = new StringBuffer(); +// if(StringUtils.isNotBlank(fileNames)){ +// String[] str = fileNames.split(","); +// for (int i = 0; i < str.length; i++) { +// String url = null; +// try { +// url = minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() +// .method(Method.GET) +// .bucket(minioConfig.getBucketName()) +// .object(minioFloders+str[i]) +// .expiry(60*5).build()); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// url = minioConfig.getUrlPrefix() + url.substring((url.indexOf("//") + 2)).substring(url.substring((url.indexOf("//") + 2)).indexOf( +// "/")); +// stringBuffer.append(url).append(","); +// } +// stringBuffer.deleteCharAt(stringBuffer.length() - 1); +// +// } +// return stringBuffer.toString(); +// } +// +//} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRecordServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRecordServiceImpl.java new file mode 100644 index 0000000..a175cc0 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRecordServiceImpl.java @@ -0,0 +1,94 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.specialWork.entity.WorkApplyRecordInfo; +import com.gk.hotwork.specialWork.enums.ProcessOperationEnum; +import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyRecordRespDTO; +import com.gk.hotwork.specialWork.model.query.WorkApplyRecordListQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyRecordListDBQuery; +import com.gk.hotwork.specialWork.service.WorkApplyRecordService; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyRecordInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Service("workApplyRecordService") +public class WorkApplyRecordServiceImpl implements WorkApplyRecordService { + + @Autowired + private WorkApplyRecordInfoService workApplyRecordInfoService; + + + @Override + public void log(ContextCacheUser user, ProcessOperationEnum operation, Long workApplyId, Long currentStepId, String stepName, String content) { + WorkApplyRecordInfo record = new WorkApplyRecordInfo(); + record.setWorkApplyId(workApplyId); + record.setStepId(currentStepId); + record.setStepName(stepName); + record.setOperationTime(LocalDateTime.now()); + record.setOperation(operation.code); + record.setContent(content); + record.setOperatorUid(user.getUid()); + record.setOperatorUname(user.getRealName()); + record.setSysten(Boolean.FALSE); + workApplyRecordInfoService.save(record); + } + + @Override +// @Transactional(propagation = Propagation.NESTED) + public void log(ProcessOperationEnum operation, Long workApplyId, Long currentStepId,String stepName, String content) { + WorkApplyRecordInfo record = new WorkApplyRecordInfo(); + record.setWorkApplyId(workApplyId); + record.setStepId(currentStepId); + record.setStepName(stepName); + record.setOperationTime(LocalDateTime.now()); + record.setOperation(operation.code); + record.setContent(content); + record.setSysten(Boolean.TRUE); + workApplyRecordInfoService.save(record); + } + + @Override + public List<WorkApplyRecordRespDTO> list(ContextCacheUser currentUser, WorkApplyRecordListQuery query) { + if (query.getWorkApplyId() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyRecordListDBQuery dbQuery = new WorkApplyRecordListDBQuery(); + dbQuery.setOperatorName(query.getOperatorName()); + dbQuery.setStepId(query.getStepId()); + dbQuery.setWorkApplyId(query.getWorkApplyId()); + dbQuery.setSystemEnable(query.isSystemEnable()); + List<WorkApplyRecordInfo> dbData = workApplyRecordInfoService.listByConditions(dbQuery); + List<WorkApplyRecordRespDTO> result = new ArrayList<>(dbData.size()); + ProcessOperationEnum operationEnum; + if (dbData.size() > 0) { + WorkApplyRecordRespDTO respDTO; + for (WorkApplyRecordInfo recordInfo : dbData) { + respDTO = new WorkApplyRecordRespDTO(); + respDTO.setId(recordInfo.getId()); + respDTO.setWorkApplyId(recordInfo.getWorkApplyId()); + respDTO.setStepId(recordInfo.getStepId()); + respDTO.setStepName(recordInfo.getStepName()); + respDTO.setOperatorUid(recordInfo.getOperatorUid()); + respDTO.setOperatorUname(recordInfo.getOperatorUname()); + respDTO.setOperationTime(recordInfo.getOperationTime()); + respDTO.setSysten(recordInfo.getSysten()); + respDTO.setOperation(recordInfo.getOperation()); + operationEnum = ProcessOperationEnum.parse(recordInfo.getOperation()); + if (operationEnum != null) { + respDTO.setOperationDesc(operationEnum.value); + } + respDTO.setContent(recordInfo.getContent()); + result.add(respDTO); + } + } + return result; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRocketMQServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRocketMQServiceImpl.java new file mode 100644 index 0000000..bbf54d2 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyRocketMQServiceImpl.java @@ -0,0 +1,55 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.specialWork.service.WorkApplyRocketMQService; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.client.producer.SendStatus; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.support.TransactionSynchronizationAdapter; + +/** + * 发送作业申请消息 + */ +@Service +public class WorkApplyRocketMQServiceImpl implements WorkApplyRocketMQService { + + private Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Value("${rocketmq.topic.applySpecialWorkTopic}") + private String applySpecialWorkTopic; + @Autowired + private RocketMQTemplate rocketMQTemplate; + + /** + * 事务提交后发送MQ + * @param message + * @param <T> + */ + public <T> void syncSend(T message) { + // 是否开启事务判断 + if (org.springframework.transaction.support.TransactionSynchronizationManager.isSynchronizationActive()) { + org.springframework.transaction.support.TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() { + @Override + public void afterCommit() { + SendResult sendResult = rocketMQTemplate.syncSend(applySpecialWorkTopic, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + logger.error("【特殊作业】作业申请发送rocketMQ消息失败!"+message); + }else { + logger.info("【特殊作业】作业申请发送rocketMQ消息成功!"+message); + } + } + }); + } else { + SendResult sendResult = rocketMQTemplate.syncSend(applySpecialWorkTopic, message); + if(sendResult.getSendStatus() != SendStatus.SEND_OK){ + logger.error("【特殊作业】作业申请发送rocketMQ消息失败!"+message); + }else { + logger.info("【特殊作业】作业申请发送rocketMQ消息成功!"+message); + } + } + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyServiceImpl.java new file mode 100644 index 0000000..c5f12b1 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkApplyServiceImpl.java @@ -0,0 +1,2873 @@ +package com.gk.hotwork.specialWork.service.impl; + +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Utils.RPCUtils; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Domain.dto.UserInfoRPCRespDTO; + +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Service.Middle.AccountAuthService; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.model.bo.*; +import com.gk.hotwork.specialWork.model.dto.req.*; +import com.gk.hotwork.specialWork.model.dto.resp.*; +import com.gk.hotwork.specialWork.model.query.AllWorkApplyPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyApplyingPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkApplyPendingPageQuery; +import com.gk.hotwork.specialWork.model.query.db.AllWorkApplyPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyApplyingPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkApplyPendingPageDBQuery; +import com.gk.hotwork.specialWork.mq.msg.ApplySpecialWorkMsg; +import com.gk.hotwork.specialWork.mq.msg.ApprovalSpecialWorkMsg; +import com.gk.hotwork.specialWork.service.*; +import com.gk.hotwork.specialWork.service.baseService.*; + +import org.redisson.api.RLock; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +@Service("workApplyService") +public class WorkApplyServiceImpl implements WorkApplyService { + + @Autowired + private AccountAuthService accountUserService; + @Autowired + private AccountDepartmentService accountDepartmentService; + @Autowired + private WorkApplyInfoService workApplyInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + @Autowired + private WorkApprovalRuleInfoService workApprovalRuleInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkApprovalItemStandInfoService workApprovalItemStandInfoService; + @Autowired + private RuleService ruleService; + @Autowired + private ApprovalRuleStepService approvalRuleStepService; + @Autowired + private ApprovalRuleUnitService approvalRuleUnitService; + @Autowired + private ApprovalRuleUnitItemService approvalRuleUnitItemService; + @Autowired + private ApprovalRuleStandService approvalRuleStandService; + @Autowired + private ApprovalRuleItemMeasureService approvalRuleItemMeasureService; + @Autowired + private WorkHotInfoService workHotInfoService; + + @Autowired + private WorkConfinedSpaceInfoService workConfinedSpaceInfoService; + + @Autowired + private WorkAtHeightInfoService workAtHeightInfoService; + + @Autowired + private WorkBrokenCircuitInfoService workBrokenCircuitInfoService; + + @Autowired + private WorkTemporaryPowerInfoService workTemporaryPowerInfoService; + + @Autowired + private WorkHoistingInfoService workHoistingInfoService; + + @Autowired + private WorkBlindPlatePluggingInfoService workBlindPlatePluggingInfoService; + + @Autowired + private WorkGroundBreakingInfoService workGroundBreakingInfoService; + + @Autowired + private WorkApplyRocketMQService workApplyRocketMQService; + + @Autowired + private ApprovalWorkRocketMQService approvalWorkRocketMQService; + + @Autowired + private WorkApplyRecordService workApplyRecordService; + + @Autowired + private WorkPrintService workPrintService; + + +// @Value("${rocketmq.topic.applySpecialWorkTopic}") +// private String applySpecialWorkTopic; +// +// @Value("${rocketmq.topic.approvalSpecialWorkTopic}") +// private String approvalSpecialWorkTopic; +// +// @Autowired +// private RocketMQSpecialWorkTemplateHelper rocketMQSpecialWorkTemplateHelper; + +// @Autowired +// private SpecialWorkMinoService specialWorkMinoService; + + + @Autowired + private RedissonClient redissonClient; + + + @Override + @Transactional + public void workApply(ContextCacheUser currentUser, WorkApplyReqDTO< ? extends WorkApplyEight> applyReqDTO) { + // 0.基本判断 + if (applyReqDTO.getWorkLevel() == null || + applyReqDTO.getWorkType() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + if (StringUtils.isBlank(applyReqDTO.getWorkContent())) { + throw new BusinessException(E.DATA_PARAM_NULL, "作业内容不能为空"); + } + if (StringUtils.isBlank(applyReqDTO.getWorkLocation())) { + throw new BusinessException(E.DATA_PARAM_NULL, "作业地点不能为空"); + } + if (StringUtils.isBlank(applyReqDTO.getHazardIdentification())) { + throw new BusinessException(E.DATA_PARAM_NULL, "危险辨识不能为空"); + } + if (StringUtils.isBlank(applyReqDTO.getOperatorUnames())) { + throw new BusinessException(E.DATA_PARAM_NULL, "作业人不能为空"); + } + if (StringUtils.isBlank(applyReqDTO.getOperatorCompanys())) { + throw new BusinessException(E.DATA_PARAM_NULL, "作业单位不能为空"); + } + if (applyReqDTO.getExpEndTime() == null || applyReqDTO.getExpStartTime() == null) { + throw new BusinessException(E.DATA_PARAM_NULL, "时间不能为空"); + } + //获取当前时间 + LocalDateTime applyTime = LocalDateTime.now(); + if(applyTime.isAfter(applyReqDTO.getExpStartTime())){ + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业开始时间不可早于作业申请时间"); + } + if (applyReqDTO.getExpStartTime().isAfter(applyReqDTO.getExpEndTime())) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "时间区间非法"); + } + WorkTypeEnum workTypeEnum = WorkTypeEnum.parse(applyReqDTO.getWorkType()); + if (workTypeEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业类型非法"); + } + WorkLevelEnum workLevelEnum = WorkLevelEnum.parse(applyReqDTO.getWorkLevel()); + if (workLevelEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业等级非法"); + } +// if (applyReqDTO.getOperatorUids().size() == 0) { +// throw new BusinessException(E.DATA_PARAM_NULL, "请选择作业人"); +// } + if (applyReqDTO.getWorkDetail() == null) { + throw new BusinessException(E.DATA_PARAM_NULL, "请填写作业主体内容"); + } + // 检查八大作业 + WorkTypeMatchDetailCheck(workTypeEnum, applyReqDTO.getWorkDetail()); + // 该部门下获取审批流 + Long depId = currentUser.getDepId(); +// List<UserInfoRPCRespDTO> rpcUsers; +// List<Long> operatorUids = applyReqDTO.getOperatorUids(); +// ResultVO<List<UserInfoRPCRespDTO>> rpcOperatorsResult = accountUserService.listUserInfoByUids(operatorUids); +// if (rpcOperatorsResult.getCode().equals(ResultCodes.OK.getCode())) { +// if (rpcOperatorsResult.getData() != null) { +// rpcUsers = RPCUtils.castList(rpcOperatorsResult.getData(), UserInfoRPCRespDTO.class); +// if (rpcUsers.size() != operatorUids.size()) { +// throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业人不存在"); +// } +// +// }else{ +// throw new BusinessException(ResultCodes.RPC_DATA_NULL); +// } +// }else{ +// throw new BusinessException(rpcOperatorsResult.getCode(), rpcOperatorsResult.getMsg()); +// } +// // 判断作业人员是否是部门或者子部门的人员 +// ResultVO<Boolean> rpcResult = accountDepartmentService.isSelfOrSubDep(depId, operator.getDepId()); +// if (rpcResult.getCode().equals(ResultCodes.OK.getCode())) { +// if (rpcResult.getData() != null) { +//// if (!(Boolean) rpcResult.getData()) { +//// throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "作业人部门越界"); +//// } +//// }else{ +//// throw new BusinessException(ResultCodes.RPC_DATA_NULL); +//// } +// }else{ +// throw new BusinessException(rpcOperatorResult.getCode(), rpcOperatorResult.getMsg()); +// } + // 1.递归寻找部门的审批规则 + ApprovalRuleBO ruleBO = ruleService.recursiveQueryRule(depId, applyReqDTO.getWorkType(), applyReqDTO.getWorkLevel()); + if (ruleBO == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "无可用审批流"); + } + + // 2.准备工作 + + // 2.1 workApprovalUStep + // 根据 approvalRuleId 获取各个层级 + List<ApprovalRuleStep> ruleSteps = approvalRuleStepService.listApprovalRuleStepByRuleId(ruleBO.getRuleId()); + if (ruleSteps.size() < 1) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批规则非法,审批层级不存在"); + } + // 2.2 workApprovalUnit 获取各个单元 + List<ApprovalRuleUnit> ruleUnits = approvalRuleUnitService.listApprovalUnitByRuleId(ruleBO.getRuleId()); + // 2.3 workApprovalItem 获取各个审批项 + List<ApprovalRuleUnitItem> ruleUnitItems = approvalRuleUnitItemService.listApprovalRuleUnitItemByRuleId(ruleBO.getRuleId()); + + // 1.workApply + WorkApplyInfo applyEntity = new WorkApplyInfo(); + applyEntity.setId(IdUtil.getSnowflake(0,0).nextId()); + applyEntity.setDepId(currentUser.getDepId()); + applyEntity.setApplyUid(currentUser.getUid()); + applyEntity.setApplyUname(currentUser.getRealName()); + applyEntity.setDepName(currentUser.getDepName()); + applyEntity.setWorkType(applyReqDTO.getWorkType()); + applyEntity.setWorkLevel(applyReqDTO.getWorkLevel()); + // 申请中状态暂定 当前创建就进入审批中 + applyEntity.setStatus(WorkStatusEnum.STATU_IN_APPROVAL.getStatus()); + applyEntity.setApplyTime(applyTime); + applyEntity.setExpStartTime(applyReqDTO.getExpStartTime()); + applyEntity.setExpEndTime(applyReqDTO.getExpEndTime()); + applyEntity.setGmtCreate(LocalDateTime.now()); + applyEntity.setWorkContent(applyReqDTO.getWorkContent()); + applyEntity.setWorkLocation(applyReqDTO.getWorkLocation()); + applyEntity.setHazardIdentification(applyReqDTO.getHazardIdentification()); + applyEntity.setOperatorUnames(applyReqDTO.getOperatorUnames()); + applyEntity.setOperatorCompanys(applyReqDTO.getOperatorCompanys()); + +// // operator +// List<WorkApplyOperatorInfo> operatorEntities = new ArrayList<>(rpcUsers.size()); +// WorkApplyOperatorInfo operatorEntity; +// for (UserInfoRPCRespDTO respDTO : rpcUsers) { +// operatorEntity = new WorkApplyOperatorInfo(); +// operatorEntity.setId(IdUtil.getSnowflake(0, 0).nextId()); +// operatorEntity.setOperatorUid(respDTO.getUid()); +// operatorEntity.setOperatorUname(respDTO.getRealName()); +// operatorEntity.setOperatorIdentify(respDTO.getIdentify()); +// operatorEntity.setOperatorPhone(respDTO.getPhone()); +// operatorEntity.setWorkApplyId(applyEntity.getId()); +// operatorEntities.add(operatorEntity); +// } + + // rule + WorkApprovalRuleInfo ruleEntity = new WorkApprovalRuleInfo(); + ruleEntity.setId(IdUtil.getSnowflake(0,0).nextId()); + ruleEntity.setApprovalRuleId(ruleBO.getRuleId()); + ruleEntity.setApprovalRuleName(ruleBO.getRuleName()); + ruleEntity.setDepId(ruleBO.getDepId()); + ruleEntity.setDepName(ruleBO.getDepName()); + ruleEntity.setWorkLevel(ruleBO.getWorkLevel()); + ruleEntity.setWorkType(ruleBO.getWorkType()); + ruleEntity.setWorkApplyId(applyEntity.getId()); + + // step + List<WorkApprovalStepInfoBO> ruleStepBOs = new ArrayList<>(ruleSteps.size()); + WorkApprovalStepInfoBO ruleStepBO; + for (int i = 0; i < ruleSteps.size(); i++) { + ApprovalRuleStep ruleStep = ruleSteps.get(i); + ruleStepBO = new WorkApprovalStepInfoBO(); + ruleStepBO.setId(IdUtil.getSnowflake(0, 0).nextId()); + ruleStepBO.setStepSerial(ruleStep.getStepSerial()); + ruleStepBO.setType(ruleStep.getType()); + ruleStepBO.setOriginalPreStepId(ruleStep.getPreStepId()); + ruleStepBO.setWorkApplyId(applyEntity.getId()); + ruleStepBO.setOriginalId(ruleStep.getStepId()); + ruleStepBO.setContinueTime(ruleStep.getContinueTime()); + ruleStepBO.setContinueTimeUnit(ruleStep.getContinueTimeUnit()); + ruleStepBO.setStepName(ruleStep.getStepName()); + ruleStepBO.setAuditType(ruleStep.getAuditType()); + if (ruleStep.getPreStepId() == null) { + applyEntity.setApprovalStepId(ruleStepBO.getId()); + } + ruleStepBOs.add(ruleStepBO); + if (i == 0) { + ruleStepBO.setApprovalResult(WorkApprovalStepResultEnum.RESULT_IN_APPROVAL.getResult()); + ruleStepBO.setStartApprovalTime(LocalDateTime.now()); + }else{ + ruleStepBO.setApprovalResult(WorkApprovalStepResultEnum.WAIT_TO_START.getResult()); + } + + } + // 整理ruleStepEntities + if (ruleStepBOs.size() > 1) { + ruleStepBOs = this.tidyRuleStepEntities(ruleStepBOs); + } + + // 2.unit + List<WorkApprovalUnitInfoBO> unitBOs = new ArrayList<>(ruleUnits.size()); + WorkApprovalUnitInfoBO unitBO; + for (int i = 0; i < ruleStepBOs.size(); i++) { + WorkApprovalStepInfoBO ruleStepInfo = ruleStepBOs.get(i); + List<ApprovalRuleUnit> stepUnits = ruleUnits.stream().filter(approvalRuleUnit -> + // 当前层级的单元 + ruleStepInfo.getOriginalId().equals(approvalRuleUnit.getStepId())) + // 集合 + .collect(Collectors.toList()); + if (stepUnits.size() == 0) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "层级单元个数为0,请检查审批规则"); + } + for (ApprovalRuleUnit ruleUnit : stepUnits) { + unitBO = new WorkApprovalUnitInfoBO(); + unitBO.setId(IdUtil.getSnowflake(0, 0).nextId()); + unitBO.setStepId(ruleStepInfo.getId()); + unitBO.setApprovalUid(ruleUnit.getBindUid()); + unitBO.setApprovalUname(ruleUnit.getBindUname()); + unitBO.setOriginalId(ruleUnit.getUnitId()); + unitBO.setWorkApplyId(applyEntity.getId()); + // 第一个层级的单元开始审批 + if (i == 0) { + unitBO.setResult(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()); + }else{ + unitBO.setResult(WorkApprovalUnitResultEnum.WAIT_TO_START.getResult()); + } + unitBOs.add(unitBO); + } + } + + // 3.item + List<WorkApprovalItemInfoBO> itemBOs = new ArrayList<>(ruleUnitItems.size()); + WorkApprovalItemInfoBO itemBO; + for (WorkApprovalStepInfoBO ruleStepInfo : ruleStepBOs) { + List<ApprovalRuleUnitItem> unitItems = ruleUnitItems.stream().filter(ruleUnitItem -> + // 当前单元的审批项 + ruleStepInfo.getOriginalId().equals(ruleUnitItem.getStepId())) + // 集合 + .collect(Collectors.toList()); + if (unitItems.size() == 0) { + // 不包含审批项 <=> 填报单元就行 + ruleStepInfo.setContainItem(Boolean.FALSE); + }else{ + ruleStepInfo.setContainItem(Boolean.TRUE); + for (ApprovalRuleUnitItem unitItem : unitItems) { + itemBO = new WorkApprovalItemInfoBO(); + itemBO.setId(IdUtil.getSnowflake(0, 0).nextId()); + itemBO.setItemName(unitItem.getItemName()); + itemBO.setType(unitItem.getType()); + itemBO.setStepId(ruleStepInfo.getId()); + itemBO.setOriginalStandId(unitItem.getStandId()); + itemBO.setOriginalMeasureId(unitItem.getMeasureId()); + itemBO.setOriginalId(unitItem.getId()); + itemBO.setWorkApplyId(applyEntity.getId()); + itemBOs.add(itemBO); + } + } + + } + + // 4.item measure + Set<Long> measureIdSet = new HashSet<>(); + Set<Long> standIdSet = new HashSet<>(); + for (WorkApprovalItemInfoBO itemInfo : itemBOs) { + // 获取 itemBO 的 measures + if (itemInfo.getOriginalMeasureId() != null) { + measureIdSet.add(itemInfo.getOriginalMeasureId()); + } + // 获取 itemBO 的 stands + if (itemInfo.getOriginalStandId() != null) { + standIdSet.add(itemInfo.getOriginalStandId()); + } + } + + List<WorkApprovalItemMeasureInfo> measureEntities = new ArrayList<>(measureIdSet.size()); + Map<Long, WorkApprovalItemMeasureInfo> measureMap = new HashMap<>(measureIdSet.size()); + if (measureIdSet.size() > 0) { + List<ApprovalRuleItemMeasureDO> measures = approvalRuleItemMeasureService.listItemMeasureByIds(measureIdSet); + WorkApprovalItemMeasureInfo measureEntity; + for (ApprovalRuleItemMeasureDO measure : measures) { + measureEntity = new WorkApprovalItemMeasureInfo(); + measureEntity.setId(IdUtil.getSnowflake(0, 0).nextId()); + measureEntity.setContext(measure.getContext()); + measureEntity.setCorrectVal(measure.getCorrectVal()); + measureEntity.setType(measure.getType()); + measureEntity.setWorkType(measure.getWorkType()); + measureEntity.setWorkApplyId(applyEntity.getId()); + measureEntities.add(measureEntity); + measureMap.put(measure.getId(), measureEntity); + } + } + List<WorkApprovalItemStandInfo> standEntities = new ArrayList<>(standIdSet.size()); + Map<Long, WorkApprovalItemStandInfo> standMap = new HashMap<>(standIdSet.size()); + if (standIdSet.size() > 0) { + List<ApprovalRuleItemStandDO> stands = approvalRuleStandService.listItemStandByIds(standIdSet); + WorkApprovalItemStandInfo standEntity; + for (ApprovalRuleItemStandDO stand : stands) { + standEntity = new WorkApprovalItemStandInfo(); + standEntity.setId(IdUtil.getSnowflake(0, 0).nextId()); + standEntity.setDepId(stand.getDepId()); + standEntity.setMaxVal(stand.getMaxVal()); + standEntity.setMaxValMatchPattern(stand.getMaxValMatchPattern()); + standEntity.setMinVal(stand.getMinVal()); + standEntity.setMinValMatchPattern(stand.getMinValMatchPattern()); + standEntity.setTitle(stand.getTitle()); + standEntity.setType(stand.getType()); + standEntity.setWorkApplyId(applyEntity.getId()); + standEntities.add(standEntity); + standMap.put(stand.getId(), standEntity); + + } + } + + for (WorkApprovalItemInfoBO itemInfo : itemBOs) { + if (itemInfo.getOriginalMeasureId() != null) { + WorkApprovalItemMeasureInfo measureInfo = measureMap.get(itemInfo.getOriginalMeasureId()); + if (measureInfo != null) { + itemInfo.setMeasureId(measureInfo.getId()); + } + } + if (itemInfo.getOriginalStandId() != null) { + WorkApprovalItemStandInfo standInfo = standMap.get(itemInfo.getOriginalStandId()); + if (standInfo != null) { + itemInfo.setStandId(standInfo.getId()); + } + } + } + + //数据库入库 + // execute + + //加分布式锁 + RLock lock = redissonClient.getLock("LOCK_WORK_APPLY"); + try { + lock.lock(10, TimeUnit.SECONDS); + //生成作业编号 + int workCount = workApplyInfoService.countWorkApplyInfo(); + applyEntity.setWorkPermitNo(this.generateWorkCode(workCount)); + + // 八大作业子表 + WorkTypeMatchDetailSave(workTypeEnum,applyEntity, applyReqDTO.getWorkDetail(),currentUser); + // 作业申请 + workApplyInfoService.saveWorkApplyInfo(applyEntity); +// // 操作人 +// workApplyOperatorInfoService.saveBatchOperator(operatorEntities); + // 规则 + workApprovalRuleInfoService.saveRule(ruleEntity); + // 层级 + workApprovalStepInfoService.saveBatchRuleStep(ruleStepBOs.stream().map( + // 强转实体类 + item -> (WorkApprovalStepInfo) item) + // 集合 + .collect(Collectors.toList())); + // 单元 + workApprovalUnitInfoService.saveBatchRuleUnit(unitBOs.stream().map( + // 强转实体类 + item -> (WorkApprovalUnitInfo) item) + // 集合 + .collect(Collectors.toList())); + + // 审批项 + if (itemBOs.size() > 0) { + workApprovalItemInfoService.saveBatchRuleItem(itemBOs.stream().map( + // 强转实体类 + item -> (WorkApprovalItemInfo) item) + // 集合 + .collect(Collectors.toList())); + } + + // 安全措施 + if (measureEntities.size() > 0) { + workApprovalItemMeasureInfoService.saveBatchMeasure(measureEntities); + } + // 标准 + if (standEntities.size() > 0) { + workApprovalItemStandInfoService.saveBatchStand(standEntities); + } + + workApplyRecordService.log(currentUser, ProcessOperationEnum.APPLY, applyEntity.getId(), null, null, null); + //创建成功,释放锁 + lock.unlock(); + //发送延时消息 + ApplySpecialWorkMsg applySpecialWorkMsg = new ApplySpecialWorkMsg(); + applySpecialWorkMsg.setWorkApplyId(applyEntity.getId()); + applySpecialWorkMsg.setExpStartTime(conversionTimeType(applyEntity.getExpStartTime())); + approvalWorkRocketMQService.syncSend(applySpecialWorkMsg); + } catch (BusinessException e) { + e.printStackTrace(); + throw new BusinessException(e.getCode(), e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + throw new BusinessException(ResultCodes.SERVER_ERROR); + } finally { + if(lock.isLocked()){ + lock.unlock(); + } + } + } + + private void WorkTypeMatchDetailSave(WorkTypeEnum workTypeEnum,WorkApplyInfo applyEntity, Object workDetail,ContextCacheUser currentUser) { + switch (workTypeEnum) { + case WORK_FIRE: + if (workDetail instanceof WorkApplyHotReqDTO) { + WorkApplyHotReqDTO workApplyHotReqDTO = ((WorkApplyHotReqDTO) workDetail); + WorkHotInfo workHotInfo = new WorkHotInfo(); + workHotInfo.setWorkApplyId(applyEntity.getId()); + workHotInfo.setId(IdUtil.getSnowflake(0,0).nextId()); + workHotInfo.setHotMethod(workApplyHotReqDTO.getHotMethod()); + workHotInfo.setOtherSpecialWork(workApplyHotReqDTO.getOtherSpecialWork()); + workHotInfoService.save(workHotInfo); + applyEntity.setWorkDetailId(workHotInfo.getId()); + } + break; + case WORK_HANG: + if (workDetail instanceof WorkApplyHoistingReqDTO) { + WorkApplyHoistingReqDTO reqDTO = ((WorkApplyHoistingReqDTO) workDetail); + WorkHoistingInfo vo = new WorkHoistingInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setHoistingToolName(reqDTO.getHoistingToolName()); + vo.setWeightMass(reqDTO.getWeightMass()); + workHoistingInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_DIF_SOLI: + if (workDetail instanceof WorkApplyGroundBreakingReqDTO) { + WorkApplyGroundBreakingReqDTO reqDTO = ((WorkApplyGroundBreakingReqDTO) workDetail); + WorkGroundBreakingInfo vo = new WorkGroundBreakingInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setOperationDepId(reqDTO.getOperationDepId()); + vo.setGbMethod(reqDTO.getGbMethod()); + vo.setGbScope(reqDTO.getGbScope()); + vo.setGbPath(reqDTO.getGbPath()); + vo.setOtherSpecialWork(reqDTO.getOtherSpecialWork()); + workGroundBreakingInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_BROKE_ROAD: + if (workDetail instanceof WorkApplyBrokenCircuitReqDTO) { + WorkApplyBrokenCircuitReqDTO reqDTO = ((WorkApplyBrokenCircuitReqDTO) workDetail); + WorkBrokenCircuitInfo vo = new WorkBrokenCircuitInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setOperationDepId(reqDTO.getOperationDepId()); + vo.setBcReason(reqDTO.getBcReason()); + vo.setBcExplain(reqDTO.getBcExplain()); + vo.setBcPath(reqDTO.getBcPath()); + vo.setInvolvedDepIds(reqDTO.getInvolvedDepIds()); + workBrokenCircuitInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_HIGH_SPACE: + if (workDetail instanceof WorkApplyAtHighReqDTO) { + WorkApplyAtHighReqDTO reqDTO = ((WorkApplyAtHighReqDTO) workDetail); + WorkAtHeightInfo vo = new WorkAtHeightInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setOperationDepId(reqDTO.getOperationDepId()); + vo.setOperationHeight(reqDTO.getOperationHeight()); + vo.setOtherSpecialWork(reqDTO.getOtherSpecialWork()); + workAtHeightInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_BLIND_PLATE: + if (workDetail instanceof WorkApplyBlindPlatePluggingReqDTO) { + WorkApplyBlindPlatePluggingReqDTO reqDTO = ((WorkApplyBlindPlatePluggingReqDTO) workDetail); + WorkBlindPlatePluggingInfo vo = new WorkBlindPlatePluggingInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setBpCode(reqDTO.getBpCode()); + vo.setMainMedia(reqDTO.getMainMedia()); + vo.setTemperature(reqDTO.getTemperature()); + vo.setPressure(reqDTO.getPressure()); + vo.setBpMaterialQuality(reqDTO.getBpMaterialQuality()); + vo.setBpSpecification(reqDTO.getBpSpecification()); + vo.setBpLocation(reqDTO.getBpLocation()); + vo.setBpLocationMapPath(reqDTO.getBpLocationMapPath()); + vo.setInstallBpTime(reqDTO.getInstallBpTime()); + vo.setUninstallBpTime(reqDTO.getUninstallBpTime()); + vo.setOtherSpecialWork(reqDTO.getOtherSpecialWork()); + workBlindPlatePluggingInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_CLOSE_SPACE: + if (workDetail instanceof WorkApplyConfinedSpaceReqDTO) { + WorkApplyConfinedSpaceReqDTO reqDTO = ((WorkApplyConfinedSpaceReqDTO) workDetail); + WorkConfinedSpaceInfo vo = new WorkConfinedSpaceInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setCsDepId(reqDTO.getCsDepId()); + vo.setCsName(reqDTO.getCsName()); + vo.setCsOriginalName(reqDTO.getCsOriginalName()); + vo.setOtherSpecialWork(reqDTO.getOtherSpecialWork()); + workConfinedSpaceInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + case WORK_TEMP_ELECTRIC: + if (workDetail instanceof WorkApplyTemporaryPowerReqDTO) { + WorkApplyTemporaryPowerReqDTO reqDTO = ((WorkApplyTemporaryPowerReqDTO) workDetail); + WorkTemporaryPowerInfo vo = new WorkTemporaryPowerInfo(); + vo.setWorkApplyId(applyEntity.getId()); + vo.setId(IdUtil.getSnowflake(0,0).nextId()); + vo.setPowerAccessPoint(reqDTO.getPowerAccessPoint()); + vo.setWorkingVoltage(reqDTO.getWorkingVoltage()); + vo.setEquipmentAndPower(reqDTO.getEquipmentAndPower()); + workTemporaryPowerInfoService.save(vo); + applyEntity.setWorkDetailId(vo.getId()); + } + break; + default: + { + throw new RuntimeException(); + } +// throw new BusinessException(ResultCodes.SERVER_ERROR); + } + } + + private void WorkTypeMatchDetailCheck(WorkTypeEnum workTypeEnum, Object workDetail) { + switch (workTypeEnum) { + case WORK_FIRE: + if (workDetail instanceof WorkApplyHotReqDTO) { + checkHotReqDTO((WorkApplyHotReqDTO) workDetail); + } + break; + case WORK_CLOSE_SPACE: + if (workDetail instanceof WorkApplyConfinedSpaceReqDTO) { + checkConfinedSpaceReqDTO((WorkApplyConfinedSpaceReqDTO) workDetail); + } + case WORK_HANG: + if (workDetail instanceof WorkApplyHoistingReqDTO) { + checkHostingReqDTO((WorkApplyHoistingReqDTO) workDetail); + } + break; + case WORK_DIF_SOLI: + if (workDetail instanceof WorkApplyGroundBreakingReqDTO) { + checkGroundBreakingReqDTO((WorkApplyGroundBreakingReqDTO) workDetail); + } + break; + case WORK_BROKE_ROAD: + if (workDetail instanceof WorkApplyBrokenCircuitReqDTO) { + checkBrokenCircuitReqDTO((WorkApplyBrokenCircuitReqDTO) workDetail); + } + break; + case WORK_HIGH_SPACE: + if (workDetail instanceof WorkApplyAtHighReqDTO) { + checkAtHighReqDTO((WorkApplyAtHighReqDTO) workDetail); + } + break; + case WORK_TEMP_ELECTRIC: + if (workDetail instanceof WorkApplyTemporaryPowerReqDTO) { + checkTemporaryPowerReqDTO((WorkApplyTemporaryPowerReqDTO) workDetail); + } + break; + case WORK_BLIND_PLATE: + if (workDetail instanceof WorkApplyBlindPlatePluggingReqDTO) { + checkBlindPlatePluggingReqDTO((WorkApplyBlindPlatePluggingReqDTO) workDetail); + } + break; + + } + } + //动土作业 + private void checkGroundBreakingReqDTO(WorkApplyGroundBreakingReqDTO workDetail) { + if(null == workDetail.getOperationDepId()){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业单位不能为空"); + } + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null,workDetail.getOperationDepId()); + DepInfoRPCRespDTO depInfoByDepId= (DepInfoRPCRespDTO)resultVO.getData(); + if (null == depInfoByDepId) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业单位不存在"); + } + if(StringUtils.isBlank(workDetail.getGbScope())){ + throw new BusinessException(E.DATA_PARAM_NULL, "动土范围不能为空"); + } + if(null == workDetail.getGbMethod()){ + throw new BusinessException(E.DATA_PARAM_NULL, "动土方式不能为空"); + } + if(StringUtils.isBlank(workDetail.getGbPath())){ + throw new BusinessException(E.DATA_PARAM_NULL, "图片路径不能为空"); + } + } + + //临时用电作业 + private void checkTemporaryPowerReqDTO(WorkApplyTemporaryPowerReqDTO workDetail) { + if(StringUtils.isBlank(workDetail.getPowerAccessPoint())){ + throw new BusinessException(E.DATA_PARAM_NULL, "电源接入点不能为空"); + } + if(null == workDetail.getWorkingVoltage()){ + throw new BusinessException(E.DATA_PARAM_NULL, "起吊物体质量不能为空"); + } + if(StringUtils.isBlank(workDetail.getEquipmentAndPower())){ + throw new BusinessException(E.DATA_PARAM_NULL, "用电设备及功率不能为空"); + } + } + + //吊装作业 + private void checkHostingReqDTO(WorkApplyHoistingReqDTO workDetail) { + if(StringUtils.isBlank(workDetail.getHoistingToolName())){ + throw new BusinessException(E.DATA_PARAM_NULL, "吊装工具名称不能为空"); + } + if(null == workDetail.getWeightMass()){ + throw new BusinessException(E.DATA_PARAM_NULL, "起吊物体质量不能为空"); + } + } + + //断路作业 + private void checkBrokenCircuitReqDTO(WorkApplyBrokenCircuitReqDTO workDetail) { + if(null == workDetail.getOperationDepId()){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业单位不能为空"); + } + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null,workDetail.getOperationDepId()); + DepInfoRPCRespDTO depInfoByDepId= (DepInfoRPCRespDTO)resultVO.getData(); + if (null == depInfoByDepId) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业单位不存在"); + } + if(StringUtils.isBlank(workDetail.getBcReason())){ + throw new BusinessException(E.DATA_PARAM_NULL, "断路地段原因不能为空"); + } + if(StringUtils.isBlank(workDetail.getBcExplain())){ + throw new BusinessException(E.DATA_PARAM_NULL, "断路地段说明不能为空"); + } + // todo 图片上传 + if(StringUtils.isBlank(workDetail.getBcPath())){ + throw new BusinessException(E.DATA_PARAM_NULL, "断路地段图片路径不能为空"); + } + if(StringUtils.isBlank(workDetail.getInvolvedDepIds())){ + throw new BusinessException(E.DATA_PARAM_NULL, "涉及相关部门不能为空"); + } + } + + //高处作业 + private void checkAtHighReqDTO(WorkApplyAtHighReqDTO workDetail) { + if(null == workDetail.getOperationDepId()){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业单位不能为空"); + } + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null,workDetail.getOperationDepId()); + DepInfoRPCRespDTO depInfoByDepId= (DepInfoRPCRespDTO)resultVO.getData(); + if (null == depInfoByDepId) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业单位不存在"); + } + if(null == workDetail.getOperationHeight()){ + throw new BusinessException(E.DATA_PARAM_NULL, "作业高度不能为空"); + } + } + + //盲板抽都作业 + private void checkBlindPlatePluggingReqDTO(WorkApplyBlindPlatePluggingReqDTO workDetail) { + if(StringUtils.isBlank(workDetail.getBpCode())){ + throw new BusinessException(E.DATA_PARAM_NULL, "盲板编号不能为空"); + } + if(StringUtils.isBlank(workDetail.getMainMedia())){ + throw new BusinessException(E.DATA_PARAM_NULL, "主要介质不能为空"); + } + if(null == workDetail.getTemperature()){ + throw new BusinessException(E.DATA_PARAM_NULL, "温度不能为空"); + } + if(null == workDetail.getPressure()){ + throw new BusinessException(E.DATA_PARAM_NULL, "压力不能为空"); + } + if(StringUtils.isBlank(workDetail.getBpMaterialQuality())){ + throw new BusinessException(E.DATA_PARAM_NULL, "盲板材质不能为空"); + } + if(StringUtils.isBlank(workDetail.getBpSpecification())){ + throw new BusinessException(E.DATA_PARAM_NULL, "盲板规格不能为空"); + } + if(StringUtils.isBlank(workDetail.getBpLocation())){ + throw new BusinessException(E.DATA_PARAM_NULL, "盲板位置不能为空"); + } + if(StringUtils.isBlank(workDetail.getBpLocationMapPath())){ + throw new BusinessException(E.DATA_PARAM_NULL, "盲板位置图路径不能为空"); + } + if(null == workDetail.getInstallBpTime()){ + throw new BusinessException(E.DATA_PARAM_NULL, "装盲板时间不能为空"); + } + if(null == workDetail.getUninstallBpTime()){ + throw new BusinessException(E.DATA_PARAM_NULL, "拆盲板时间不能为空"); + } + + + + } + + //受限空间验证 + private void checkConfinedSpaceReqDTO(WorkApplyConfinedSpaceReqDTO workDetail) { + // 受限空间所属单位 + if(null == workDetail.getCsDepId()){ + throw new BusinessException(E.DATA_PARAM_NULL, "受限空间所属单位不能为空"); + } + ResultVO<DepInfoRPCRespDTO> resultVO = accountDepartmentService.getDepInfoByDepId(null,workDetail.getCsDepId()); + DepInfoRPCRespDTO depInfoByDepId= (DepInfoRPCRespDTO)resultVO.getData(); + if (null == depInfoByDepId) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "受限空间所属单位不存在"); + } + // 受限空间名称 + if (StringUtils.isBlank(workDetail.getCsName())) { + throw new BusinessException(E.DATA_PARAM_NULL, "受限空间名称不能为空"); + } + // 受限空间内原有介质名称 + if (StringUtils.isBlank(workDetail.getCsOriginalName())) { + throw new BusinessException(E.DATA_PARAM_NULL, "受限空间内原有介质名称不能为空"); + } + + } + + private void checkHotReqDTO(WorkApplyHotReqDTO workDetail) { + // 动火方式 + if (StringUtils.isBlank(workDetail.getHotMethod())) { + throw new BusinessException(E.DATA_PARAM_NULL, "动火方式不能为空"); + } + + } + + @Override + @Transactional + public void cancelWorkApply(ContextCacheUser currentUser, Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(workApplyId); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + if (!workApplyInfo.getApplyUid().equals(currentUser.getUid())) { + throw new BusinessException(E.DATA_OPERATION_NO_PERMISSION, "需要本人取消申请"); + } + if (!workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_IN_APPROVAL.getStatus())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID, "申请单只有在审批中状态时才可以退回"); + } + + List<WorkApprovalUnitInfo> currentStepUnits = workApprovalUnitInfoService.listApprovalRuleUnitByStepId(workApplyInfo.getApprovalStepId()); + List<Long> unitIds= currentStepUnits.stream().filter(unit -> + unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()) || + unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT.getResult())) + // id + .map(WorkApprovalUnitInfo::getId) + // 集合 + .collect(Collectors.toList()); + if (unitIds.size() > 0) { + // 单元审批中断 + workApprovalUnitInfoService.updateStatusByIds(unitIds, WorkApprovalUnitResultEnum.RESULT_INTERRUPTED); + } + // 审批层级终止 + workApprovalStepInfoService.updateStatusById(workApplyInfo.getApprovalStepId(),WorkApprovalStepResultEnum.RESULT_ABORD); + + // 作业取消 + workApplyInfoService.updateStatusById(workApplyId,WorkStatusEnum.STATU_APPLY_CANCEL); + // 操作记录 + WorkApprovalStepInfo currentStep = workApprovalStepInfoService.getById(workApplyInfo.getApprovalStepId()); + workApplyRecordService.log(currentUser, ProcessOperationEnum.CANCEL, workApplyId, workApplyInfo.getApprovalStepId(), currentStep.getStepName(), null); + + } + + @Override + public ResultVO<List<WorkApplyPageRespDTO>> listApplyingWorkApplyByPage(ContextCacheUser currentUser, PageQuery<WorkApplyApplyingPageQuery> pageQuery) { + // 申请 + WorkApplyApplyingPageDBQuery dbQuery = new WorkApplyApplyingPageDBQuery(); + if (pageQuery.getSearchParams() != null) { + dbQuery.setStartTime(pageQuery.getSearchParams().getStartTime()); + dbQuery.setEndTime(pageQuery.getSearchParams().getEndTime()); + dbQuery.setStatus(pageQuery.getSearchParams().getStatus()); + dbQuery.setWorkType(pageQuery.getSearchParams().getWorkType()); + } + dbQuery.setApplyUid(currentUser.getUid()); + Page<WorkApplyInfo> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<WorkApplyInfo> dbData = workApplyInfoService.listWorkApplyInfoByPage(page, dbQuery); + List<WorkApplyPageRespDTO> respDTOs = new ArrayList<>(dbData.size()); + WorkStatusEnum statusEnum; + WorkLevelEnum levelEnum; + WorkTypeEnum workTypeEnum; +// List<WorkApplyOperatorRespDTO> operatorRespDTOs; +// WorkApplyOperatorRespDTO operatorRespDTO; + for (WorkApplyInfo workApplyInfo : dbData) { + WorkApplyPageRespDTO respDTO = new WorkApplyPageRespDTO(); + respDTO.setWorkApplyId(workApplyInfo.getId()); + respDTO.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); + respDTO.setWorkContent(workApplyInfo.getWorkContent()); + respDTO.setWorkLocation(workApplyInfo.getWorkLocation()); + respDTO.setHazardIdentification(workApplyInfo.getHazardIdentification()); + respDTO.setDepId(workApplyInfo.getDepId()); + respDTO.setDepName(workApplyInfo.getDepName()); + respDTO.setApplyTime(workApplyInfo.getApplyTime()); + respDTO.setApplyUid(workApplyInfo.getApplyUid()); + respDTO.setApplyUname(workApplyInfo.getApplyUname()); + respDTO.setApprovalStepId(workApplyInfo.getApprovalStepId()); + respDTO.setExpEndTime(workApplyInfo.getExpEndTime()); + respDTO.setExpStartTime(workApplyInfo.getExpStartTime()); + respDTO.setGmtCreate(workApplyInfo.getGmtCreate()); + respDTO.setGmtModified(workApplyInfo.getGmtModified()); + respDTO.setStatus(workApplyInfo.getStatus()); + statusEnum = WorkStatusEnum.parse(workApplyInfo.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getDesc()); + } + respDTO.setWorkLevel(workApplyInfo.getWorkLevel()); + levelEnum = WorkLevelEnum.parse(workApplyInfo.getWorkLevel()); + if (levelEnum != null) { + respDTO.setWorkLevelDesc(levelEnum.getTitle()); + } + respDTO.setWorkType(workApplyInfo.getWorkType()); + workTypeEnum = WorkTypeEnum.parse(workApplyInfo.getWorkType()); + if (workTypeEnum != null) { + respDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + // 操作人 + respDTO.setOperatorUnames(workApplyInfo.getOperatorUnames()); + respDTO.setOperatorCompanys(workApplyInfo.getOperatorCompanys()); +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); +// operatorRespDTOs = new ArrayList<>(operators.size()); +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new WorkApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } +// respDTO.setOperators(operatorRespDTOs); + // 八大作业 + if (workTypeEnum != null) { + Object workDetail = this.getWorkDetail(workTypeEnum, workApplyInfo.getId(), workApplyInfo.getWorkDetailId()); + if (workDetail != null) { + respDTO.setWorkDetail(workDetail); + } + } + respDTOs.add(respDTO); + } + return new SearchResultVO<>(true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respDTOs, + ResultCodes.OK); + } + + @Override + public ResultVO<List<WorkApplyPendingPageRespDTO>> listPendingWorkApplyByPage(ContextCacheUser currentUser, PageQuery<WorkApplyPendingPageQuery> pageQuery) { + + WorkApplyPendingPageDBQuery dbQuery = new WorkApplyPendingPageDBQuery(); + if (pageQuery.getSearchParams() != null) { + dbQuery.setStartTime(pageQuery.getSearchParams().getStartTime()); + dbQuery.setEndTime(pageQuery.getSearchParams().getEndTime()); + dbQuery.setApplyUname(pageQuery.getSearchParams().getApplyUname()); + dbQuery.setWorkType(pageQuery.getSearchParams().getWorkType()); + } + dbQuery.setApprovalUid(currentUser.getUid()); + Page<WorkApplyPendingInfoBO> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<WorkApplyPendingInfoBO> dbData = workApplyInfoService.listPendingWorkApplyInfo(page, dbQuery); + List<WorkApplyPendingPageRespDTO> respDTOs = new ArrayList<>(dbData.size()); + WorkApplyPendingPageRespDTO respDTO; + WorkStatusEnum statusEnum; + ApprovalStepTypeEnum stepTypeEnum; + WorkApprovalStepResultEnum stepResultEnum; + WorkApprovalUnitResultEnum unitResultEnum; + WorkLevelEnum levelEnum; + WorkTypeEnum workTypeEnum; +// List<WorkApplyOperatorRespDTO> operatorRespDTOs; +// WorkApplyOperatorRespDTO operatorRespDTO; + for (WorkApplyPendingInfoBO workApplyInfoBO : dbData) { + respDTO = new WorkApplyPendingPageRespDTO(); + // work + respDTO.setWorkApplyId(workApplyInfoBO.getWorkApplyId()); + respDTO.setWorkLevel(workApplyInfoBO.getWorkLevel()); + levelEnum = WorkLevelEnum.parse(workApplyInfoBO.getWorkLevel()); + if (levelEnum != null) { + respDTO.setWorkLevelDesc(levelEnum.getTitle()); + } + respDTO.setWorkType(workApplyInfoBO.getWorkType()); + workTypeEnum = WorkTypeEnum.parse(workApplyInfoBO.getWorkType()); + if (workTypeEnum != null) { + respDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + respDTO.setWorkPermitNo(workApplyInfoBO.getWorkPermitNo()); + respDTO.setWorkContent(workApplyInfoBO.getWorkContent()); + respDTO.setWorkLocation(workApplyInfoBO.getWorkLocation()); + respDTO.setHazardIdentification(workApplyInfoBO.getHazardIdentification()); + respDTO.setDepId(workApplyInfoBO.getDepId()); + respDTO.setDepName(workApplyInfoBO.getDepName()); + respDTO.setApplyTime(workApplyInfoBO.getApplyTime()); + respDTO.setApplyUid(workApplyInfoBO.getApplyUid()); + respDTO.setApplyUname(workApplyInfoBO.getApplyUname()); + respDTO.setApprovalStepId(workApplyInfoBO.getApprovalStepId()); + respDTO.setExpEndTime(workApplyInfoBO.getExpEndTime()); + respDTO.setExpStartTime(workApplyInfoBO.getExpStartTime()); + respDTO.setGmtCreate(workApplyInfoBO.getGmtCreate()); + respDTO.setGmtModified(workApplyInfoBO.getGmtModified()); + respDTO.setStatus(workApplyInfoBO.getStatus()); + statusEnum = WorkStatusEnum.parse(workApplyInfoBO.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getDesc()); + } + // step + respDTO.setStepId(workApplyInfoBO.getStepId()); + respDTO.setStepExpFinishApprovalTime(workApplyInfoBO.getStepExpFinishApprovalTime()); + respDTO.setStepFinishApprovalTime(workApplyInfoBO.getStepFinishApprovalTime()); + respDTO.setStepStartApprovalTime(workApplyInfoBO.getStepStartApprovalTime()); + respDTO.setStepApprovalResult(workApplyInfoBO.getStepApprovalResult()); + respDTO.setNextStepId(workApplyInfoBO.getNextStepId()); + respDTO.setPreStepId(workApplyInfoBO.getPreStepId()); + respDTO.setStepContainItem(workApplyInfoBO.getContainItem()); + stepResultEnum = WorkApprovalStepResultEnum.parse(workApplyInfoBO.getStepApprovalResult()); + if (stepResultEnum != null) { + respDTO.setStepApprovalResultDesc(stepResultEnum.getDesc()); + } + respDTO.setStepType(workApplyInfoBO.getStepType()); + stepTypeEnum = ApprovalStepTypeEnum.parse(workApplyInfoBO.getStepType()); + if (stepTypeEnum != null) { + respDTO.setStepTypeDesc(stepTypeEnum.getDesc()); + } + // unit + respDTO.setUnitId(workApplyInfoBO.getUnitId()); + respDTO.setUnitApprovalUid(workApplyInfoBO.getUnitApprovalUid()); + respDTO.setUnitApprovalUname(workApplyInfoBO.getUnitApprovalUname()); + respDTO.setUnitApprovalEndTime(workApplyInfoBO.getUnitApprovalEndTime()); + respDTO.setUnitApprovalStartTime(workApplyInfoBO.getUnitApprovalStartTime()); + respDTO.setUnitApprovalActualTime(workApplyInfoBO.getUnitApprovalActualTime()); + respDTO.setUnitResult(workApplyInfoBO.getUnitResult()); + respDTO.setUnitFilledContent(workApplyInfoBO.getUnitFillContent()); + unitResultEnum = WorkApprovalUnitResultEnum.parse(workApplyInfoBO.getUnitResult()); + if (unitResultEnum != null) { + respDTO.setUnitResultDesc(unitResultEnum.getDesc()); + } + // 操作人 + respDTO.setOperatorUnames(workApplyInfoBO.getOperatorUnames()); + respDTO.setOperatorCompanys(workApplyInfoBO.getOperatorCompanys()); +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfoBO.getWorkApplyId()); +// operatorRespDTOs = new ArrayList<>(operators.size()); +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new WorkApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } +// respDTO.setOperators(operatorRespDTOs); + + // 八大作业 + if (workTypeEnum != null) { + Object workDetail = this.getWorkDetail(workTypeEnum, workApplyInfoBO.getWorkApplyId(), workApplyInfoBO.getWorkDetailId()); + if (workDetail != null) { + respDTO.setWorkDetail(workDetail); + } + } + respDTOs.add(respDTO); + } + + return new SearchResultVO<>(true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respDTOs, + ResultCodes.OK); + } + + + @Override + public ApplicantWorkApprovedApplyDetailRespDTO getApprovedApplyDetailForApplicant(ContextCacheUser currentUser, Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(workApplyId); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + if (!workApplyInfo.getApplyUid().equals(currentUser.getUid())) { + throw new BusinessException(E.DATA_OPERATION_NO_PERMISSION, "你不是作业申请人"); + } +// if (workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_IN_APPLY.getStatus())) { +// throw new BusinessException(E.DATA_STATUS_CHECK_INVALID, "作业还未审批"); +// } + + // 结果 result + ApplicantWorkApprovedApplyDetailRespDTO result = new ApplicantWorkApprovedApplyDetailRespDTO(); +// // 获取作业人 +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyId); + // 获取层级 + List<WorkApprovalStepInfo> steps = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyId); + // 获取单元 + List<WorkApprovalUnitInfo> units = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyId); + // 获取审批项 + List<WorkApprovalItemInfo> items = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyId); + // 获取已经填报审批项 + List<WorkApprovalFilledItemInfo> filledItems = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyId); + // 获取标准 + List<WorkApprovalItemStandInfo> stands = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyId); + // 获取措施 + List<WorkApprovalItemMeasureInfo> measures = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyId); + + // 措施处理映射 + Map<Long, ApplicantWorkApprovalItemMeasureRespDTO> measureMap = new HashMap<>(measures.size()); + ApplicantWorkApprovalItemMeasureRespDTO measureRespDTO; + MeasureTypeEnum measureTypeEnum; + WorkTypeEnum workTypeEnum; + for (WorkApprovalItemMeasureInfo measureInfo : measures) { + measureRespDTO = new ApplicantWorkApprovalItemMeasureRespDTO(); + measureRespDTO.setMeasureId(measureInfo.getId()); + measureRespDTO.setContext(measureInfo.getContext()); + measureRespDTO.setCorrectVal(measureInfo.getCorrectVal()); + measureRespDTO.setWorkType(measureInfo.getWorkType()); + measureRespDTO.setType(measureInfo.getType()); + measureTypeEnum = MeasureTypeEnum.parse(measureInfo.getType()); + if (measureTypeEnum != null) { + measureRespDTO.setTypeDesc(measureTypeEnum.getDesc()); + } + workTypeEnum = WorkTypeEnum.parse(measureInfo.getWorkType()); + if (workTypeEnum != null) { + measureRespDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + measureMap.put(measureRespDTO.getMeasureId(), measureRespDTO); + } + + // 标准处理映射 + Map<Long, ApplicantWorkApprovalItemStandRespDTO> standMap = new HashMap<>(stands.size()); + ApplicantWorkApprovalItemStandRespDTO standRespDTO; + WorkStandTypeEnum standTypeEnum; + RuleStandMatchingTypeEnum pattern; + for (WorkApprovalItemStandInfo standInfo : stands) { + standRespDTO = new ApplicantWorkApprovalItemStandRespDTO(); + standRespDTO.setStandId(standInfo.getId()); + standRespDTO.setWorkApplyId(standInfo.getWorkApplyId()); + standRespDTO.setDepId(standInfo.getDepId()); + standRespDTO.setDepName(standInfo.getDepName()); + standRespDTO.setEid(standInfo.getEid()); + standRespDTO.setMaxVal(standInfo.getMaxVal()); + standRespDTO.setMaxValMatchPattern(standInfo.getMaxValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMaxValMatchPattern()); + if (pattern != null) { + standRespDTO.setMaxValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setMinVal(standInfo.getMinVal()); + standRespDTO.setMinValMatchPattern(standInfo.getMinValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMinValMatchPattern()); + if (pattern != null) { + standRespDTO.setMinValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setTitle(standInfo.getTitle()); + standRespDTO.setType(standInfo.getType()); + standTypeEnum = WorkStandTypeEnum.parse(standInfo.getType()); + if (standTypeEnum != null) { + standRespDTO.setTypeDesc(standTypeEnum.getDesc()); + } + + standMap.put(standRespDTO.getStandId(), standRespDTO); + } + + // 审批项映射 + Map<Long, WorkApprovalItemInfo> itemsMap = new HashMap<>(items.size()); + for (WorkApprovalItemInfo item : items) { + itemsMap.put(item.getId(), item); + } + // 已填写审批项映射 + Map<Long, List<ApplicantWorkApprovalUnitFilledItemRespDTO>> filledItemMap = new HashMap<>(filledItems.size()); + ApplicantWorkApprovalUnitFilledItemRespDTO filledItemRespDTO; + WorkApprovalItemInfo itemInfo; + RuleItemTypeEnum itemType; + WorkRuleMeasureOptEnum optEnum; + ApprovalFilledItemType filledItemType; + for (WorkApprovalFilledItemInfo filledItem : filledItems) { + filledItemRespDTO = new ApplicantWorkApprovalUnitFilledItemRespDTO(); + filledItemRespDTO.setId(filledItem.getId()); + filledItemRespDTO.setWorkApplyId(filledItem.getWorkApplyId()); + filledItemRespDTO.setUnitId(filledItem.getUnitId()); + filledItemRespDTO.setMeasureVal(filledItem.getMeasureVal()); + filledItemRespDTO.setMeasureText(filledItem.getMeasureText()); + filledItemRespDTO.setAnalysisLocation(filledItem.getAnalysisLocation()); + filledItemRespDTO.setVal(filledItem.getVal()); + filledItemRespDTO.setItemId(filledItem.getItemId()); + filledItemRespDTO.setFillType(filledItem.getFillType()); + optEnum = WorkRuleMeasureOptEnum.parse(filledItem.getMeasureVal()); + if (optEnum != null) { + filledItemRespDTO.setMeasureValDesc(optEnum.getDesc()); + } + filledItemType = ApprovalFilledItemType.parse(filledItem.getFillType()); + if (filledItemType != null) { + filledItemRespDTO.setFillTypeDesc(filledItemType.value); + } + itemInfo = itemsMap.get(filledItem.getItemId()); + if (itemInfo != null) { + filledItemRespDTO.setItemName(itemInfo.getItemName()); + filledItemRespDTO.setStandId(itemInfo.getStandId()); + filledItemRespDTO.setMeasureId(itemInfo.getMeasureId()); + filledItemRespDTO.setMeasureInvolve(itemInfo.getMeasureInvolve()); + filledItemRespDTO.setItemType(itemInfo.getType()); + itemType = RuleItemTypeEnum.parse(itemInfo.getType()); + if (itemType != null) { + filledItemRespDTO.setItemTypeDesc(itemType.getValue()); + } + // 措施 + filledItemRespDTO.setMeasure(measureMap.get(itemInfo.getMeasureId())); + // 标准 + filledItemRespDTO.setStand(standMap.get(itemInfo.getStandId())); + + } + + if (filledItemMap.get(filledItem.getUnitId()) == null) { + List<ApplicantWorkApprovalUnitFilledItemRespDTO> list = new ArrayList<>(); + list.add(filledItemRespDTO); + filledItemMap.put(filledItem.getUnitId(), list); + }else{ + filledItemMap.get(filledItem.getUnitId()).add(filledItemRespDTO); + } + } + + // 作业人处理 +// List<ApplicantWorkApprovedApplyOperatorRespDTO> operatorRespDTOs = new ArrayList<>(operators.size()); +// ApplicantWorkApprovedApplyOperatorRespDTO operatorRespDTO; +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new ApplicantWorkApprovedApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } + + // 层级处理 + Long currentStepId = workApplyInfo.getApprovalStepId(); + // 已经走过的层级和当前所处层级 + List<WorkApprovalStepInfo> approvedSteps = this.makeApprovedStepInOrder(currentStepId, steps); + + List<ApplicantWorkApprovalStepRespDTO> stepRespDTOs = new ArrayList<>(approvedSteps.size()); + ApplicantWorkApprovalStepRespDTO stepRespDTO; + ApplicantWorkApprovalUnitRespDTO stepUnitRespDTO; + ApplicantWorkApprovalItemRespDTO stepItemRespDTO; + ApprovalStepTypeEnum stepTypeEnum; + WorkApprovalStepResultEnum approvalStepResultEnum; + WorkApprovalUnitResultEnum approvalUnitResultEnum; + RuleItemTypeEnum itemTypeEnum; + AuditTypeEnum auditTypeEnum; + // 1.层级处理和单元处理 + for (WorkApprovalStepInfo step : approvedSteps) { + stepRespDTO = new ApplicantWorkApprovalStepRespDTO(); + stepRespDTO.setStepId(step.getId()); + stepRespDTO.setWorkApplyId(step.getWorkApplyId()); + stepRespDTO.setApprovalResult(step.getApprovalResult()); + approvalStepResultEnum = WorkApprovalStepResultEnum.parse(step.getApprovalResult()); + if (approvalStepResultEnum != null) { + stepRespDTO.setApprovalResultDesc(approvalStepResultEnum.getDesc()); + } + stepRespDTO.setExpFinishApprovalTime(step.getExpFinishApprovalTime()); + stepRespDTO.setFinishApprovalTime(step.getFinishApprovalTime()); + stepRespDTO.setType(step.getType()); + stepTypeEnum = ApprovalStepTypeEnum.parse(step.getType()); + if (stepTypeEnum != null) { + stepRespDTO.setTypeDesc(stepTypeEnum.getDesc()); + } + stepRespDTO.setStartApprovalTime(step.getStartApprovalTime()); + stepRespDTO.setStepSerial(step.getStepSerial()); + stepRespDTO.setNextStepId(step.getNextStepId()); + stepRespDTO.setPreStepId(step.getPreStepId()); + stepRespDTO.setContainItem(step.getContainItem()); + stepRespDTO.setStepName(step.getStepName()); + stepRespDTO.setAuditType(step.getAuditType()); + auditTypeEnum = AuditTypeEnum.parse(step.getAuditType()); + if (auditTypeEnum != null) { + stepRespDTO.setAuditTypeDesc(auditTypeEnum.getDesc()); + } + + // 审批项处理 + List<WorkApprovalItemInfo> stepItems = items.stream().filter(item -> + // 当前层级的审批项 + step.getId().equals(item.getStepId())) + // 集合 + .collect(Collectors.toList()); + + List<ApplicantWorkApprovalItemRespDTO> stepItemDTOs = new ArrayList<>(stepItems.size()); + for (WorkApprovalItemInfo stepItem : stepItems) { + stepItemRespDTO = new ApplicantWorkApprovalItemRespDTO(); + stepItemRespDTO.setItemId(stepItem.getId()); + stepItemRespDTO.setStepId(step.getId()); + stepItemRespDTO.setWorkApplyId(stepItem.getWorkApplyId()); + stepItemRespDTO.setItemName(stepItem.getItemName()); + stepItemRespDTO.setMeasureId(stepItem.getMeasureId()); + stepItemRespDTO.setMeasureInvolve(stepItem.getMeasureInvolve()); + stepItemRespDTO.setStandId(stepItem.getStandId()); + stepItemRespDTO.setUnitId(stepItem.getUnitId()); + stepItemRespDTO.setType(stepItem.getType()); + itemTypeEnum = RuleItemTypeEnum.parse(stepItem.getType()); + stepItemRespDTO.setTypeDesc(itemTypeEnum.getValue()); + // 措施 + stepItemRespDTO.setMeasure(measureMap.get(stepItem.getMeasureId())); + // 标准 + stepItemRespDTO.setStand(standMap.get(stepItem.getStandId())); + stepItemDTOs.add(stepItemRespDTO); + } + + // 当前层级单元 + List<WorkApprovalUnitInfo> stepUnits = units.stream().filter(unit -> + // 所属层级 + step.getId().equals(unit.getStepId())) + // 集合 + .collect(Collectors.toList()); + // 单元处理 + List<ApplicantWorkApprovalUnitRespDTO> stepUnitDTOs = new ArrayList<>(stepUnits.size()); + for (WorkApprovalUnitInfo stepUnit : stepUnits) { + stepUnitRespDTO = new ApplicantWorkApprovalUnitRespDTO(); + stepUnitRespDTO.setUnitId(stepUnit.getId()); + stepUnitRespDTO.setStepId(stepUnit.getStepId()); + stepUnitRespDTO.setWorkApplyId(stepUnit.getWorkApplyId()); + stepUnitRespDTO.setResult(stepUnit.getResult()); + approvalUnitResultEnum = WorkApprovalUnitResultEnum.parse(stepUnit.getResult()); + if (approvalUnitResultEnum != null) { + stepUnitRespDTO.setResultDesc(approvalUnitResultEnum.getDesc()); + } + stepUnitRespDTO.setApprovalUid(stepUnit.getApprovalUid()); + stepUnitRespDTO.setApprovalUname(stepUnit.getApprovalUname()); + stepUnitRespDTO.setApprovalActualTime(stepUnit.getApprovalActualTime()); + stepUnitRespDTO.setApprovalEndTime(stepUnit.getApprovalEndTime()); + stepUnitRespDTO.setApprovalStartTime(stepUnit.getApprovalStartTime()); + stepUnitRespDTO.setFilledContent(stepUnit.getFillContent()); + if (filledItemMap.get(stepUnit.getId()) != null) { + stepUnitRespDTO.setFilledItems(filledItemMap.get(stepUnit.getId())); + } + stepUnitDTOs.add(stepUnitRespDTO); + } + + stepRespDTO.setStepItems(stepItemDTOs); + stepRespDTO.setStepUnits(stepUnitDTOs); + stepRespDTOs.add(stepRespDTO); + + + } + result.setWorkApplyId(workApplyInfo.getId()); + result.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); + result.setOperatorCompanys(workApplyInfo.getOperatorCompanys()); + result.setOperatorUnames(workApplyInfo.getOperatorUnames()); + result.setApprovalSteps(stepRespDTOs); + result.setWorkContent(workApplyInfo.getWorkContent()); + result.setWorkLocation(workApplyInfo.getWorkLocation()); + result.setHazardIdentification(workApplyInfo.getHazardIdentification()); + return result; + + } + + @Override + public ApproverWorkApprovedApplyDetailRespDTO getApprovedApplyDetailForApprover(ContextCacheUser currentUser, Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(workApplyId); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + + // 循环过程中判断 当前人是否是审批人 + boolean isApprover = false; + + // 结果 result + ApproverWorkApprovedApplyDetailRespDTO result = new ApproverWorkApprovedApplyDetailRespDTO(); +// // 获取操作人 +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyId); + // 获取层级 + List<WorkApprovalStepInfo> steps = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyId); + // 获取单元 + List<WorkApprovalUnitInfo> units = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyId); + // 获取审批项 + List<WorkApprovalItemInfo> items = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyId); + // 获取已经填报审批项 + List<WorkApprovalFilledItemInfo> filledItems = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyId); + // 获取标准 + List<WorkApprovalItemStandInfo> stands = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyId); + // 获取措施 + List<WorkApprovalItemMeasureInfo> measures = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyId); + + // 措施处理映射 + Map<Long, ApproverWorkApprovalItemMeasureRespDTO> measureMap = new HashMap<>(measures.size()); + ApproverWorkApprovalItemMeasureRespDTO measureRespDTO; + MeasureTypeEnum measureTypeEnum; + WorkTypeEnum workTypeEnum; + for (WorkApprovalItemMeasureInfo measureInfo : measures) { + measureRespDTO = new ApproverWorkApprovalItemMeasureRespDTO(); + measureRespDTO.setMeasureId(measureInfo.getId()); + measureRespDTO.setContext(measureInfo.getContext()); + measureRespDTO.setCorrectVal(measureInfo.getCorrectVal()); + measureRespDTO.setWorkType(measureInfo.getWorkType()); + measureRespDTO.setType(measureInfo.getType()); + measureTypeEnum = MeasureTypeEnum.parse(measureInfo.getType()); + if (measureTypeEnum != null) { + measureRespDTO.setTypeDesc(measureTypeEnum.getDesc()); + } + workTypeEnum = WorkTypeEnum.parse(measureInfo.getWorkType()); + if (workTypeEnum != null) { + measureRespDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + measureMap.put(measureRespDTO.getMeasureId(), measureRespDTO); + } + + // 标准处理映射 + Map<Long, ApproverWorkApprovalItemStandRespDTO> standMap = new HashMap<>(stands.size()); + ApproverWorkApprovalItemStandRespDTO standRespDTO; + WorkStandTypeEnum standTypeEnum; + RuleStandMatchingTypeEnum pattern; + for (WorkApprovalItemStandInfo standInfo : stands) { + standRespDTO = new ApproverWorkApprovalItemStandRespDTO(); + standRespDTO.setStandId(standInfo.getId()); + standRespDTO.setWorkApplyId(standInfo.getWorkApplyId()); + standRespDTO.setDepId(standInfo.getDepId()); + standRespDTO.setDepName(standInfo.getDepName()); + standRespDTO.setEid(standInfo.getEid()); + standRespDTO.setMaxVal(standInfo.getMaxVal()); + standRespDTO.setMaxValMatchPattern(standInfo.getMaxValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMaxValMatchPattern()); + if (pattern != null) { + standRespDTO.setMaxValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setMinVal(standInfo.getMinVal()); + standRespDTO.setMinValMatchPattern(standInfo.getMinValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMinValMatchPattern()); + if (pattern != null) { + standRespDTO.setMaxValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setTitle(standInfo.getTitle()); + standRespDTO.setType(standInfo.getType()); + standTypeEnum = WorkStandTypeEnum.parse(standInfo.getType()); + if (standTypeEnum != null) { + standRespDTO.setTypeDesc(standTypeEnum.getDesc()); + } + + standMap.put(standRespDTO.getStandId(), standRespDTO); + } + + // 审批项映射 + Map<Long, WorkApprovalItemInfo> itemsMap = new HashMap<>(items.size()); + for (WorkApprovalItemInfo item : items) { + itemsMap.put(item.getId(), item); + } + + // 已填写审批项映射 + Map<Long, List<ApproverWorkApprovalUnitFilledItemRespDTO>> filledItemMap = new HashMap<>(filledItems.size()); + ApproverWorkApprovalUnitFilledItemRespDTO filledItemRespDTO; + WorkApprovalItemInfo itemInfo; + RuleItemTypeEnum itemType; + WorkRuleMeasureOptEnum optEnum; + ApprovalFilledItemType filledItemType; + for (WorkApprovalFilledItemInfo filledItem : filledItems) { + filledItemRespDTO = new ApproverWorkApprovalUnitFilledItemRespDTO(); + filledItemRespDTO.setId(filledItem.getId()); + filledItemRespDTO.setWorkApplyId(filledItem.getWorkApplyId()); + filledItemRespDTO.setUnitId(filledItem.getUnitId()); + filledItemRespDTO.setMeasureVal(filledItem.getMeasureVal()); + filledItemRespDTO.setMeasureText(filledItem.getMeasureText()); + filledItemRespDTO.setAnalysisLocation(filledItem.getAnalysisLocation()); + filledItemRespDTO.setVal(filledItem.getVal()); + filledItemRespDTO.setItemId(filledItem.getItemId()); + filledItemRespDTO.setFillType(filledItem.getFillType()); + optEnum = WorkRuleMeasureOptEnum.parse(filledItem.getMeasureVal()); + if (optEnum != null) { + filledItemRespDTO.setMeasureValDesc(optEnum.getDesc()); + } + filledItemType = ApprovalFilledItemType.parse(filledItem.getFillType()); + if (filledItemType != null) { + filledItemRespDTO.setFillTypeDesc(filledItemType.value); + } + itemInfo = itemsMap.get(filledItem.getItemId()); + if (itemInfo != null) { + filledItemRespDTO.setItemName(itemInfo.getItemName()); + filledItemRespDTO.setStandId(itemInfo.getStandId()); + filledItemRespDTO.setMeasureId(itemInfo.getMeasureId()); + filledItemRespDTO.setMeasureInvolve(itemInfo.getMeasureInvolve()); + filledItemRespDTO.setItemType(itemInfo.getType()); + itemType = RuleItemTypeEnum.parse(itemInfo.getType()); + if (itemType != null) { + filledItemRespDTO.setItemTypeDesc(itemType.getValue()); + } + // 措施 + filledItemRespDTO.setMeasure(measureMap.get(itemInfo.getMeasureId())); + // 标准 + filledItemRespDTO.setStand(standMap.get(itemInfo.getStandId())); + + } + if (filledItemMap.get(filledItem.getUnitId()) == null) { + List<ApproverWorkApprovalUnitFilledItemRespDTO> list = new ArrayList<>(); + list.add(filledItemRespDTO); + filledItemMap.put(filledItem.getUnitId(), list); + }else{ + filledItemMap.get(filledItem.getUnitId()).add(filledItemRespDTO); + } + } + + // 作业人处理 +// List<ApproverWorkApprovedApplyOperatorRespDTO> operatorRespDTOs= new ArrayList<>(operators.size()); +// ApproverWorkApprovedApplyOperatorRespDTO operatorRespDTO; +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new ApproverWorkApprovedApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } + + // 层级处理 + Long currentStepId = workApplyInfo.getApprovalStepId(); + // 已经走过的层级和当前所处层级 + List<WorkApprovalStepInfo> approvedSteps = this.makeApprovedStepInOrder(currentStepId, steps); + + List<ApproverWorkApprovalStepRespDTO> stepRespDTOs = new ArrayList<>(approvedSteps.size()); + ApproverWorkApprovalStepRespDTO stepRespDTO; + ApproverWorkApprovalUnitRespDTO stepUnitRespDTO; + ApproverWorkApprovalItemRespDTO stepItemRespDTO; + ApprovalStepTypeEnum stepTypeEnum; + WorkApprovalStepResultEnum approvalStepResultEnum; + WorkApprovalUnitResultEnum approvalUnitResultEnum; + RuleItemTypeEnum itemTypeEnum; + AuditTypeEnum auditTypeEnum; + // 1.层级处理和单元处理 + for (WorkApprovalStepInfo step : approvedSteps) { + stepRespDTO = new ApproverWorkApprovalStepRespDTO(); + stepRespDTO.setStepId(step.getId()); + stepRespDTO.setWorkApplyId(step.getWorkApplyId()); + stepRespDTO.setApprovalResult(step.getApprovalResult()); + approvalStepResultEnum = WorkApprovalStepResultEnum.parse(step.getApprovalResult()); + if (approvalStepResultEnum != null) { + stepRespDTO.setApprovalResultDesc(approvalStepResultEnum.getDesc()); + } + stepRespDTO.setExpFinishApprovalTime(step.getExpFinishApprovalTime()); + stepRespDTO.setFinishApprovalTime(step.getFinishApprovalTime()); + stepRespDTO.setType(step.getType()); + stepTypeEnum = ApprovalStepTypeEnum.parse(step.getType()); + if (stepTypeEnum != null) { + stepRespDTO.setTypeDesc(stepTypeEnum.getDesc()); + } + stepRespDTO.setStartApprovalTime(step.getStartApprovalTime()); + stepRespDTO.setStepSerial(step.getStepSerial()); + stepRespDTO.setNextStepId(step.getNextStepId()); + stepRespDTO.setPreStepId(step.getPreStepId()); + stepRespDTO.setContainItem(step.getContainItem()); + stepRespDTO.setStepName(step.getStepName()); + stepRespDTO.setAuditType(step.getAuditType()); + auditTypeEnum = AuditTypeEnum.parse(step.getAuditType()); + if (auditTypeEnum != null) { + stepRespDTO.setAuditTypeDesc(auditTypeEnum.getDesc()); + } + + // 审批项处理 + List<WorkApprovalItemInfo> stepItems = items.stream().filter(item -> + // 当前层级的审批项 + step.getId().equals(item.getStepId())) + // 集合 + .collect(Collectors.toList()); + + List<ApproverWorkApprovalItemRespDTO> stepItemDTOs = new ArrayList<>(stepItems.size()); + for (WorkApprovalItemInfo stepItem : stepItems) { + stepItemRespDTO = new ApproverWorkApprovalItemRespDTO(); + stepItemRespDTO.setItemId(stepItem.getId()); + stepItemRespDTO.setStepId(step.getId()); + stepItemRespDTO.setWorkApplyId(stepItem.getWorkApplyId()); + stepItemRespDTO.setItemName(stepItem.getItemName()); + stepItemRespDTO.setMeasureId(stepItem.getMeasureId()); + stepItemRespDTO.setMeasureInvolve(stepItem.getMeasureInvolve()); + stepItemRespDTO.setStandId(stepItem.getStandId()); + stepItemRespDTO.setUnitId(stepItem.getUnitId()); + stepItemRespDTO.setType(stepItem.getType()); + itemTypeEnum = RuleItemTypeEnum.parse(stepItem.getType()); + stepItemRespDTO.setTypeDesc(itemTypeEnum.getValue()); + // 措施 + stepItemRespDTO.setMeasure(measureMap.get(stepItem.getMeasureId())); + // 标准 + stepItemRespDTO.setStand(standMap.get(stepItem.getStandId())); + stepItemDTOs.add(stepItemRespDTO); + } + + // 当前层级单元 + List<WorkApprovalUnitInfo> stepUnits = units.stream().filter(unit -> + // 所属层级 + step.getId().equals(unit.getStepId())) + // 集合 + .collect(Collectors.toList()); + // 单元处理 + List<ApproverWorkApprovalUnitRespDTO> stepUnitDTOs = new ArrayList<>(stepUnits.size()); + for (WorkApprovalUnitInfo stepUnit : stepUnits) { + stepUnitRespDTO = new ApproverWorkApprovalUnitRespDTO(); + stepUnitRespDTO.setUnitId(stepUnit.getId()); + stepUnitRespDTO.setStepId(stepUnit.getStepId()); + stepUnitRespDTO.setWorkApplyId(stepUnit.getWorkApplyId()); + stepUnitRespDTO.setResult(stepUnit.getResult()); + approvalUnitResultEnum = WorkApprovalUnitResultEnum.parse(stepUnit.getResult()); + if (approvalUnitResultEnum != null) { + stepUnitRespDTO.setResultDesc(approvalUnitResultEnum.getDesc()); + } + stepUnitRespDTO.setApprovalUid(stepUnit.getApprovalUid()); + stepUnitRespDTO.setApprovalUname(stepUnit.getApprovalUname()); + stepUnitRespDTO.setApprovalActualTime(stepUnit.getApprovalActualTime()); + stepUnitRespDTO.setApprovalEndTime(stepUnit.getApprovalEndTime()); + stepUnitRespDTO.setApprovalStartTime(stepUnit.getApprovalStartTime()); + stepUnitRespDTO.setFilledContent(stepUnit.getFillContent()); + if (filledItemMap.get(stepUnit.getId()) != null) { + stepUnitRespDTO.setFilledItems(filledItemMap.get(stepUnit.getId())); + } + stepUnitDTOs.add(stepUnitRespDTO); + + // 判断是否是审批人 + if (stepUnit.getApprovalUid().equals(currentUser.getUid())) { + isApprover = true; + } + } + + stepRespDTO.setStepItems(stepItemDTOs); + stepRespDTO.setStepUnits(stepUnitDTOs); + stepRespDTOs.add(stepRespDTO); + } + + if (!isApprover) { + throw new BusinessException(E.DATA_OPERATION_NO_PERMISSION, "操作人不为审批人"); + } + + result.setWorkApplyId(workApplyInfo.getId()); + result.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); +// result.setOperators(operatorRespDTOs); + result.setOperatorCompanys(workApplyInfo.getOperatorCompanys()); + result.setOperatorUnames(workApplyInfo.getOperatorUnames()); + result.setApprovalSteps(stepRespDTOs); + result.setWorkContent(workApplyInfo.getWorkContent()); + result.setWorkLocation(workApplyInfo.getWorkLocation()); + result.setHazardIdentification(workApplyInfo.getHazardIdentification()); + return result; + } + + @Override + public ApproverWorkPendingApprovalDataRespDTO getPendingApprovalData(ContextCacheUser currentUser, Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getWorkApprovalByApprovalUid(workApplyId, currentUser.getUid()); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在或者你不是该作业的审批人"); + } + // 获取当前层级 + WorkApprovalStepInfo currentStep = workApprovalStepInfoService.getById(workApplyInfo.getApprovalStepId()); + // todo 当前层级状态判断 如果已经有状态,没有可以审批的信息 + // 获取当前单元 + WorkApprovalUnitInfo currentUnit = workApprovalUnitInfoService.getWorkApprovalUnitByStepIdAndUid(currentStep.getId(), currentUser.getUid()); + // 如果单元被自动驳回,需要返回当时的数据进行修改 + if (currentUnit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID, "单元审批已完成"); + } + ApproverWorkPendingApprovalDataRespDTO pendingData = new ApproverWorkPendingApprovalDataRespDTO(); + // 层级 + pendingData.setStepId(currentStep.getId()); + pendingData.setWorkApplyId(currentStep.getWorkApplyId()); + pendingData.setStepType(currentStep.getType()); + ApprovalStepTypeEnum stepTypeEnum = ApprovalStepTypeEnum.parse(currentStep.getType()); + if (stepTypeEnum != null) { + pendingData.setStepTypeDesc(stepTypeEnum.getDesc()); + } + pendingData.setStepApprovalResult(currentStep.getApprovalResult()); + WorkApprovalStepResultEnum approvalStepResultEnum = WorkApprovalStepResultEnum.parse(currentStep.getApprovalResult()); + if (approvalStepResultEnum != null) { + pendingData.setStepApprovalResultDesc(approvalStepResultEnum.getDesc()); + } + pendingData.setStepStartApprovalTime(currentStep.getStartApprovalTime()); + pendingData.setStepExpFinishApprovalTime(currentStep.getExpFinishApprovalTime()); + pendingData.setStepFinishApprovalTime(currentStep.getFinishApprovalTime()); + pendingData.setPreStepId(currentStep.getPreStepId()); + pendingData.setNextStepId(currentStep.getNextStepId()); + pendingData.setContainItem(currentStep.getContainItem()); + pendingData.setStepName(currentStep.getStepName()); + // 单元 + pendingData.setUnitId(currentUnit.getId()); + pendingData.setApprovalUid(currentUnit.getApprovalUid()); + pendingData.setApprovalUname(currentUnit.getApprovalUname()); + pendingData.setUnitApprovalResult(currentUnit.getResult()); + WorkApprovalUnitResultEnum approvalUnitResultEnum = WorkApprovalUnitResultEnum.parse(currentUnit.getResult()); + if (approvalUnitResultEnum != null) { + pendingData.setUnitApprovalResultDesc(approvalUnitResultEnum.getDesc()); + } + pendingData.setUnitApprovalStartTime(currentUnit.getApprovalStartTime()); + pendingData.setUnitApprovalEndTime(currentUnit.getApprovalEndTime()); + pendingData.setUnitApprovalActualTime(currentUnit.getApprovalActualTime()); + + // 审批项 + List<WorkApprovalItemInfo> items = workApprovalItemInfoService.listWorkApprovalItemInfoByStepId(currentStep.getId()); + // 审批措施 + List<WorkApprovalItemMeasureInfo> measures = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyId); + // 审批标准 + List<WorkApprovalItemStandInfo> stands = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyId); +// // 已填写审批项内容 +// List<WorkApprovalFilledItemInfo> filledItems = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByUnitId(currentUnit.getId()); + // 安全措施映射准备 + Map<Long, ApproverWorkPendingApprovalItemMeasureRespDTO> measureMap = new HashMap<>(measures.size()); + ApproverWorkPendingApprovalItemMeasureRespDTO measureRespDTO; + WorkTypeEnum workTypeEnum; + MeasureTypeEnum measureTypeEnum; + for (WorkApprovalItemMeasureInfo measure : measures) { + measureRespDTO = new ApproverWorkPendingApprovalItemMeasureRespDTO(); + measureRespDTO.setMeasureId(measure.getId()); + measureRespDTO.setWorkType(measure.getWorkType()); + workTypeEnum = WorkTypeEnum.parse(measure.getWorkType()); + if (workTypeEnum != null) { + measureRespDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + measureRespDTO.setType(measure.getType()); + measureTypeEnum = MeasureTypeEnum.parse(measure.getType()); + if (measureTypeEnum != null) { + measureRespDTO.setTypeDesc(measureTypeEnum.getDesc()); + } + measureRespDTO.setCorrectVal(measure.getCorrectVal()); + measureRespDTO.setContext(measure.getContext()); + measureRespDTO.setWorkApplyId(measure.getWorkApplyId()); + measureMap.put(measureRespDTO.getMeasureId(), measureRespDTO); + } + // 标准映射准备 + Map<Long, ApproverWorkPendingApprovalItemStandRespDTO> standMap = new HashMap<>(stands.size()); + ApproverWorkPendingApprovalItemStandRespDTO standRespDTO; + WorkStandTypeEnum standTypeEnum; + RuleStandMatchingTypeEnum pattern; + for (WorkApprovalItemStandInfo stand : stands) { + standRespDTO = new ApproverWorkPendingApprovalItemStandRespDTO(); + standRespDTO.setStandId(stand.getId()); + standRespDTO.setType(stand.getType()); + standTypeEnum = WorkStandTypeEnum.parse(stand.getType()); + if (standTypeEnum != null) { + standRespDTO.setTypeDesc(standTypeEnum.getDesc()); + } + standRespDTO.setDepName(stand.getDepName()); + standRespDTO.setMinVal(stand.getMinVal()); + standRespDTO.setMinValMatchPattern(stand.getMinValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(stand.getMinValMatchPattern()); + if (pattern != null) { + standRespDTO.setMinValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setMaxVal(stand.getMaxVal()); + standRespDTO.setMaxValMatchPattern(stand.getMaxValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(stand.getMaxValMatchPattern()); + if (pattern != null) { + standRespDTO.setMaxValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setTitle(stand.getTitle()); + standRespDTO.setWorkApplyId(stand.getWorkApplyId()); + standMap.put(standRespDTO.getStandId(), standRespDTO); + } + +// // 已经填写的内容准备 +// Map<Long, ApproverWorkApprovalUnitFilledItemRespDTO> filledItemRespDTOMap = new HashMap<>(filledItems.size()); +// ApproverWorkApprovalUnitFilledItemRespDTO filledItemRespDTO; +// for (WorkApprovalFilledItemInfo filledItem : filledItems) { +// filledItemRespDTO = new ApproverWorkApprovalUnitFilledItemRespDTO(); +// filledItemRespDTO.setId(filledItem.getId()); +// filledItemRespDTO.setItemId(filledItem.getItemId()); +// filledItemRespDTO.setUnitId(filledItem.getUnitId()); +// filledItemRespDTO.setVal(filledItem.getVal()); +// filledItemRespDTO.setWorkApplyId(filledItem.getWorkApplyId()); +// filledItemRespDTO.setMeasureVal(filledItem.getMeasureVal()); +// filledItemRespDTO.setMeasureText(filledItem.getMeasureText()); +// filledItemRespDTOMap.put(filledItemRespDTO.getItemId(), filledItemRespDTO); +// +// } + List<ApproverWorkPendingApprovalItemRespDTO> itemRespDTOS = new ArrayList<>(items.size()); + ApproverWorkPendingApprovalItemRespDTO itemRespDTO; + RuleItemTypeEnum itemTypeEnum; + for (WorkApprovalItemInfo item : items) { + itemRespDTO = new ApproverWorkPendingApprovalItemRespDTO(); + itemRespDTO.setItemId(item.getId()); + itemRespDTO.setItemName(item.getItemName()); + itemRespDTO.setWorkApplyId(item.getWorkApplyId()); + itemRespDTO.setStepId(item.getStepId()); + itemRespDTO.setUnitId(item.getUnitId()); + itemRespDTO.setType(item.getType()); + itemTypeEnum = RuleItemTypeEnum.parse(item.getType()); + itemRespDTO.setTypeDesc(itemTypeEnum.getValue()); + itemRespDTO.setStandId(item.getStandId()); + itemRespDTO.setStand(standMap.get(item.getStandId())); + itemRespDTO.setMeasureId(item.getMeasureId()); + itemRespDTO.setMeasure(measureMap.get(item.getMeasureId())); +// filledItemRespDTO = filledItemRespDTOMap.get(itemRespDTO.getItemId()); +// if (filledItemRespDTO != null) { +// itemRespDTO.setFilled(true); +// itemRespDTO.setFilledItemContent(filledItemRespDTO); +// } + itemRespDTOS.add(itemRespDTO); + } + pendingData.setItems(itemRespDTOS); + return pendingData; + } + + @Override + @Transactional + public void approveItem(ContextCacheUser currentUser, ApprovalItemDataReqDTO approvalItemData) { + if (approvalItemData.getWorkApplyId() == null ) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(approvalItemData.getWorkApplyId()); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + if (workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_ABORD.getStatus())) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请已终止"); + } + if (workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_FINISH.getStatus())) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请已结束"); + } + WorkApprovalStepInfo currentStep = workApprovalStepInfoService.getById(workApplyInfo.getApprovalStepId()); + if (currentStep.getApprovalResult().equals(WorkApprovalStepResultEnum.WAIT_TO_START.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级审批未开始"); + } + + // 当前层级不在审批中 <=> 层级审批结束 + if (!currentStep.getApprovalResult().equals(WorkApprovalStepResultEnum.RESULT_IN_APPROVAL.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级审批已结束"); + } + WorkApprovalUnitInfo currentUnit = workApprovalUnitInfoService.getWorkApprovalUnitByStepIdAndUid(currentStep.getId(), currentUser.getUid()); + // 审批单元 不存在 <=> 审批人非法 + if (currentUnit == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "操作人非审批人"); + } + if (currentUnit.getResult().equals(WorkApprovalUnitResultEnum.WAIT_TO_START.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级单元未开始"); + } + + // 如果单元状态既不是 !(审批中 | 自动驳回) + if (!currentUnit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()) && + !currentUnit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT.getResult())) { + // 审批单元不在审批中 或者 自动驳回 <=> 当前单元已经结束 + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID, "当前审批单元已经结束"); + } + + // 1.层级为审批项审批 + if (currentStep.getContainItem()) { + List<ApprovalItemReqDTO> itemFilledContents = approvalItemData.getItemFilledContents(); + if (itemFilledContents == null || itemFilledContents.size() == 0) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批项提交为空"); + } + // 查询当前层级所有审批项 + List<WorkApprovalItemInfo> items = workApprovalItemInfoService.listWorkApprovalItemInfoByStepId(currentStep.getId()); + List<Long> dBItemIds = items.stream().map(WorkApprovalItemInfo::getId).collect(Collectors.toList()); + List<Long> paramItemIds = itemFilledContents.stream().map(ApprovalItemReqDTO::getItemId).collect(Collectors.toList()); + // 判断提交的审批项 是否和 层级的审批项 id 完全相等 + if (dBItemIds.size() != paramItemIds.size()) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "提交的审批项个数非法"); + } + if (!dBItemIds.containsAll(paramItemIds)) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "提交的审批项id不匹配"); + } + + // 获取所有标准 + List<WorkApprovalItemStandInfo> stands = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyInfo.getId()); + // 获取所有措施 + List<WorkApprovalItemMeasureInfo> measures = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + + // 审批项 审批内容映射 + Map<Long, WorkApprovalItemInfo> itemMap = new HashMap<>(items.size()); + for (WorkApprovalItemInfo item : items) { + itemMap.put(item.getId(), item); + } + + // 审批标准映射 + Map<Long, WorkApprovalItemStandInfo> standMap = new HashMap<>(stands.size()); + if (stands.size() > 0) { + for (WorkApprovalItemStandInfo stand : stands) { + standMap.put(stand.getId(), stand); + } + } + + + // 审批措施映射 + Map<Long, WorkApprovalItemMeasureInfo> measureMap = new HashMap<>(measures.size()); + if (measures.size() > 0) { + for (WorkApprovalItemMeasureInfo measure : measures) { + measureMap.put(measure.getId(), measure); + } + } + + + // 校验 审批项标准和填写字段 + if (currentStep.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) { + // 审批规则 => 分析人 审批绑定标准 + boolean flag = true; + for (ApprovalItemReqDTO itemFilledContent : itemFilledContents) { + WorkApprovalItemInfo itemInfo = itemMap.get(itemFilledContent.getItemId()); + assert itemInfo != null; + RuleItemTypeEnum itemTypeEnum = RuleItemTypeEnum.parse(itemInfo.getType()); + assert itemTypeEnum == RuleItemTypeEnum.NUMERIC; + ApprovalFilledItemType filledItemType = ApprovalFilledItemType.parse(itemFilledContent.getFillType()); + if (filledItemType == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批项标准数据填写类型非法"); + } + if (filledItemType == ApprovalFilledItemType.INVOLVED) { + if (itemFilledContent.getVal() == null) { + throw new BusinessException(E.DATA_PARAM_NULL, "审批项数值填写为空"); + } + if (StringUtils.isBlank(itemFilledContent.getAnalysisLocation())) { + throw new BusinessException(E.DATA_PARAM_NULL, "分析人层级请填写每个审批项的分析地点"); + } + flag = false; + } + } + // 分析人必须涉及一项审批项 + if (flag) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "至少填写一项标准数据"); + } + }else{ + // 不是分析人审批 => 安全措施 和 措施内容填写 + for (ApprovalItemReqDTO itemFilledContent : itemFilledContents) { + WorkApprovalItemInfo itemInfo = itemMap.get(itemFilledContent.getItemId()); + assert itemInfo != null; + RuleItemTypeEnum itemTypeEnum = RuleItemTypeEnum.parse(itemInfo.getType()); + if (itemTypeEnum == RuleItemTypeEnum.FILL) { + if (StringUtils.isBlank(itemFilledContent.getMeasureText())) { + throw new BusinessException(E.DATA_PARAM_NULL, "审批项措施内容填写为空"); + } + } + if (itemTypeEnum == RuleItemTypeEnum.OPTION) { + if (itemFilledContent.getMeasureVal() == null) { + throw new BusinessException(E.DATA_PARAM_NULL, "审批措施选项填写为空"); + } + WorkRuleMeasureOptEnum measureOptEnum = WorkRuleMeasureOptEnum.parse(itemFilledContent.getMeasureVal()); + if (measureOptEnum == null) { + throw new BusinessException(E.DATA_PARAM_CHECK_INVALID, "审批措施选项非法填写"); + } + } + } + } + + + + // 单元审批中 或者 被自动驳回 <=> 新增 + + List<WorkApprovalFilledItemInfo> filledItemInfos = new ArrayList<>(items.size()); + List<String> contents = new ArrayList<>(items.size()); + WorkApprovalFilledItemInfo filledItemInfo; + boolean unitAutoReject = false; + for (ApprovalItemReqDTO itemFilledContent : itemFilledContents) { + // 根据item 的类型 + WorkApprovalItemInfo itemInfo = itemMap.get(itemFilledContent.getItemId()); + filledItemInfo = new WorkApprovalFilledItemInfo(); + filledItemInfo.setId(IdUtil.getSnowflake(0,0).nextId()); + filledItemInfo.setItemId(itemFilledContent.getItemId()); + filledItemInfo.setUnitId(currentUnit.getId()); + filledItemInfo.setWorkApplyId(workApplyInfo.getId()); + if (currentStep.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) { + filledItemInfo.setAnalysisLocation(itemFilledContent.getAnalysisLocation()); + filledItemInfo.setFillType(itemFilledContent.getFillType()); + } + + + // 数值类型 && 涉及填写 <=> 分析人审批 需要获取标准自动判断 + if (itemInfo.getType().equals(RuleItemTypeEnum.NUMERIC.getCode()) && filledItemInfo.getFillType() == ApprovalFilledItemType.INVOLVED.code) { + // 对象数值赋予 + filledItemInfo.setVal(itemFilledContent.getVal()); + // 数值记录 + contents.add(String.format("%s 填写数值:%s", itemInfo.getItemName(), filledItemInfo.getVal())); + // 标准 + WorkApprovalItemStandInfo standInfo = standMap.get(itemInfo.getStandId()); + // 最大值和最小值是否合格 + boolean standQualified = judge(filledItemInfo.getVal(), standInfo.getMaxVal(), RuleStandMatchingTypeEnum.parse(standInfo.getMaxValMatchPattern())) && + judge(filledItemInfo.getVal(), standInfo.getMinVal(), RuleStandMatchingTypeEnum.parse(standInfo.getMinValMatchPattern())); + // 有一项不合格 <=> 单元自动驳回 + if (!standQualified) { + unitAutoReject = true; + // 终止判断 + break; + } + } + // 选项类型 - 安全措施自动判断 + if (itemInfo.getType().equals(RuleItemTypeEnum.OPTION.getCode())) { + // 对象选项赋予 + filledItemInfo.setMeasureVal(itemFilledContent.getMeasureVal()); + + WorkRuleMeasureOptEnum optEnum = WorkRuleMeasureOptEnum.parse(filledItemInfo.getMeasureVal()); + // 选项记录 + contents.add(String.format("%s 判断为:%s", itemInfo.getItemName(), optEnum.getDesc())); + // 安全措施 + WorkApprovalItemMeasureInfo measureInfo = measureMap.get(itemInfo.getMeasureId()); + // 是否符合安全措施的判断 + boolean measureQualified = itemFilledContent.getMeasureVal().equals(measureInfo.getCorrectVal()); + // 选项为是或否 && 不符合安全措施的判断 => 自动驳回 + if (optEnum != WorkRuleMeasureOptEnum.UNINVOLVED && !measureQualified) { + unitAutoReject = true; + // 终止判断 + break; + } + } + + if (itemInfo.getType().equals(RuleItemTypeEnum.FILL.getCode())) { + // 对象填空赋予 + filledItemInfo.setMeasureText(itemFilledContent.getMeasureText()); + // 填空记录 + contents.add(String.format("%s 填写:%s", itemInfo.getItemName(), filledItemInfo.getMeasureText())); + } + // add + filledItemInfos.add(filledItemInfo); + } + // 填报记录 + workApplyRecordService.log(currentUser, ProcessOperationEnum.APPROVE, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(), currentStep.getStepName(), String.join(",", contents)); + + // 没有自动驳回 所有审批项默认符合标准,保存进数据库 + if (!unitAutoReject) { + workApprovalFilledItemInfoService.saveBatchFilledItemInfo(filledItemInfos); + // 单元状态 => 通过 + workApprovalUnitInfoService.updateStatusById(currentUnit.getId(), WorkApprovalUnitResultEnum.RESULT_SUCCESS); + // 操作记录 + workApplyRecordService.log(ProcessOperationEnum.APPROVE_SUCCESS, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(),currentStep.getStepName(), null); + + }else{ + // 单元状态 => 自动驳回 + workApprovalUnitInfoService.updateStatusById(currentUnit.getId(), WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT); + // 自动驳回 <=> 单元阻塞 + // 操作记录 + workApplyRecordService.log(ProcessOperationEnum.AUTO_REJECT, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(), currentStep.getStepName(), null); + } + + } + + + // 2.层级为审批单元即可 + if (!currentStep.getContainItem()) { + if (StringUtils.isBlank(approvalItemData.getUnitFillContent())) { + throw new BusinessException(E.DATA_PARAM_NULL, "单元填报意见不能为空"); + } + // 填报记录 + workApplyRecordService.log(currentUser, ProcessOperationEnum.APPROVE, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(),currentStep.getStepName(), approvalItemData.getUnitFillContent()); + // 单元状态 => 填报内容 && 通过 + workApprovalUnitInfoService.updateStatusAndFillContentById(currentUnit.getId(), approvalItemData.getUnitFillContent(), WorkApprovalUnitResultEnum.RESULT_SUCCESS); + // 操作记录 + workApplyRecordService.log(ProcessOperationEnum.APPROVE_SUCCESS, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(),currentStep.getStepName(), null); + } + + + // 3.判断是否所有单元是否通过 + List<WorkApprovalUnitInfo> units = workApprovalUnitInfoService.listApprovalRuleUnitByStepId(currentStep.getId()); + // 是否还有单元再审批中(审批中 和 自动驳回 都是需要审批) + boolean isUnitUnderApproval = false; + for (WorkApprovalUnitInfo unit : units) { + if (unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()) || + unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT.getResult())) { + isUnitUnderApproval = true; + break; + } + } + // 是否有一个人通过 + boolean jointTrialOneSuccess = false; + // 未审批通过单元 ids + List<Long> otherUnApprovalUnitIds = new ArrayList<>(units.size()); + // 多人会审 => 判断是否存在单元通过 + if (currentStep.getAuditType() != null && currentStep.getAuditType().equals(AuditTypeEnum.CONCURRENT_JOINT_TRIAL.getType())) { + for (WorkApprovalUnitInfo unit : units) { + if (unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) { + jointTrialOneSuccess = true; + }else{ + otherUnApprovalUnitIds.add(unit.getId()); + } + } + } + + + // 没有单元审批中 || 多人会审一人通过 => 层级通过 + if (!isUnitUnderApproval || jointTrialOneSuccess) { + // 会审情况 => 将其他单元状态改成未审批通过(层级已结束) + if (jointTrialOneSuccess && otherUnApprovalUnitIds.size() > 0) { + // 修改状态 + workApprovalUnitInfoService.batchUpdateStatusByIds(otherUnApprovalUnitIds, WorkApprovalUnitResultEnum.RESULT_APPROVED_UNSUCCESS); + } + // 层级通过 + workApprovalStepInfoService.updateStatusById(currentStep.getId(), WorkApprovalStepResultEnum.RESULT_SUCCESS); + // 层级结束时间 + workApprovalStepInfoService.updateFinishApprovalTimeById(currentStep.getId(), LocalDateTime.now()); + // 层级是最后的层级 <=> 作业结束 + if (currentStep.getNextStepId() == null) { + // 作业结束 + workApplyInfoService.updateStatusById(workApplyInfo.getId(),WorkStatusEnum.STATU_FINISH); + // 操作记录 + workApplyRecordService.log(ProcessOperationEnum.FINISH, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(),currentStep.getStepName(), null); + }else{ + // 开始下一个层级 + WorkApprovalStepInfo nextStep = workApprovalStepInfoService.getById(currentStep.getNextStepId()); + // 作业指向下一个层级 + workApplyInfoService.updateApprovalStepIdById(workApplyInfo.getId(),currentStep.getNextStepId()); + // 下一个层级状态为审批中 + workApprovalStepInfoService.updateStatusById(nextStep.getId(), WorkApprovalStepResultEnum.RESULT_IN_APPROVAL); + // 下一个层级开始时间更新 + workApprovalStepInfoService.updateStartApprovalTimeById(nextStep.getId(), LocalDateTime.now()); + // 层级下所有单元状态为审批中 + workApprovalUnitInfoService.updateStatusByStepId(nextStep.getId(),WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL); + } + } + + // 分析人审批 => 作业限时 + if (currentStep.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) { + RuleContinueTimeUnitEnum timeUnitEnum = RuleContinueTimeUnitEnum.parse(currentStep.getContinueTimeUnit()); + // 延时秒数 + long seconds = generateSeconds(timeUnitEnum, currentStep.getContinueTime()); + // 具体判断时间点 + LocalDateTime approvalEffectiveTime = LocalDateTime.now().plusSeconds(seconds); + //发送一条消息 + ApprovalSpecialWorkMsg approvalSpecialWorkMsg = new ApprovalSpecialWorkMsg(); + approvalSpecialWorkMsg.setWorkApplyId(approvalItemData.getWorkApplyId()); + approvalSpecialWorkMsg.setApprovalEffectiveTime(conversionTimeType(approvalEffectiveTime)); + approvalWorkRocketMQService.syncSend(approvalSpecialWorkMsg); + } + + } + + @Override + public void abordItem(ContextCacheUser currentUser, ApprovalItemAbordDataReqDTO abordDataReqDTO) { + if ( abordDataReqDTO.getWorkApplyId() == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(abordDataReqDTO.getWorkApplyId()); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + if (workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_ABORD.getStatus())) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请已终止"); + } + if (workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_FINISH.getStatus())) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请已结束"); + } + WorkApprovalStepInfo currentStep = workApprovalStepInfoService.getById(workApplyInfo.getApprovalStepId()); + if (currentStep.getApprovalResult().equals(WorkApprovalStepResultEnum.WAIT_TO_START.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级审批未开始"); + } + // 当前层级不在审批中 <=> 层级审批结束 + if (!currentStep.getApprovalResult().equals(WorkApprovalStepResultEnum.RESULT_IN_APPROVAL.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级审批已结束"); + } + WorkApprovalUnitInfo currentUnit = workApprovalUnitInfoService.getWorkApprovalUnitByStepIdAndUid(currentStep.getId(), currentUser.getUid()); + // 审批单元 不存在 <=> 审批人非法 + if (currentUnit == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "操作人非审批人"); + } + if (currentUnit.getResult().equals(WorkApprovalUnitResultEnum.WAIT_TO_START.getResult())) { + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"当前层级单元未开始"); + } + if (currentUnit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()) || + currentUnit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT.getResult())) { + // 1.单元终止 + workApprovalUnitInfoService.updateStatusById(currentUnit.getId(), WorkApprovalUnitResultEnum.RESULT_ABORD); + // 2.当前层级其他单元 更新状态为 终止提前结束 + List<WorkApprovalUnitInfo> currentStepUnits = workApprovalUnitInfoService.listApprovalRuleUnitByStepId(currentStep.getId()); + List<Long> unitIdsExceptCurrent = currentStepUnits.stream().filter(unit -> + // 除此之外 && 状态是(审批中 | 自动驳回) + !unit.getId().equals(currentUnit.getId()) && + (unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_IN_APPROVAL.getResult()) || + unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_AUTO_REJECT.getResult()))) + // id + .map(WorkApprovalUnitInfo::getId) + // 集合 + .collect(Collectors.toList()); + if (unitIdsExceptCurrent.size() > 0) { + workApprovalUnitInfoService.updateStatusByIds(unitIdsExceptCurrent, WorkApprovalUnitResultEnum.RESULT_INTERRUPTED); + } + // 3.层级终止 + workApprovalStepInfoService.updateStatusById(currentStep.getId(), WorkApprovalStepResultEnum.RESULT_ABORD); + // 4.作业终止 + workApplyInfoService.updateStatusById(workApplyInfo.getId(), WorkStatusEnum.STATU_ABORD); + // 5.操作记录 + workApplyRecordService.log(currentUser, ProcessOperationEnum.ABORD, workApplyInfo.getId(), workApplyInfo.getApprovalStepId(), currentStep.getStepName(), null); + + }else{ + // 审批单元不在审批中 或者 自动驳回 <=> 当前单元已经结束 + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID, "当前审批单元已经结束"); + } + } + + + + @Override + public SearchResultVO<List<AllWorkApplyPageRespDTO>> listAllWorkApply(ContextCacheUser currentUser, PageQuery<AllWorkApplyPageQuery> pageQuery) { + + AllWorkApplyPageDBQuery dbQuery = new AllWorkApplyPageDBQuery(); + if (pageQuery.getSearchParams() != null) { + dbQuery.setStatus(pageQuery.getSearchParams().getStatus()); + dbQuery.setWorkType(pageQuery.getSearchParams().getWorkType()); + dbQuery.setWorkLevel(pageQuery.getSearchParams().getWorkLevel()); + dbQuery.setApplyDepId(pageQuery.getSearchParams().getApplyDepId()); + dbQuery.setApplyStartTime(pageQuery.getSearchParams().getApplyStartTime()); + dbQuery.setApplyEndTime(pageQuery.getSearchParams().getApplyEndTime()); + } + Page<WorkApplyInfo> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<WorkApplyInfo> dbData = workApplyInfoService.listAllWorkApplyByPage(page, dbQuery); + List<AllWorkApplyPageRespDTO> respDTOs = new ArrayList<>(dbData.size()); + WorkStatusEnum statusEnum; + WorkLevelEnum levelEnum; + WorkTypeEnum workTypeEnum; +// List<WorkApplyOperatorRespDTO> operatorRespDTOs; +// WorkApplyOperatorRespDTO operatorRespDTO; + for (WorkApplyInfo workApplyInfo : dbData) { + AllWorkApplyPageRespDTO respDTO = new AllWorkApplyPageRespDTO(); + respDTO.setWorkApplyId(workApplyInfo.getId()); + respDTO.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); + respDTO.setWorkContent(workApplyInfo.getWorkContent()); + respDTO.setWorkLocation(workApplyInfo.getWorkLocation()); + respDTO.setHazardIdentification(workApplyInfo.getHazardIdentification()); + respDTO.setDepId(workApplyInfo.getDepId()); + respDTO.setDepName(workApplyInfo.getDepName()); + respDTO.setApplyTime(workApplyInfo.getApplyTime()); + respDTO.setApplyUid(workApplyInfo.getApplyUid()); + respDTO.setApplyUname(workApplyInfo.getApplyUname()); + respDTO.setApprovalStepId(workApplyInfo.getApprovalStepId()); + respDTO.setExpEndTime(workApplyInfo.getExpEndTime()); + respDTO.setExpStartTime(workApplyInfo.getExpStartTime()); + respDTO.setGmtCreate(workApplyInfo.getGmtCreate()); + respDTO.setGmtModified(workApplyInfo.getGmtModified()); + respDTO.setStatus(workApplyInfo.getStatus()); + statusEnum = WorkStatusEnum.parse(workApplyInfo.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getDesc()); + } + respDTO.setWorkLevel(workApplyInfo.getWorkLevel()); + levelEnum = WorkLevelEnum.parse(workApplyInfo.getWorkLevel()); + if (levelEnum != null) { + respDTO.setWorkLevelDesc(levelEnum.getTitle()); + } + respDTO.setWorkType(workApplyInfo.getWorkType()); + workTypeEnum = WorkTypeEnum.parse(workApplyInfo.getWorkType()); + if (workTypeEnum != null) { + respDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + // 操作人 +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); +// operatorRespDTOs = new ArrayList<>(operators.size()); +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new WorkApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } +// respDTO.setOperators(operatorRespDTOs); + respDTO.setOperatorCompanys(workApplyInfo.getOperatorCompanys()); + respDTO.setOperatorUnames(workApplyInfo.getOperatorUnames()); + // 八大作业 + if (workTypeEnum != null) { + Object workDetail = this.getWorkDetail(workTypeEnum, workApplyInfo.getId(), workApplyInfo.getWorkDetailId()); + if (workDetail != null) { + respDTO.setWorkDetail(workDetail); + } + } + + respDTOs.add(respDTO); + } + + return new SearchResultVO<>( + true, page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + respDTOs, + ResultCodes.OK); + + } + + @Override + public OthersWorkApprovedApplyDetailRespDTO getWorkApplyDetailForOthers(ContextCacheUser currentUser, Long workApplyId) { + if (workApplyId == null) { + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(workApplyId); + if (workApplyInfo == null) { + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT, "作业申请不存在"); + } + + + // 结果 result + OthersWorkApprovedApplyDetailRespDTO result = new OthersWorkApprovedApplyDetailRespDTO(); + // 获取作业人 +// List<WorkApplyOperatorInfo> operators = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyId); + // 获取层级 + List<WorkApprovalStepInfo> steps = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyId); + // 获取单元 + List<WorkApprovalUnitInfo> units = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyId); + // 获取审批项 + List<WorkApprovalItemInfo> items = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyId); + // 获取已经填报审批项 + List<WorkApprovalFilledItemInfo> filledItems = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyId); + // 获取标准 + List<WorkApprovalItemStandInfo> stands = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyId); + // 获取措施 + List<WorkApprovalItemMeasureInfo> measures = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyId); + + // 措施处理映射 + Map<Long, OthersWorkApprovalItemMeasureRespDTO> measureMap = new HashMap<>(measures.size()); + OthersWorkApprovalItemMeasureRespDTO measureRespDTO; + MeasureTypeEnum measureTypeEnum; + WorkTypeEnum workTypeEnum; + for (WorkApprovalItemMeasureInfo measureInfo : measures) { + measureRespDTO = new OthersWorkApprovalItemMeasureRespDTO(); + measureRespDTO.setMeasureId(measureInfo.getId()); + measureRespDTO.setContext(measureInfo.getContext()); + measureRespDTO.setCorrectVal(measureInfo.getCorrectVal()); + measureRespDTO.setWorkType(measureInfo.getWorkType()); + measureRespDTO.setType(measureInfo.getType()); + measureTypeEnum = MeasureTypeEnum.parse(measureInfo.getType()); + if (measureTypeEnum != null) { + measureRespDTO.setTypeDesc(measureTypeEnum.getDesc()); + } + workTypeEnum = WorkTypeEnum.parse(measureInfo.getWorkType()); + if (workTypeEnum != null) { + measureRespDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + measureMap.put(measureRespDTO.getMeasureId(), measureRespDTO); + } + + // 标准处理映射 + Map<Long, OthersWorkApprovalItemStandRespDTO> standMap = new HashMap<>(stands.size()); + OthersWorkApprovalItemStandRespDTO standRespDTO; + WorkStandTypeEnum standTypeEnum; + RuleStandMatchingTypeEnum pattern; + for (WorkApprovalItemStandInfo standInfo : stands) { + standRespDTO = new OthersWorkApprovalItemStandRespDTO(); + standRespDTO.setStandId(standInfo.getId()); + standRespDTO.setWorkApplyId(standInfo.getWorkApplyId()); + standRespDTO.setDepId(standInfo.getDepId()); + standRespDTO.setDepName(standInfo.getDepName()); + standRespDTO.setEid(standInfo.getEid()); + standRespDTO.setMaxVal(standInfo.getMaxVal()); + standRespDTO.setMaxValMatchPattern(standInfo.getMaxValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMaxValMatchPattern()); + if (pattern != null) { + standRespDTO.setMaxValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setMinVal(standInfo.getMinVal()); + standRespDTO.setMinValMatchPattern(standInfo.getMinValMatchPattern()); + pattern = RuleStandMatchingTypeEnum.parse(standInfo.getMinValMatchPattern()); + if (pattern != null) { + standRespDTO.setMinValMatchPatternDesc(pattern.getValue()); + } + standRespDTO.setTitle(standInfo.getTitle()); + standRespDTO.setType(standInfo.getType()); + standTypeEnum = WorkStandTypeEnum.parse(standInfo.getType()); + if (standTypeEnum != null) { + standRespDTO.setTypeDesc(standTypeEnum.getDesc()); + } + + standMap.put(standRespDTO.getStandId(), standRespDTO); + } + + // 审批项映射 + Map<Long, WorkApprovalItemInfo> itemsMap = new HashMap<>(items.size()); + for (WorkApprovalItemInfo item : items) { + itemsMap.put(item.getId(), item); + } + // 已填写审批项映射 + Map<Long, List<OthersWorkApprovalUnitFilledItemRespDTO>> filledItemMap = new HashMap<>(filledItems.size()); + OthersWorkApprovalUnitFilledItemRespDTO filledItemRespDTO; + WorkApprovalItemInfo itemInfo; + RuleItemTypeEnum itemType; + WorkRuleMeasureOptEnum optEnum; + ApprovalFilledItemType filledItemType; + for (WorkApprovalFilledItemInfo filledItem : filledItems) { + filledItemRespDTO = new OthersWorkApprovalUnitFilledItemRespDTO(); + filledItemRespDTO.setId(filledItem.getId()); + filledItemRespDTO.setWorkApplyId(filledItem.getWorkApplyId()); + filledItemRespDTO.setUnitId(filledItem.getUnitId()); + filledItemRespDTO.setMeasureVal(filledItem.getMeasureVal()); + filledItemRespDTO.setMeasureText(filledItem.getMeasureText()); + filledItemRespDTO.setAnalysisLocation(filledItem.getAnalysisLocation()); + filledItemRespDTO.setVal(filledItem.getVal()); + filledItemRespDTO.setItemId(filledItem.getItemId()); + filledItemRespDTO.setFillType(filledItem.getFillType()); + optEnum = WorkRuleMeasureOptEnum.parse(filledItem.getMeasureVal()); + if (optEnum != null) { + filledItemRespDTO.setMeasureValDesc(optEnum.getDesc()); + } + filledItemType = ApprovalFilledItemType.parse(filledItem.getFillType()); + if (filledItemType != null) { + filledItemRespDTO.setFillTypeDesc(filledItemType.value); + } + itemInfo = itemsMap.get(filledItem.getItemId()); + if (itemInfo != null) { + filledItemRespDTO.setItemName(itemInfo.getItemName()); + filledItemRespDTO.setStandId(itemInfo.getStandId()); + filledItemRespDTO.setMeasureId(itemInfo.getMeasureId()); + filledItemRespDTO.setMeasureInvolve(itemInfo.getMeasureInvolve()); + filledItemRespDTO.setItemType(itemInfo.getType()); + itemType = RuleItemTypeEnum.parse(itemInfo.getType()); + if (itemType != null) { + filledItemRespDTO.setItemTypeDesc(itemType.getValue()); + } + // 措施 + filledItemRespDTO.setMeasure(measureMap.get(itemInfo.getMeasureId())); + // 标准 + filledItemRespDTO.setStand(standMap.get(itemInfo.getStandId())); + + } + + if (filledItemMap.get(filledItem.getUnitId()) == null) { + List<OthersWorkApprovalUnitFilledItemRespDTO> list = new ArrayList<>(); + list.add(filledItemRespDTO); + filledItemMap.put(filledItem.getUnitId(), list); + } else { + filledItemMap.get(filledItem.getUnitId()).add(filledItemRespDTO); + } + } + + // 作业人处理 +// List<OthersWorkApprovedApplyOperatorRespDTO> operatorRespDTOs = new ArrayList<>(operators.size()); +// OthersWorkApprovedApplyOperatorRespDTO operatorRespDTO; +// for (WorkApplyOperatorInfo operator : operators) { +// operatorRespDTO = new OthersWorkApprovedApplyOperatorRespDTO(); +// operatorRespDTO.setId(operator.getId()); +// operatorRespDTO.setOperatorUid(operator.getOperatorUid()); +// operatorRespDTO.setOperatorUname(operator.getOperatorUname()); +// operatorRespDTO.setOperatorCertificate(operator.getOperatorCertificate()); +// operatorRespDTO.setOperatorPhone(operator.getOperatorPhone()); +// operatorRespDTO.setOperatorIdentify(operator.getOperatorIdentify()); +// operatorRespDTO.setWorkApplyId(operator.getWorkApplyId()); +// operatorRespDTOs.add(operatorRespDTO); +// } + + // 层级处理 + Long currentStepId = workApplyInfo.getApprovalStepId(); + // 已经走过的层级和当前所处层级 + List<WorkApprovalStepInfo> approvedSteps = this.makeApprovedStepInOrder(currentStepId, steps); + + List<OthersWorkApprovalStepRespDTO> stepRespDTOs = new ArrayList<>(approvedSteps.size()); + OthersWorkApprovalStepRespDTO stepRespDTO; + OthersWorkApprovalUnitRespDTO stepUnitRespDTO; + OthersWorkApprovalItemRespDTO stepItemRespDTO; + ApprovalStepTypeEnum stepTypeEnum; + WorkApprovalStepResultEnum approvalStepResultEnum; + WorkApprovalUnitResultEnum approvalUnitResultEnum; + RuleItemTypeEnum itemTypeEnum; + AuditTypeEnum auditTypeEnum; + // 1.层级处理和单元处理 + for (WorkApprovalStepInfo step : approvedSteps) { + stepRespDTO = new OthersWorkApprovalStepRespDTO(); + stepRespDTO.setStepId(step.getId()); + stepRespDTO.setWorkApplyId(step.getWorkApplyId()); + stepRespDTO.setApprovalResult(step.getApprovalResult()); + approvalStepResultEnum = WorkApprovalStepResultEnum.parse(step.getApprovalResult()); + if (approvalStepResultEnum != null) { + stepRespDTO.setApprovalResultDesc(approvalStepResultEnum.getDesc()); + } + stepRespDTO.setExpFinishApprovalTime(step.getExpFinishApprovalTime()); + stepRespDTO.setFinishApprovalTime(step.getFinishApprovalTime()); + stepRespDTO.setType(step.getType()); + stepTypeEnum = ApprovalStepTypeEnum.parse(step.getType()); + if (stepTypeEnum != null) { + stepRespDTO.setTypeDesc(stepTypeEnum.getDesc()); + } + stepRespDTO.setStartApprovalTime(step.getStartApprovalTime()); + stepRespDTO.setStepSerial(step.getStepSerial()); + stepRespDTO.setNextStepId(step.getNextStepId()); + stepRespDTO.setPreStepId(step.getPreStepId()); + stepRespDTO.setContainItem(step.getContainItem()); + stepRespDTO.setStepName(step.getStepName()); + stepRespDTO.setAuditType(step.getAuditType()); + auditTypeEnum = AuditTypeEnum.parse(step.getAuditType()); + if (auditTypeEnum != null) { + stepRespDTO.setAuditTypeDesc(auditTypeEnum.getDesc()); + } + + // 审批项处理 + List<WorkApprovalItemInfo> stepItems = items.stream().filter(item -> + // 当前层级的审批项 + step.getId().equals(item.getStepId())) + // 集合 + .collect(Collectors.toList()); + + List<OthersWorkApprovalItemRespDTO> stepItemDTOs = new ArrayList<>(stepItems.size()); + for (WorkApprovalItemInfo stepItem : stepItems) { + stepItemRespDTO = new OthersWorkApprovalItemRespDTO(); + stepItemRespDTO.setItemId(stepItem.getId()); + stepItemRespDTO.setStepId(step.getId()); + stepItemRespDTO.setWorkApplyId(stepItem.getWorkApplyId()); + stepItemRespDTO.setItemName(stepItem.getItemName()); + stepItemRespDTO.setMeasureId(stepItem.getMeasureId()); + stepItemRespDTO.setMeasureInvolve(stepItem.getMeasureInvolve()); + stepItemRespDTO.setStandId(stepItem.getStandId()); + stepItemRespDTO.setUnitId(stepItem.getUnitId()); + stepItemRespDTO.setType(stepItem.getType()); + itemTypeEnum = RuleItemTypeEnum.parse(stepItem.getType()); + stepItemRespDTO.setTypeDesc(itemTypeEnum.getValue()); + // 措施 + stepItemRespDTO.setMeasure(measureMap.get(stepItem.getMeasureId())); + // 标准 + stepItemRespDTO.setStand(standMap.get(stepItem.getStandId())); + stepItemDTOs.add(stepItemRespDTO); + } + + // 当前层级单元 + List<WorkApprovalUnitInfo> stepUnits = units.stream().filter(unit -> + // 所属层级 + step.getId().equals(unit.getStepId())) + // 集合 + .collect(Collectors.toList()); + // 单元处理 + List<OthersWorkApprovalUnitRespDTO> stepUnitDTOs = new ArrayList<>(stepUnits.size()); + for (WorkApprovalUnitInfo stepUnit : stepUnits) { + stepUnitRespDTO = new OthersWorkApprovalUnitRespDTO(); + stepUnitRespDTO.setUnitId(stepUnit.getId()); + stepUnitRespDTO.setStepId(stepUnit.getStepId()); + stepUnitRespDTO.setWorkApplyId(stepUnit.getWorkApplyId()); + stepUnitRespDTO.setResult(stepUnit.getResult()); + approvalUnitResultEnum = WorkApprovalUnitResultEnum.parse(stepUnit.getResult()); + if (approvalUnitResultEnum != null) { + stepUnitRespDTO.setResultDesc(approvalUnitResultEnum.getDesc()); + } + stepUnitRespDTO.setApprovalUid(stepUnit.getApprovalUid()); + stepUnitRespDTO.setApprovalUname(stepUnit.getApprovalUname()); + stepUnitRespDTO.setApprovalActualTime(stepUnit.getApprovalActualTime()); + stepUnitRespDTO.setApprovalEndTime(stepUnit.getApprovalEndTime()); + stepUnitRespDTO.setApprovalStartTime(stepUnit.getApprovalStartTime()); + stepUnitRespDTO.setFilledContent(stepUnit.getFillContent()); + if (filledItemMap.get(stepUnit.getId()) != null) { + stepUnitRespDTO.setFilledItems(filledItemMap.get(stepUnit.getId())); + } + stepUnitDTOs.add(stepUnitRespDTO); + } + + stepRespDTO.setStepItems(stepItemDTOs); + stepRespDTO.setStepUnits(stepUnitDTOs); + stepRespDTOs.add(stepRespDTO); + + + } + result.setWorkApplyId(workApplyInfo.getId()); + result.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); +// result.setOperators(operatorRespDTOs); + result.setOperatorCompanys(workApplyInfo.getOperatorCompanys()); + result.setOperatorUnames(workApplyInfo.getOperatorUnames()); + result.setApprovalSteps(stepRespDTOs); + result.setWorkContent(workApplyInfo.getWorkContent()); + result.setWorkLocation(workApplyInfo.getWorkLocation()); + result.setHazardIdentification(workApplyInfo.getHazardIdentification()); + return result; + } + + /** + * 打印票证 + * @param currentUser + */ + @Override + public void printing(ContextCacheUser currentUser, Long applyWorkId, HttpServletResponse response) { + //主键id不可为空 + if(null == applyWorkId){ + throw new BusinessException(ResultCodes.CLIENT_PARAM_NULL); + } + //获取当前作业基础数据 + WorkApplyInfo workApplyInfo = workApplyInfoService.getById(applyWorkId); + if(workApplyInfo == null){ + throw new BusinessException(E.DATA_DATABASE_NO_EXISTENT,"该条作业不存在!"); + } + //判断该作业未结束不可打印(暂定) + if(!WorkStatusEnum.parse(workApplyInfo.getStatus()).equals(WorkStatusEnum.STATU_FINISH)){ + throw new BusinessException(E.DATA_STATUS_CHECK_INVALID,"此作业票未走完审批流,不可导出!"); + } + //调用具体导出功能 + workPrintService.workPrint(response,workApplyInfo); + + } + + + private Object getWorkDetail(WorkTypeEnum workTypeEnum, Long workApplyId, Long workDetailId) { + Object result = null; + switch (workTypeEnum) { + case WORK_FIRE: + if (null != workDetailId) { + WorkHotInfo workHotInfo = workHotInfoService.getById(workDetailId); + if (workHotInfo != null) { + WorkApplyHotRespDTO hotRespDTO = new WorkApplyHotRespDTO(); + hotRespDTO.setHotId(workHotInfo.getId()); + hotRespDTO.setWorkApplyId(workApplyId); + hotRespDTO.setHotMethod(workHotInfo.getHotMethod()); + hotRespDTO.setOtherSpecialWork(workHotInfo.getOtherSpecialWork()); + result = hotRespDTO; + } + } + break; + case WORK_CLOSE_SPACE: + if (null != workDetailId) { + WorkConfinedSpaceInfo confinedSpaceInfo = workConfinedSpaceInfoService.getById(workDetailId); + if (confinedSpaceInfo != null) { + WorkApplyConfinedSpaceRespDTO confinedSpaceRespDTO = new WorkApplyConfinedSpaceRespDTO(); + confinedSpaceRespDTO.setId(confinedSpaceInfo.getId()); + confinedSpaceRespDTO.setWorkApplyId(workApplyId); + confinedSpaceRespDTO.setCsDepId(confinedSpaceInfo.getCsDepId()); + confinedSpaceRespDTO.setCsName(confinedSpaceInfo.getCsName()); + confinedSpaceRespDTO.setCsOriginalName(confinedSpaceInfo.getCsOriginalName()); + confinedSpaceRespDTO.setOtherSpecialWork(confinedSpaceInfo.getOtherSpecialWork()); + result = confinedSpaceRespDTO; + } + } + break; + case WORK_BLIND_PLATE: + if (null != workDetailId) { + WorkBlindPlatePluggingInfo blindPlatePluggingInfo = workBlindPlatePluggingInfoService.getById(workDetailId); + if (blindPlatePluggingInfo != null) { + WorkApplyBlindPlatePluggingRespDTO blindPlatePluggingRespDTO = new WorkApplyBlindPlatePluggingRespDTO(); + blindPlatePluggingRespDTO.setId(blindPlatePluggingInfo.getId()); + blindPlatePluggingRespDTO.setWorkApplyId(workApplyId); + blindPlatePluggingRespDTO.setBpCode(blindPlatePluggingInfo.getBpCode()); + blindPlatePluggingRespDTO.setMainMedia(blindPlatePluggingInfo.getMainMedia()); + blindPlatePluggingRespDTO.setTemperature(blindPlatePluggingInfo.getTemperature()); + blindPlatePluggingRespDTO.setPressure(blindPlatePluggingInfo.getPressure()); + blindPlatePluggingRespDTO.setBpMaterialQuality(blindPlatePluggingInfo.getBpMaterialQuality()); + blindPlatePluggingRespDTO.setBpSpecification(blindPlatePluggingInfo.getBpSpecification()); + blindPlatePluggingRespDTO.setBpLocation(blindPlatePluggingInfo.getBpLocation()); + blindPlatePluggingRespDTO.setInstallBpTime(blindPlatePluggingInfo.getInstallBpTime()); + blindPlatePluggingRespDTO.setUninstallBpTime(blindPlatePluggingInfo.getUninstallBpTime()); + blindPlatePluggingRespDTO.setOtherSpecialWork(blindPlatePluggingInfo.getOtherSpecialWork()); + blindPlatePluggingRespDTO.setBpLocationMapPath(blindPlatePluggingInfo.getBpLocationMapPath()); + result = blindPlatePluggingRespDTO; + } + } + break; + case WORK_BROKE_ROAD: + if (null != workDetailId) { + WorkBrokenCircuitInfo brokenCircuitInfo = workBrokenCircuitInfoService.getById(workDetailId); + if (brokenCircuitInfo != null) { + WorkApplyBrokenCircuitRespDTO brokenCircuitRespDTO = new WorkApplyBrokenCircuitRespDTO(); + brokenCircuitRespDTO.setId(brokenCircuitInfo.getId()); + brokenCircuitRespDTO.setWorkApplyId(workApplyId); + brokenCircuitRespDTO.setOperationDepId(brokenCircuitInfo.getOperationDepId()); + brokenCircuitRespDTO.setBcReason(brokenCircuitInfo.getBcReason()); + brokenCircuitRespDTO.setBcExplain(brokenCircuitInfo.getBcExplain()); + brokenCircuitRespDTO.setInvolvedDepIds(brokenCircuitInfo.getInvolvedDepIds()); + brokenCircuitRespDTO.setBcPath(brokenCircuitInfo.getBcPath()); + result = brokenCircuitRespDTO; + } + } + break; + case WORK_DIF_SOLI: + if (null != workDetailId) { + WorkGroundBreakingInfo groundBreakingInfo = workGroundBreakingInfoService.getById(workDetailId); + if (groundBreakingInfo != null) { + WorkApplyGroundBreakingRespDTO groundBreakingRespDTO = new WorkApplyGroundBreakingRespDTO(); + groundBreakingRespDTO.setId(groundBreakingInfo.getId()); + groundBreakingRespDTO.setWorkApplyId(workApplyId); + groundBreakingRespDTO.setOperationDepId(groundBreakingInfo.getOperationDepId()); + groundBreakingRespDTO.setGbScope(groundBreakingInfo.getGbScope()); + groundBreakingRespDTO.setGbMethod(groundBreakingInfo.getGbMethod()); + groundBreakingRespDTO.setOtherSpecialWork(groundBreakingInfo.getOtherSpecialWork()); + groundBreakingRespDTO.setGbPath(groundBreakingInfo.getGbPath()); + result = groundBreakingRespDTO; + } + } + break; + case WORK_HIGH_SPACE: + if (null != workDetailId) { + WorkAtHeightInfo atHeightInfo = workAtHeightInfoService.getById(workDetailId); + if (atHeightInfo != null) { + WorkApplyAtHeightRespDTO atHeightRespDTO = new WorkApplyAtHeightRespDTO(); + atHeightRespDTO.setId(atHeightInfo.getId()); + atHeightRespDTO.setWorkApplyId(workApplyId); + atHeightRespDTO.setOperationDepId(atHeightInfo.getOperationDepId()); + atHeightRespDTO.setOperationHeight(atHeightInfo.getOperationHeight()); + atHeightRespDTO.setOtherSpecialWork(atHeightInfo.getOtherSpecialWork()); + result = atHeightRespDTO; + } + } + break; + case WORK_HANG: + if (null != workDetailId) { + WorkHoistingInfo hoistingInfo = workHoistingInfoService.getById(workDetailId); + if (hoistingInfo != null) { + WorkApplyHoistingRespDTO hoistingRespDTO = new WorkApplyHoistingRespDTO(); + hoistingRespDTO.setId(hoistingInfo.getId()); + hoistingRespDTO.setWorkApplyId(workApplyId); + hoistingRespDTO.setHoistingToolName(hoistingInfo.getHoistingToolName()); + hoistingRespDTO.setWeightMass(hoistingInfo.getWeightMass()); + result = hoistingRespDTO; + } + } + break; + case WORK_TEMP_ELECTRIC: + if (null != workDetailId) { + WorkTemporaryPowerInfo temporaryPowerInfo = workTemporaryPowerInfoService.getById(workDetailId); + if (temporaryPowerInfo != null) { + WorkApplyTemporaryPowerRespDTO temporaryPowerRespDTO = new WorkApplyTemporaryPowerRespDTO(); + temporaryPowerRespDTO.setId(temporaryPowerInfo.getId()); + temporaryPowerRespDTO.setWorkApplyId(workApplyId); + temporaryPowerRespDTO.setPowerAccessPoint(temporaryPowerInfo.getPowerAccessPoint()); + temporaryPowerRespDTO.setWorkingVoltage(temporaryPowerInfo.getWorkingVoltage()); + temporaryPowerRespDTO.setEquipmentAndPower(temporaryPowerInfo.getEquipmentAndPower()); + result = temporaryPowerRespDTO; + } + } + break; + } + return result; + } + + // 递归寻找有序的层级 + private List<WorkApprovalStepInfo> makeApprovedStepInOrder(Long currentStepId, List<WorkApprovalStepInfo> steps) { + Map<Long, WorkApprovalStepInfo> map = new HashMap<>(); + List<WorkApprovalStepInfo> result = new ArrayList<>(); + for (WorkApprovalStepInfo step : steps) { + map.put(step.getId(), step); + } + + WorkApprovalStepInfo currentStep = map.get(currentStepId); + make(currentStep, map, result); + return result; + } + + private void make(WorkApprovalStepInfo currentStep, Map<Long, WorkApprovalStepInfo> map,List<WorkApprovalStepInfo> result) { + result.add(0, currentStep); + if (currentStep.getPreStepId() != null) { + currentStep = map.get(currentStep.getPreStepId()); + make(currentStep, map, result); + } + } + + /** + * @Description: 根据 单向变双向 + */ + private List<WorkApprovalStepInfoBO> tidyRuleStepEntities(List<WorkApprovalStepInfoBO> ruleStepEntities) { + List<WorkApprovalStepInfoBO> result = Collections.emptyList(); + if (ruleStepEntities != null && ruleStepEntities.size() > 0) { + Map<Long, WorkApprovalStepInfoBO> map = new HashMap<>(); + Map<Long, Long> idMap = new HashMap<>(); + // 头节点 + for (WorkApprovalStepInfoBO workApprovalStepInfo : ruleStepEntities) { + map.put(workApprovalStepInfo.getOriginalPreStepId(), workApprovalStepInfo); + idMap.put(workApprovalStepInfo.getOriginalId(), workApprovalStepInfo.getId()); + } + WorkApprovalStepInfoBO headStep = map.get(null); + if (headStep != null) { + makeNext(headStep, map,idMap); + } + + return new ArrayList<>(map.values()); + } + return result; + + } + + private void makeNext(WorkApprovalStepInfoBO headStep, Map<Long, WorkApprovalStepInfoBO> map,Map<Long, Long> idMap) { + // 获取下一个节点 + WorkApprovalStepInfoBO nextStep = map.get(headStep.getOriginalId()); + headStep.setNextStepId(nextStep.getId()); + headStep.setPreStepId(idMap.get(headStep.getOriginalPreStepId())); + headStep = nextStep; + if (map.get(headStep.getOriginalId()) != null) { + makeNext(headStep, map,idMap); + }else{ + // 尾部 特殊处理 + headStep.setPreStepId(idMap.get(headStep.getOriginalPreStepId())); + } + + } + + + private boolean judge(BigDecimal actualVal, BigDecimal comparedVal, RuleStandMatchingTypeEnum matchPattern) { + boolean result = false; + switch (matchPattern) { + case EQUAL: + if (actualVal.compareTo(comparedVal) == 0) { + result = true; + } + break; + case LESS_THAN: + if (actualVal.compareTo(comparedVal) < 0) { + result = true; + } + break; + case GREATER_THAN: + if (actualVal.compareTo(comparedVal) > 0) { + result = true; + } + break; + case LESS_THAN_AND_EQUAL:; + if (actualVal.compareTo(comparedVal) < 0 || actualVal.compareTo(comparedVal) == 0) { + result = true; + } + break; + case GREATER_THAN_AND_EQUAL: + if (actualVal.compareTo(comparedVal) > 0 || actualVal.compareTo(comparedVal) == 0) { + result = true; + } + break; + + } + + return result; + + } + + + /** + * @Description: 根据 RuleContinueTimeUnitEnum 获取秒数 + * @date 2022/8/23 16:14 + */ + private long generateSeconds(RuleContinueTimeUnitEnum unit, int continueTime) { + long result = 0; + if (continueTime > 0) { + switch (unit) { + case TYPE_DAY: + result = continueTime * 60 * 60 * 24; + break; + case TYPE_HOUR: + result = continueTime * 60 * 60; + break; + case TYPE_MINUTE: + result = continueTime * 60; + break; + case TYPE_SECOND: + result = continueTime; + break; + } + } + + return result; + } + + /** + * 生成作业证编号 + */ + private String generateWorkCode(int workCount){ + if(workCount < 0){ + return null; + } + String code = null; + String prefix = "ZT-"; + String serialCode = null; + if(workCount >= 1000000){ + serialCode = "" + (workCount+1); + }else if(workCount >=0){ + String countStr = String.valueOf(workCount+1); + serialCode = "0000000".substring(0,(7 - countStr.length()))+countStr; + } + if(serialCode != null && !serialCode.isEmpty()){ + code = prefix+serialCode; + } + return code; + } + + private Date conversionTimeType(LocalDateTime localDateTime){ + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = localDateTime.atZone(zoneId); + Date date = Date.from(zdt.toInstant()); + return date; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkAtHeightPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkAtHeightPrintServiceImpl.java new file mode 100644 index 0000000..7c7981e --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkAtHeightPrintServiceImpl.java @@ -0,0 +1,279 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkAtHeightPrintService; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkAtHeightPrintService") +public class WorkAtHeightPrintServiceImpl implements WorkAtHeightPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkAtHeightInfoService workAtHeightInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workAtHeightPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //高处作业 + WorkAtHeightInfo workAtHeightInfo = workAtHeightInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("workLocation",workApplyInfo.getWorkLocation()); + baseDataMap.put("workContent",workApplyInfo.getWorkContent()); + baseDataMap.put("workHight",String.valueOf(workAtHeightInfo.getOperationHeight() == null ? 0.0 : workAtHeightInfo.getOperationHeight())+"米"); + baseDataMap.put("workType",WorkLevelEnum.parse(workApplyInfo.getWorkLevel()).getTitle()); + baseDataMap.put("workDepName",workAtHeightInfo.getOperationDepName()); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + baseDataMap.put("otherSpeicialWork",WorkPrintShiftUtil.shiftOtherSpecialWork(workAtHeightInfo.getOtherSpecialWork())); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + /* String approvalResult = ""; + //生成审批人字符串 + StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workAtHeight.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workAtHeight示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBlindPlatePluggingPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBlindPlatePluggingPrintServiceImpl.java new file mode 100644 index 0000000..8a67079 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBlindPlatePluggingPrintServiceImpl.java @@ -0,0 +1,279 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBlindPlatePluggingPrintService; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkBlindPlatePluggingPrintService") +public class WorkBlindPlatePluggingPrintServiceImpl implements WorkBlindPlatePluggingPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkBlindPlatePluggingInfoService workBlindPlatePluggingInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workBlindPlatePluggingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //盲板作业 + WorkBlindPlatePluggingInfo workBlindPlatePluggingInfo = workBlindPlatePluggingInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("mainMedia",workBlindPlatePluggingInfo.getMainMedia()); + baseDataMap.put("temperature",String.valueOf(workBlindPlatePluggingInfo.getTemperature() == null ? 0.0 : workBlindPlatePluggingInfo.getTemperature())+"℃"); + baseDataMap.put("pressure",String.valueOf(workBlindPlatePluggingInfo.getPressure() == null ? 0.0 : workBlindPlatePluggingInfo.getPressure())+"kPa"); + baseDataMap.put("bpMq",workBlindPlatePluggingInfo.getBpMaterialQuality()); + baseDataMap.put("bpSp",workBlindPlatePluggingInfo.getBpSpecification()); + baseDataMap.put("bpCode",workBlindPlatePluggingInfo.getBpCode()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + /* String approvalResult = ""; + //生成审批人字符串 + StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workBlindPlatePlugging.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException(E.EXPORT_FAIL,"模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workBlindPlugging示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBrokenCircuitPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBrokenCircuitPrintServiceImpl.java new file mode 100644 index 0000000..b6f7684 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkBrokenCircuitPrintServiceImpl.java @@ -0,0 +1,303 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkBrokenCircuitPrintService") +public class WorkBrokenCircuitPrintServiceImpl implements WorkBrokenCircuitPrintService { + @Autowired + private AccountDepartmentService accountDepartmentService; + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkBrokenCircuitInfoService workBrokenCircuitInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workBrokenCircuitPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //断路作业 + WorkBrokenCircuitInfo workBrokenCircuitInfo = workBrokenCircuitInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 + //List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + List<DepInfoRPCRespDTO> depInfoByDepIds = getDepInfoByDepId(WorkPrintShiftUtil.shiftList(workBrokenCircuitInfo.getInvolvedDepIds())); + //List<DepInfoRPCRespDTO> deptInfoList = (List<DepInfoRPCRespDTO>) accountDepartmentService.listDepByDepIds(WorkPrintShiftUtil.shiftList(workBrokenCircuitInfo.getInvolvedDepIds())).getData(); + String involvedDeptNames = WorkPrintShiftUtil.shiftInvolvedDepName(depInfoByDepIds); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workDepName",workBrokenCircuitInfo.getOperationDepName()); + baseDataMap.put("involvedDepNames",involvedDeptNames); + baseDataMap.put("bcReason",workBrokenCircuitInfo.getBcReason()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("bcExplain",workBrokenCircuitInfo.getBcExplain()); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + String approvalResult = ""; + //生成审批人字符串 + /*StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workBrokenCircuit.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workBrokenCircuit示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } + + //调用Rpc 获取部门 + private List<DepInfoRPCRespDTO> getDepInfoByDepId(List<Long> deptIds) { + List<DepInfoRPCRespDTO> depList = new ArrayList<>(); + try{ + ResultVO<List<DepInfoRPCRespDTO>> listResultVO = accountDepartmentService.listDepByDepIds(deptIds); + if (listResultVO != null && listResultVO.getCode().equals(ResultCodes.OK.getCode())) { + if (listResultVO.getData() != null) { + depList = (List<DepInfoRPCRespDTO>) listResultVO.getData(); + }else{ + throw new BusinessException(ResultCodes.CLIENT_DEP_NOT_EXIST); + } + } else { + throw new BusinessException(ResultCodes.RPC_ACCESS_EXCEPTION); + } + }catch (Exception e){ + throw new BusinessException(ResultCodes.RPC_ACCESS_EXCEPTION); + } + return depList; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkConfinedSpacePrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkConfinedSpacePrintServiceImpl.java new file mode 100644 index 0000000..bccab85 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkConfinedSpacePrintServiceImpl.java @@ -0,0 +1,290 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.WorkConfinedSpacePrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkConfinedSpacePrintService") +public class WorkConfinedSpacePrintServiceImpl implements WorkConfinedSpacePrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkConfinedSpaceInfoService workConfinedSpaceInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + @Autowired + private WorkApprovalItemStandInfoService workApprovalItemStandInfoService; + + + public Map<String,Object> workConfinedSpacePrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //高处作业 + WorkConfinedSpaceInfo workConfinedSpaceInfo = workConfinedSpaceInfoService.getById(workApplyInfo.getWorkDetailId()); +// //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + //获取标准 + List<WorkApprovalItemStandInfo> workApprovalItemStandInfoList = workApprovalItemStandInfoService.listWorkApprovalItemStandByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workDepName",workConfinedSpaceInfo.getCsDepName()); + baseDataMap.put("csName",workConfinedSpaceInfo.getCsName()); + baseDataMap.put("workContent",workApplyInfo.getWorkContent()); + baseDataMap.put("csOriginalName",workConfinedSpaceInfo.getCsOriginalName()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + baseDataMap.put("otherSpeicialWork",WorkPrintShiftUtil.shiftOtherSpecialWork(workConfinedSpaceInfo.getOtherSpecialWork())); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + //获取该审批项对应的标准 + List<WorkApprovalItemStandInfo> standInfoList = workApprovalItemStandInfoList.stream().filter(standInfo -> standInfo.getId().equals(itemInfo.getStandId())).collect(Collectors.toList()); + WorkApprovalItemStandInfo standInfo = standInfoList.get(0); + String standard = RuleStandMatchingTypeEnum.parse(standInfo.getMinValMatchPattern()).getValue() + standInfo.getMinVal()+"%" + "," + RuleStandMatchingTypeEnum.parse(standInfo.getMaxValMatchPattern()).getValue() + standInfo.getMaxVal().toString()+"%"; + + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaStand",standard); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + String approvalResult = ""; + //生成审批人字符串 + /* StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workConfinedSpace.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workConfinedSpace示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkGroundBreakingPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkGroundBreakingPrintServiceImpl.java new file mode 100644 index 0000000..e7b86a7 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkGroundBreakingPrintServiceImpl.java @@ -0,0 +1,274 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.WorkGroundBreakingPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkGroundBreakingPrintService") +public class WorkGroundBreakingPrintServiceImpl implements WorkGroundBreakingPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkGroundBreakingInfoService workGroundBreakingInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workGroundBreakingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //动土作业 + WorkGroundBreakingInfo workGroundBreakingInfo = workGroundBreakingInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 + //List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workLocation",workApplyInfo.getWorkLocation()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("workDepName",workGroundBreakingInfo.getOperationDepName()); + baseDataMap.put("otherSpeicialWork",WorkPrintShiftUtil.shiftOtherSpecialWork(workGroundBreakingInfo.getOtherSpecialWork())); + baseDataMap.put("workScm","作业范围:" + workGroundBreakingInfo.getGbScope() + " 作业内容:" + workApplyInfo.getWorkContent() + " 作业方式:" +workGroundBreakingInfo.getGbMethod()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + String approvalResult = ""; + //生成审批人字符串 + /*StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workGroundBreaking.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workGroundBreaking示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHoistingPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHoistingPrintServiceImpl.java new file mode 100644 index 0000000..fb1d493 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHoistingPrintServiceImpl.java @@ -0,0 +1,277 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.WorkHoistingPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkHoistingPrintService") +public class WorkHoistingPrintServiceImpl implements WorkHoistingPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkHoistingInfoService workHoistingInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workHoistingPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //吊装作业 + WorkHoistingInfo workHoistingInfo = workHoistingInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("workLocation",workApplyInfo.getWorkLocation()); + baseDataMap.put("hoistingToolName",workHoistingInfo.getHoistingToolName()); +// baseDataMap.put("operatorNames",WorkPrintShiftUtil.shiftOperators(workApplyOperatorInfoList)); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + baseDataMap.put("weightMass",String.valueOf(workHoistingInfo.getWeightMass() == null ? 0.0 : workHoistingInfo.getWeightMass()) + "t"); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("workContent",workApplyInfo.getWorkContent()); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + /*String approvalResult = ""; + //生成审批人字符串 + StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workHoisting.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workHoisting示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHotPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHotPrintServiceImpl.java new file mode 100644 index 0000000..6bf7539 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkHotPrintServiceImpl.java @@ -0,0 +1,276 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.WorkHotPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkHotPrintService") +public class WorkHotPrintServiceImpl implements WorkHotPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkHotInfoService workHotInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workHotPrint(WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //动火作业 + WorkHotInfo workHotInfo = workHotInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workLevel",WorkLevelEnum.parse(workApplyInfo.getWorkLevel()).getTitle()); + baseDataMap.put("workMethod",workHotInfo.getHotMethod()); + baseDataMap.put("addressAndContent",workApplyInfo.getWorkLocation() + " " + workApplyInfo.getWorkContent()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + baseDataMap.put("otherSpeicialWork",WorkPrintShiftUtil.shiftOtherSpecialWork(workHotInfo.getOtherSpecialWork())); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + //选择类型使用 + //审批人审批结果 + /*String approvalResult = ""; + //生成审批人字符串 + StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + + //遍历审批人 获取审批数据 填充 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + + + } + } + + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workhot.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workHot示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkPrintServiceImpl.java new file mode 100644 index 0000000..6c90683 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkPrintServiceImpl.java @@ -0,0 +1,92 @@ +package com.gk.hotwork.specialWork.service.impl; + + + +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.enums.WorkTypeEnum; +import com.gk.hotwork.specialWork.service.*; +import com.gk.hotwork.specialWork.util.WorkExportUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +@Service("WorkPrintService") +public class WorkPrintServiceImpl implements WorkPrintService { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + private WorkHotPrintService workHotPrintService; + @Autowired + private WorkBlindPlatePluggingPrintService workBlindPlatePluggingPrintService; + @Autowired + private WorkAtHeightPrintService workAtHeightPrintService; + @Autowired + private WorkConfinedSpacePrintService workConfinedSpacePrintService; + @Autowired + private WorkBrokenCircuitPrintService workBrokenCircuitPrintService; + @Autowired + private WorkGroundBreakingPrintService workGroundBreakingPrintService; + @Autowired + private WorkHoistingPrintService workHoistingPrintService; + @Autowired + private WorkTemporaryPowerPrintService workTemporaryPowerPrintService; + + /** + * 作业打印 + * @param workApplyInfo + */ + public void workPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + Map<String, Object> dataMap = new HashMap<>(); + switch (WorkTypeEnum.parse(workApplyInfo.getWorkType())) { + case WORK_FIRE: + exportWork(response,workHotPrintService.workHotPrint(workApplyInfo)); + break; + case WORK_CLOSE_SPACE: + exportWork(response,workConfinedSpacePrintService.workConfinedSpacePrint(response,workApplyInfo)); + break; + case WORK_BLIND_PLATE: + exportWork(response,workBlindPlatePluggingPrintService.workBlindPlatePluggingPrint(response,workApplyInfo)); + break; + case WORK_BROKE_ROAD: + exportWork(response,workBrokenCircuitPrintService.workBrokenCircuitPrint(response,workApplyInfo)); + break; + case WORK_DIF_SOLI: + exportWork(response,workGroundBreakingPrintService.workGroundBreakingPrint(response,workApplyInfo)); + break; + case WORK_HIGH_SPACE: + exportWork(response,workAtHeightPrintService.workAtHeightPrint(response,workApplyInfo)); + break; + case WORK_HANG: + exportWork(response,workHoistingPrintService.workHoistingPrint(response,workApplyInfo)); + break; + case WORK_TEMP_ELECTRIC: + exportWork(response,workTemporaryPowerPrintService.workTemporaryPowerPrint(response,workApplyInfo)); + break; + } + + } + + public void exportWork(HttpServletResponse response,Map<String, Object> dataMap){ + try{ + WorkExportUtil workExportUtil = new WorkExportUtil(); + workExportUtil.setTempLocalPath((String)dataMap.get("filePath")); //设置模板的路径 + workExportUtil.init(); //初始化工具类 + workExportUtil.export(dataMap); //写入相关数据 + workExportUtil.responseWord(response,(String)dataMap.get("fileName"),(String)dataMap.get("workCode")); + }catch (BusinessException e) { + e.printStackTrace(); + throw new BusinessException(e.getCode(), e.getMessage()); + }catch (Exception e){ + logger.error("导出失败!",e); + throw new BusinessException(E.EXPORT_FAIL,"导出失败!"); + } + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkProcessServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkProcessServiceImpl.java new file mode 100644 index 0000000..36ce8ae --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkProcessServiceImpl.java @@ -0,0 +1,275 @@ +package com.gk.hotwork.specialWork.service.impl; + +import cn.hutool.core.util.IdUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.AusinessException; +import com.gk.hotwork.Domain.Exception.E; +import com.gk.hotwork.Domain.Vo.PageQuery; +import com.gk.hotwork.Domain.Vo.SearchResultVO; +import com.gk.hotwork.Domain.co.ContextCacheUser; +import com.gk.hotwork.specialWork.entity.WorkApplyInfo; +import com.gk.hotwork.specialWork.entity.WorkApplyReportableDO; +import com.gk.hotwork.specialWork.entity.WorkProcessDetectionInfo; +import com.gk.hotwork.specialWork.entity.WorkProcessWarningInfo; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.model.dto.req.WorkProcessDetectionReqDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyReportableRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkProcessDetectionInfoRespDTO; +import com.gk.hotwork.specialWork.model.query.WorkProcessDetectionPageQuery; +import com.gk.hotwork.specialWork.model.query.WorkProcessWorkApplyQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessDetectionPageDBQuery; +import com.gk.hotwork.specialWork.model.query.db.WorkProcessWorkApplyDBQuery; +import com.gk.hotwork.specialWork.service.SpecialWorkMinoService; +import com.gk.hotwork.specialWork.service.WorkProcessService; + +import com.gk.hotwork.specialWork.service.baseService.WorkApplyInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkProcessDetectionInfoService; +import com.gk.hotwork.specialWork.service.baseService.WorkProcessWarningInfoService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Service("workProcessService") +public class WorkProcessServiceImpl implements WorkProcessService { + + @Autowired + private WorkApplyInfoService workApplyInfoService; + @Autowired + private WorkProcessDetectionInfoService workProcessDetectionInfoService; + @Autowired + private WorkProcessWarningInfoService workProcessWarningInfoService; + + + + @Transactional + @Override + public void detectionReport(ContextCacheUser currentUser, WorkProcessDetectionReqDTO reqDTO) { + if (StringUtils.isBlank(reqDTO.getWorkPermitNo())) { + throw new AusinessException(E.DATA_PARAM_NULL,"作业编号为空"); + } + if (reqDTO.getOxygen() == null && + reqDTO.getCarbonMonoxide() == null && + reqDTO.getCombustible() == null && + reqDTO.getHydrogenSulfide() == null) { + throw new AusinessException(E.DATA_PARAM_NULL,"至少传入一个数据"); + } + if (WorkReportSourceEnum.parse(reqDTO.getSource()) == null) { + throw new AusinessException(E.DATA_STATUS_CHECK_INVALID, "数据状态非法"); + } + + StringBuffer sb = new StringBuffer(); + // 数据异常状态判断 + WorkProcessDetectionResultEnum detectionResult = WorkProcessDetectionResultEnum.NORMAL; + // 氧气 + if (reqDTO.getOxygen() != null && reqDTO.getOxygen().compareTo(new BigDecimal("18")) < 0) { + detectionResult = WorkProcessDetectionResultEnum.ABNORMAL; + sb.append("氧气浓度低于"); + sb.append("18"); + sb.append(","); + } + // 可燃气 + if (reqDTO.getCombustible() != null && reqDTO.getCombustible().compareTo(new BigDecimal("1")) > 0) { + detectionResult = WorkProcessDetectionResultEnum.ABNORMAL; + sb.append("可燃气浓度超过"); + sb.append("18"); + sb.append(","); + } + // 一氧化碳 + if (reqDTO.getCarbonMonoxide() != null && reqDTO.getCarbonMonoxide().compareTo(new BigDecimal("24")) > 0) { + detectionResult = WorkProcessDetectionResultEnum.ABNORMAL; + sb.append("一氧化碳浓度超过"); + sb.append("24"); + sb.append(","); + } + // 硫化氢 + if (reqDTO.getHydrogenSulfide() != null && reqDTO.getHydrogenSulfide().compareTo(new BigDecimal("10")) > 0) { + detectionResult = WorkProcessDetectionResultEnum.ABNORMAL; + sb.append("硫化氢浓度超过"); + sb.append("10"); + sb.append(","); + } + sb.deleteCharAt(sb.length() - 1); + + String workPermitNo = reqDTO.getWorkPermitNo().trim(); + WorkApplyInfo workApplyInfo = workApplyInfoService.getApplyInfoByWorkPermitNo(workPermitNo); + if (workApplyInfo == null) { + throw new AusinessException(E.DATA_PARAM_CHECK_INVALID, "作业编号不存在"); + } + // 审批结束 + if (!workApplyInfo.getStatus().equals(WorkStatusEnum.STATU_FINISH.getStatus())) { + throw new AusinessException(E.DATA_STATUS_CHECK_INVALID, "未结束审批作业状态无法上报"); + } + LocalDateTime operationTime = LocalDateTime.now(); + // 时间校验 + if (operationTime.isBefore(workApplyInfo.getExpStartTime()) || + operationTime.isAfter(workApplyInfo.getExpEndTime())) { + throw new AusinessException(E.DATA_PARAM_CHECK_INVALID, "上报时间不在作业时间内"); + } + // exc + WorkProcessDetectionInfo detectionEntity = new WorkProcessDetectionInfo(); + detectionEntity.setId(IdUtil.getSnowflake(0,0).nextId()); + detectionEntity.setWorkApplyId(workApplyInfo.getId()); + detectionEntity.setWorkPermitNo(workPermitNo); + detectionEntity.setWorkType(workApplyInfo.getWorkType()); + detectionEntity.setWorkLevel(workApplyInfo.getWorkLevel()); + detectionEntity.setOperationTime(operationTime); + detectionEntity.setOperatorUid(currentUser.getUid()); + detectionEntity.setOperatorUname(currentUser.getRealName()); + detectionEntity.setOperationTime(operationTime); + detectionEntity.setInfo(reqDTO.getInfo()); + detectionEntity.setCombustible(reqDTO.getCombustible()); + detectionEntity.setOxygen(reqDTO.getOxygen()); + detectionEntity.setCarbonMonoxide(reqDTO.getCarbonMonoxide()); + detectionEntity.setHydrogenSulfide(reqDTO.getHydrogenSulfide()); + detectionEntity.setStatus(WorkProcessDetectionStatusEnum.VALID.code); + detectionEntity.setSource(reqDTO.getSource()); + detectionEntity.setResult(detectionResult.code); + workProcessDetectionInfoService.saveWorkProcessDetectionInfo(detectionEntity); + + // 异常 => 预警 + if (detectionResult == WorkProcessDetectionResultEnum.ABNORMAL) { + WorkProcessWarningInfo warningInfo = new WorkProcessWarningInfo(); + warningInfo.setId(IdUtil.getSnowflake(0,0).nextId()); + warningInfo.setWorkApplyId(workApplyInfo.getId()); + warningInfo.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); + warningInfo.setWarningContent(sb.toString()); + warningInfo.setWarningType(WorkProcessWarningTypeEnum.CHECK.code); + warningInfo.setWarningInfo(detectionEntity.getInfo()); + warningInfo.setOperatorUid(currentUser.getUid()); + warningInfo.setOperatorUname(currentUser.getRealName()); + warningInfo.setOperationTime(operationTime); + warningInfo.setStatus(WorkProcessWarningStatusEnum.VALID.code); + warningInfo.setSource(reqDTO.getSource()); + warningInfo.setWorkType(workApplyInfo.getWorkType()); + warningInfo.setWorkLevel(workApplyInfo.getWorkLevel()); + warningInfo.setOriginalId(detectionEntity.getId()); + workProcessWarningInfoService.saveWorkProcessWarningInfo(warningInfo); + } + } + + @Override + public SearchResultVO<List<WorkProcessDetectionInfoRespDTO>> listDetectionByPage(ContextCacheUser currentUser, PageQuery<WorkProcessDetectionPageQuery> pageQuery) { + + WorkProcessDetectionPageDBQuery dbQuery = new WorkProcessDetectionPageDBQuery(); + if (pageQuery.getSearchParams() != null) { + dbQuery.setResult(pageQuery.getSearchParams().getResult()); + dbQuery.setWorkPermitNo(pageQuery.getSearchParams().getWorkPermitNo()); + dbQuery.setWorkType(pageQuery.getSearchParams().getWorkType()); + } + Page<WorkProcessDetectionInfo> page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize()); + List<WorkProcessDetectionInfo> dbData = workProcessDetectionInfoService.listWorkDetectionInfoByPage(page, dbQuery); + List<WorkProcessDetectionInfoRespDTO> result = new ArrayList<>(dbData.size()); + if (dbData.size() > 0) { + WorkProcessDetectionInfoRespDTO respDTO; + WorkTypeEnum workTypeEnum; + WorkLevelEnum workLevelEnum; + WorkProcessDetectionStatusEnum statusEnum; + WorkProcessDetectionResultEnum resultEnum; + WorkReportSourceEnum sourceEnum; + for (WorkProcessDetectionInfo detectionInfo : dbData) { + respDTO = new WorkProcessDetectionInfoRespDTO(); + respDTO.setWorkProcessDetectionId(detectionInfo.getId()); + respDTO.setWorkApplyId(detectionInfo.getWorkApplyId()); + respDTO.setWorkPermitNo(detectionInfo.getWorkPermitNo()); + respDTO.setWorkType(detectionInfo.getWorkType()); + workTypeEnum = WorkTypeEnum.parse(detectionInfo.getWorkType()); + if (workTypeEnum != null) { + respDTO.setWorkTypeDesc(workTypeEnum.getName()); + } + respDTO.setWorkLevel(detectionInfo.getWorkLevel()); + workLevelEnum = WorkLevelEnum.parse(detectionInfo.getWorkLevel()); + if (workLevelEnum != null) { + respDTO.setWorkLevelDesc(workLevelEnum.getTitle()); + } + respDTO.setOperationTime(detectionInfo.getOperationTime()); + respDTO.setOperatorUname(detectionInfo.getOperatorUname()); + respDTO.setOperatorUid(detectionInfo.getOperatorUid()); + respDTO.setInfo(detectionInfo.getInfo()); + respDTO.setCombustible(detectionInfo.getCombustible()); + respDTO.setOxygen(detectionInfo.getOxygen()); + respDTO.setCarbonMonoxide(detectionInfo.getCarbonMonoxide()); + respDTO.setHydrogenSulfide(detectionInfo.getHydrogenSulfide()); + respDTO.setStatus(detectionInfo.getStatus()); + statusEnum = WorkProcessDetectionStatusEnum.parse(detectionInfo.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.value); + } + respDTO.setResult(detectionInfo.getResult()); + resultEnum = WorkProcessDetectionResultEnum.parse(detectionInfo.getResult()); + if (resultEnum != null) { + respDTO.setResultDesc(resultEnum.value); + } + respDTO.setSource(detectionInfo.getSource()); + sourceEnum = WorkReportSourceEnum.parse(detectionInfo.getSource()); + if (sourceEnum != null) { + respDTO.setSourceDesc(sourceEnum.value); + } + + result.add(respDTO); + + } + } + return new SearchResultVO<>( + true, + page.getCurrent(), + page.getSize(), + page.getPages(), + page.getTotal(), + result, + ResultCodes.OK); + } + @Override + public List<WorkApplyReportableRespDTO> listReportableWorkApply(ContextCacheUser currentUser, WorkProcessWorkApplyQuery query) { + + + WorkProcessWorkApplyDBQuery dbQuery = new WorkProcessWorkApplyDBQuery(); + dbQuery.setWorkPermitNo(query.getWorkPermitNo()); + dbQuery.setWorkType(query.getWorkType()); + dbQuery.setNow(LocalDateTime.now()); + dbQuery.setStatus(WorkStatusEnum.STATU_FINISH.getStatus()); + List<WorkApplyReportableDO> dbData = workApplyInfoService.listReportableWorkApply(dbQuery); + List<WorkApplyReportableRespDTO> result = new ArrayList<>(dbData.size()); + if (dbData.size() > 0) { + WorkApplyReportableRespDTO respDTO; + WorkTypeEnum typeEnum; + WorkLevelEnum levelEnum; + WorkStatusEnum statusEnum; + for (WorkApplyReportableDO workApplyInfo : dbData) { + respDTO = new WorkApplyReportableRespDTO(); + respDTO.setWorkApplyId(workApplyInfo.getId()); + respDTO.setWorkType(workApplyInfo.getWorkType()); + respDTO.setWorkLevel(workApplyInfo.getWorkLevel()); + respDTO.setWorkPermitNo(workApplyInfo.getWorkPermitNo()); + respDTO.setWorkContent(workApplyInfo.getWorkContent()); + respDTO.setWorkLocation(workApplyInfo.getWorkLocation()); + respDTO.setHazardIdentification(workApplyInfo.getHazardIdentification()); + respDTO.setStatus(workApplyInfo.getStatus()); + typeEnum = WorkTypeEnum.parse(workApplyInfo.getWorkType()); + if (typeEnum != null) { + respDTO.setWorkTypeDesc(typeEnum.getName()); + } + levelEnum = WorkLevelEnum.parse(workApplyInfo.getWorkLevel()); + if (levelEnum != null) { + respDTO.setWorkLevelDesc(levelEnum.getTitle()); + } + statusEnum = WorkStatusEnum.parse(workApplyInfo.getStatus()); + if (statusEnum != null) { + respDTO.setStatusDesc(statusEnum.getDesc()); + } + respDTO.setExpStartTime(workApplyInfo.getExpStartTime()); + respDTO.setExpEndTime(workApplyInfo.getExpEndTime()); + result.add(respDTO); + } + } + return result; + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkStatisticServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkStatisticServiceImpl.java new file mode 100644 index 0000000..0e42444 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkStatisticServiceImpl.java @@ -0,0 +1,141 @@ +package com.gk.hotwork.specialWork.service.impl; + + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.WorkApplyCountDO; +import com.gk.hotwork.specialWork.enums.WorkTypeEnum; +import com.gk.hotwork.specialWork.model.dto.resp.DepRPCRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkDepStatisticRespDTO; +import com.gk.hotwork.specialWork.model.dto.resp.WorkTypeStatisticRespDTO; +import com.gk.hotwork.specialWork.service.WorkStatisticService; +import com.gk.hotwork.specialWork.service.baseService.WorkApplyInfoService; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service("WorkStatisticService") +public class WorkStatisticServiceImpl implements WorkStatisticService { + @Autowired + private WorkApplyInfoService workApplyInfoService; + + @Autowired + private AccountDepartmentService accountDepartmentService; + @Override + public ResultVO<List<WorkDepStatisticRespDTO>> getWorkApplyCountByDep() { + //获取所有部门 + List<DepRPCRespDTO> depList = getDepList(); + //统计各部门每种作业数量 + List<WorkApplyCountDO> workApplyCountDOList = workApplyInfoService.getWorkApplyCountByDep(); + List<WorkDepStatisticRespDTO> respDTOList = new ArrayList<>(); + //循环部门 + for(DepRPCRespDTO dep:depList){ + WorkDepStatisticRespDTO respDTO = new WorkDepStatisticRespDTO(); + respDTO.setDepId(dep.getDepId()); + respDTO.setDepName(dep.getDepName()); + //获取该部门下的作业数量 + List<WorkApplyCountDO> selectDepList = workApplyCountDOList + .stream() + .filter(coutDo -> coutDo.getDepId().equals(dep.getDepId())) + .collect(Collectors.toList()); + List<WorkTypeStatisticRespDTO> typeStatisticRespDTOS = new ArrayList<>(); + //声明变量 部门总数量 + int totalCount = 0; + //循环作业类型 + for(WorkTypeEnum workTypeEnum:WorkTypeEnum.values()){ + WorkTypeStatisticRespDTO typeStatisticRespDTO = new WorkTypeStatisticRespDTO(); + typeStatisticRespDTO.setWorkType(workTypeEnum.getType()); + typeStatisticRespDTO.setWorkTypeName(workTypeEnum.getName()); + //获取该类型下的数据 + List<WorkApplyCountDO> selectTypeList = selectDepList + .stream() + .filter(coutDo -> coutDo.getWorkType().equals(workTypeEnum.getType())) + .collect(Collectors.toList()); + if(selectTypeList.size()>0){ + typeStatisticRespDTO.setCount(selectTypeList.get(0).getCount()); + totalCount += selectTypeList.get(0).getCount(); + }else{ + typeStatisticRespDTO.setCount(0); + } + typeStatisticRespDTOS.add(typeStatisticRespDTO); + } + respDTO.setTotalCount(totalCount); + respDTO.setTypeList(typeStatisticRespDTOS); + respDTOList.add(respDTO); + //如果有子级 + List<DepRPCRespDTO> children = dep.getChildren(); + if(!CollectionUtils.isEmpty(children)){ + traverseChildren(children,workApplyCountDOList,respDTOList); + } + } + return new ResultVO<>(ResultCodes.OK,respDTOList); + } + + private void traverseChildren(List<DepRPCRespDTO> depList, List<WorkApplyCountDO> workApplyCountDOList, List<WorkDepStatisticRespDTO> respDTOList) { + for(DepRPCRespDTO dep:depList){ + WorkDepStatisticRespDTO respDTO = new WorkDepStatisticRespDTO(); + respDTO.setDepId(dep.getDepId()); + respDTO.setDepName(dep.getDepName()); + //获取该部门下的作业数量 + List<WorkApplyCountDO> selectDepList = workApplyCountDOList + .stream() + .filter(coutDo -> coutDo.getDepId().equals(dep.getDepId())) + .collect(Collectors.toList()); + List<WorkTypeStatisticRespDTO> typeStatisticRespDTOS = new ArrayList<>(); + //声明变量 部门总数量 + int totalCount = 0; + //循环作业类型 + for(WorkTypeEnum workTypeEnum:WorkTypeEnum.values()){ + WorkTypeStatisticRespDTO typeStatisticRespDTO = new WorkTypeStatisticRespDTO(); + typeStatisticRespDTO.setWorkType(workTypeEnum.getType()); + typeStatisticRespDTO.setWorkTypeName(workTypeEnum.getName()); + //获取该类型下的数据 + List<WorkApplyCountDO> selectTypeList = selectDepList + .stream() + .filter(coutDo -> coutDo.getWorkType().equals(workTypeEnum.getType())) + .collect(Collectors.toList()); + if(selectTypeList.size()>0){ + typeStatisticRespDTO.setCount(selectTypeList.get(0).getCount()); + totalCount += selectTypeList.get(0).getCount(); + }else{ + typeStatisticRespDTO.setCount(0); + } + typeStatisticRespDTOS.add(typeStatisticRespDTO); + } + respDTO.setTotalCount(totalCount); + respDTO.setTypeList(typeStatisticRespDTOS); + respDTOList.add(respDTO); + //如果有子级 + List<DepRPCRespDTO> children = dep.getChildren(); + if(!CollectionUtils.isEmpty(children)){ + traverseChildren(children,workApplyCountDOList,respDTOList); + } + } + } + + public List<DepRPCRespDTO> getDepList(){ + List<DepRPCRespDTO> depList = new ArrayList<>(); + try{ + ResultVO<List<DepRPCRespDTO>> listResultVO = accountDepartmentService.depList(); + if (listResultVO != null && listResultVO.getCode().equals(ResultCodes.OK.getCode())) { + if (listResultVO.getData() != null) { + depList = (List<DepRPCRespDTO>) listResultVO.getData(); + }else{ + throw new BusinessException(ResultCodes.CLIENT_DEP_NOT_EXIST); + } + } else { + throw new BusinessException(ResultCodes.RPC_ACCESS_EXCEPTION); + } + + }catch (Exception e){ + throw new BusinessException(ResultCodes.RPC_ACCESS_EXCEPTION); + } + return depList; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkTemporaryPowerPrintServiceImpl.java b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkTemporaryPowerPrintServiceImpl.java new file mode 100644 index 0000000..b334573 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/service/impl/WorkTemporaryPowerPrintServiceImpl.java @@ -0,0 +1,278 @@ +package com.gk.hotwork.specialWork.service.impl; + +import com.gk.hotwork.Domain.Enum.ResultCodes; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Utils.StringUtils; +import com.gk.hotwork.Domain.Vo.ResultVO; +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.Service.Middle.AccountDepartmentService; +import com.gk.hotwork.specialWork.entity.*; +import com.gk.hotwork.specialWork.enums.*; +import com.gk.hotwork.specialWork.service.WorkBrokenCircuitPrintService; +import com.gk.hotwork.specialWork.service.WorkTemporaryPowerPrintService; +import com.gk.hotwork.specialWork.service.baseService.*; +import com.gk.hotwork.specialWork.util.WorkPrintShiftUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.*; +import java.util.stream.Collectors; + +@Service("WorkTemporaryPowerPrintService") +public class WorkTemporaryPowerPrintServiceImpl implements WorkTemporaryPowerPrintService { + @Autowired + private WorkApprovalUnitInfoService workApprovalUnitInfoService; + @Autowired + private WorkApprovalStepInfoService workApprovalStepInfoService; + @Autowired + private WorkApprovalFilledItemInfoService workApprovalFilledItemInfoService; + @Autowired + private WorkApprovalItemInfoService workApprovalItemInfoService; + @Autowired + private WorkApprovalItemMeasureInfoService workApprovalItemMeasureInfoService; + @Autowired + private WorkTemporaryPowerInfoService workTemporaryPowerInfoService; + @Autowired + private WorkApplyOperatorInfoService workApplyOperatorInfoService; + + + public Map<String,Object> workTemporaryPowerPrint(HttpServletResponse response, WorkApplyInfo workApplyInfo){ + + //获取层级 + List<WorkApprovalStepInfo> workApprovalStepInfoList = workApprovalStepInfoService.listApprovalRuleStepByWorkApplyId(workApplyInfo.getId()); + //审批单元 + List<WorkApprovalUnitInfo> workApprovalUnitInfoList = workApprovalUnitInfoService.listApprovalRuleUnitByWorkApplyId(workApplyInfo.getId()); + //获取审批项 + List<WorkApprovalItemInfo> workApprovalItemInfoList = workApprovalItemInfoService.listWorkApprovalItemByWorkApplyId(workApplyInfo.getId()); + //获取审批项填报 + List<WorkApprovalFilledItemInfo> workApprovalFilledItemInfoList = workApprovalFilledItemInfoService.listApprovalFilledItemInfoByWorkApplyId(workApplyInfo.getId()); + //获取安全措施项 + List<WorkApprovalItemMeasureInfo> workApprovalItemMeasureInfoList = workApprovalItemMeasureInfoService.listWorkApprovalItemMeasureByWorkApplyId(workApplyInfo.getId()); + //临时用电作业 + WorkTemporaryPowerInfo workTemporaryPowerInfo = workTemporaryPowerInfoService.getById(workApplyInfo.getWorkDetailId()); + //获取作业人 +// List<WorkApplyOperatorInfo> workApplyOperatorInfoList = workApplyOperatorInfoService.listWorkOperatorByWorkApplyId(workApplyInfo.getId()); + + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName",workApplyInfo.getDepName()); + baseDataMap.put("applyUname",workApplyInfo.getApplyUname()); + baseDataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + baseDataMap.put("workTime","自"+ WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpStartTime())+"至"+WorkPrintShiftUtil.shiftTime(workApplyInfo.getExpEndTime())+"止"); + baseDataMap.put("workLocation",workApplyInfo.getWorkLocation()); + baseDataMap.put("powerAccessPoint",workTemporaryPowerInfo.getPowerAccessPoint()); + baseDataMap.put("workVoltage",workTemporaryPowerInfo.getWorkingVoltage()+"V"); + baseDataMap.put("equipmentAndPower",workTemporaryPowerInfo.getEquipmentAndPower()); + baseDataMap.put("operatorNames",workApplyInfo.getOperatorUnames()); + baseDataMap.put("harm",workApplyInfo.getHazardIdentification()); + + //分析数据 + List<Map<String,String>> anList = new ArrayList<>(); + //获取分析人层级数据 + List<WorkApprovalStepInfo> analystStepList = workApprovalStepInfoList + .stream() + .filter(step -> step.getType().equals(ApprovalStepTypeEnum.TYPE_ANALYST.getType())) + .collect(Collectors.toList()); + if(analystStepList.size()>0){ + //获取参与审核分析人 + List<WorkApprovalUnitInfo> analysUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(analystStepList.get(0).getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + WorkApprovalUnitInfo unitInfo = new WorkApprovalUnitInfo(); + if(analysUnitList.size()>0){ + unitInfo = analysUnitList.get(0); + } + //获取审批项 + List<WorkApprovalItemInfo> analystItemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(analystStepList.get(0).getId())) + .collect(Collectors.toList()); + + //填入数据 + for (WorkApprovalItemInfo itemInfo : analystItemList) { + //获取审批项填入对应数据 + List<WorkApprovalFilledItemInfo> fillList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if(fillList.size()>0){ + workApprovalFilledItemInfo = fillList.get(0); + } + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", workApprovalFilledItemInfo.getAnalysisLocation()); + map.put("anaItemName", itemInfo.getItemName()); + map.put("anaData", workApprovalFilledItemInfo.getVal().toString()+"%"); + map.put("anaResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("anaUname", unitInfo.getApprovalUname()); + map.put("anaTime", WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + anList.add(map); + + } + } + //安全措施数据 + List<Map<String, String>> meList = new ArrayList<>(); + //遍历层级 获取安全措施层级 + for (WorkApprovalStepInfo stepInfo : workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //过滤审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + if(itemList.size()>0 ){ + if(null != itemList.get(0).getMeasureId()){//措施id不为空则为安全措施项 + //定义序号变量 + int index = 1; + + //获取该层审批人 + List<WorkApprovalUnitInfo> itemUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + //选择类型使用 + //审批人审批结果 + String approvalResult = ""; + //生成审批人字符串 + /* StringBuffer stringBuffer = new StringBuffer(); + for (WorkApprovalUnitInfo unitInfo : itemUnitList) { + stringBuffer.append(unitInfo.getApprovalUname()).append(","); + if(StringUtils.isBlank(approvalResult)){ + //赋值 + approvalResult = WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc(); + } + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1);*/ + + //遍历审批项 + for (WorkApprovalItemInfo itemInfo : itemList) { + + //获取该审批对应措施 + List<WorkApprovalItemMeasureInfo> measureList = workApprovalItemMeasureInfoList + .stream() + .filter(measure -> measure.getId().equals(itemInfo.getMeasureId())) + .collect(Collectors.toList()); + WorkApprovalItemMeasureInfo workApprovalItemMeasureInfo = new WorkApprovalItemMeasureInfo(); + if(measureList.size()>0){ + workApprovalItemMeasureInfo = measureList.get(0); + } + //获取该审批项对应的审批数据 + List<WorkApprovalFilledItemInfo> fillItemList = workApprovalFilledItemInfoList + .stream() + .filter(fillItem -> fillItem.getItemId().equals(itemInfo.getId())) + .collect(Collectors.toList()); + //遍历审批人 + for(WorkApprovalUnitInfo unitInfo: itemUnitList) { + String measureContext = workApprovalItemMeasureInfo.getContext(); + //获取审批人填写的审批数据 + List<WorkApprovalFilledItemInfo> unitFillItemList = fillItemList + .stream() + .filter(fillItem -> fillItem.getUnitId().equals(unitInfo.getId())) + .collect(Collectors.toList()); + WorkApprovalFilledItemInfo workApprovalFilledItemInfo = new WorkApprovalFilledItemInfo(); + if (unitFillItemList.size() > 0) { + workApprovalFilledItemInfo = unitFillItemList.get(0); + } + //判断 + if(RuleItemTypeEnum.parse(itemInfo.getType()).equals(RuleItemTypeEnum.FILL)){//填空 + + if(measureContext.indexOf("_")>0){//存在,替换 + measureContext = measureContext.replace("_",workApprovalFilledItemInfo.getMeasureText()); + }else {//不存在,加载后面 + measureContext = measureContext + workApprovalFilledItemInfo.getMeasureText(); + } + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", measureContext); + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + map.put("mUname", unitInfo.getApprovalUname()); + meList.add(map); + index++; + + }else{//选项 + Map<String,String> map = new HashMap<>(); + map.put("index", String.valueOf(index)); + map.put("measure", workApprovalItemMeasureInfo.getContext()); + map.put("mUname", unitInfo.getApprovalUname()); + if(workApprovalFilledItemInfo.getMeasureVal().equals(WorkRuleMeasureOptEnum.UNINVOLVED.getType())){ + map.put("mResult", WorkRuleMeasureOptEnum.parse(workApprovalFilledItemInfo.getMeasureVal()).getDesc()); + }else{ + map.put("mResult", WorkApprovalUnitResultEnum.parse(unitInfo.getResult()).getDesc()); + } + meList.add(map); + index++; + } + + } + + } + + } + } + } + } + + //审批层数据 + List<Map<String, String>> apList = new ArrayList<>(); + //排序 + workApprovalStepInfoList.sort(Comparator.comparing(WorkApprovalStepInfo::getStepSerial)); + //遍历层级 + for (WorkApprovalStepInfo stepInfo: workApprovalStepInfoList) { + if(!ApprovalStepTypeEnum.TYPE_ANALYST.getType().equals(stepInfo.getType())){//非分析人审批人 + //获取该层审批项 + List<WorkApprovalItemInfo> itemList = workApprovalItemInfoList + .stream() + .filter(item -> item.getStepId().equals(stepInfo.getId())) + .collect(Collectors.toList()); + //获取审批人 + List<WorkApprovalUnitInfo> approvalUnitList = workApprovalUnitInfoList + .stream() + .filter(unit -> unit.getStepId().equals(stepInfo.getId()) && unit.getResult().equals(WorkApprovalUnitResultEnum.RESULT_SUCCESS.getResult())) + .collect(Collectors.toList()); + + if(itemList.size() == 0){//无审批项 + //遍历审批人 + for (WorkApprovalUnitInfo unitInfo : approvalUnitList) { + + Map<String,String> map = new HashMap<>(); + map.put("apprStepName", stepInfo.getStepName()); + map.put("apprOpinion", unitInfo.getFillContent()); + map.put("apprUname", unitInfo.getApprovalUname()); + map.put("apResult", WorkApprovalStepResultEnum.parse(stepInfo.getApprovalResult()).getDesc()); + map.put("apprSign", unitInfo.getApprovalUname()); + map.put("apprTime",WorkPrintShiftUtil.shiftTime(unitInfo.getApprovalActualTime())); + apList.add(map); + + } + } + } + } + // 模板文件输入输出地址 + String filePath = "/docxTemplate/workTemporaryPower.docx"; + if(StringUtils.isBlank(filePath)){ + throw new BusinessException("200","模板不存在!"); + } + //综合数据 + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("approval",apList); + dataMap.put("measure",meList); + dataMap.put("analysis",anList); + dataMap.put("text",workApplyInfo.getWorkPermitNo()); + dataMap.put("filePath",filePath); + dataMap.put("fileName",WorkTypeEnum.parse(workApplyInfo.getWorkType()).getName()); + dataMap.put("workCode",workApplyInfo.getWorkPermitNo()); + + // 模板文件输入输出地址 +// String outPath = "F:/test/workTemporaryPower示例文档.docx"; +// WorkExportUtil workExportUtil = new WorkExportUtil(); +// workExportUtil.setTempLocalPath(filePath); //设置模板的路径 +// workExportUtil.init(); //初始化工具类 +// workExportUtil.export(dataMap); //写入相关数据 +// workExportUtil.generate(outPath); //导出到目标文档 + + return dataMap; + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/util/QrCodeUtil.java b/src/main/java/com/gk/hotwork/specialWork/util/QrCodeUtil.java new file mode 100644 index 0000000..3c4c59d --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/util/QrCodeUtil.java @@ -0,0 +1,106 @@ +package com.gk.hotwork.specialWork.util; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; + +/** + * 二维码生成工具 + */ +public class QrCodeUtil { + //编码 + private static final String CHARSET = "UTF-8"; + //文件格式 + private static final String FORMAT_NAME = "JPG"; + + // 宽度 + private static final int WIDTH = 80; + // 高度 + private static final int HEIGHT = 80; + + public QrCodeUtil() { + } + + public static BitMatrix createQrCode(String text) { + try { + Map<EncodeHintType, String> hints = new HashMap(); + hints.put(EncodeHintType.CHARACTER_SET, CHARSET); + hints.put(EncodeHintType.MARGIN, "0");//二维码空白区域,最小为0也有白边,只是很小,最小是6像素左右 + BitMatrix bitMatrix = (new MultiFormatWriter()).encode(text, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints); + return bitMatrix; + } catch (Exception var3) { + var3.printStackTrace(); + return null; + } + } + + static void writeToFile(BitMatrix matrix, String format, File file) throws IOException { + BufferedImage image = toBufferedImage(matrix); + if (!ImageIO.write(image, format, file)) { + throw new IOException("Could not write an image of format " + format + " to " + file); + } + } + + static void writeToStream(BitMatrix matrix, String format, OutputStream stream) throws IOException { + BufferedImage image = toBufferedImage(matrix); + if (!ImageIO.write(image, format, stream)) { + throw new IOException("Could not write an image of format " + format); + } + } + + private static BufferedImage toBufferedImage(BitMatrix matrix) { + int width = matrix.getWidth(); + int height = matrix.getHeight(); + BufferedImage image = new BufferedImage(width, height, 1); + + for (int x = 0; x < width; ++x) { + for (int y = 0; y < height; ++y) { + image.setRGB(x, y, matrix.get(x, y) ? -16777216 : -1); + } + } + return image; + } + + /** + * 生成二维码字节流 + */ + public static ByteArrayOutputStream generate(String text) throws IOException { + //获取一个二维码图片 + BitMatrix bitMatrix = QrCodeUtil.createQrCode(text); + //以流的形式输出到前端 + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + MatrixToImageWriter.writeToStream(bitMatrix, FORMAT_NAME, outputStream); + return outputStream; + } + + + public static void main(String[] args) throws IOException { + //获取一个二维码图片 + BitMatrix bitMatrix = QrCodeUtil.createQrCode("测试"); + + + //以流的形式输出到前端 + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + MatrixToImageWriter.writeToStream(bitMatrix, "PNG", outputStream); + + //转换为base64 + Base64.Encoder encoder1 = Base64.getEncoder(); + String advUrl = "data:image/jpeg;base64," + + encoder1.encodeToString(outputStream.toByteArray()); + //打印base64结果 + System.out.println(advUrl); + + } +} diff --git a/src/main/java/com/gk/hotwork/specialWork/util/WordReporter.java b/src/main/java/com/gk/hotwork/specialWork/util/WordReporter.java new file mode 100644 index 0000000..0b87b59 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/util/WordReporter.java @@ -0,0 +1,565 @@ +package com.gk.hotwork.specialWork.util; + +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.Units; +import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; +import org.apache.poi.xwpf.usermodel.*; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; + +import java.io.*; +import java.math.BigInteger; +import java.text.SimpleDateFormat; +import java.util.*; + +public class WordReporter { + private String tempLocalPath; + private XWPFDocument xwpfDocument = null; + private FileInputStream inputStream = null; + private OutputStream outputStream = null; + + public WordReporter(){ + + } + public WordReporter(String tempLocalPath){ + this.tempLocalPath = tempLocalPath; + } + /** + * 设置模板路径 + * @param tempLocalPath + */ + public void setTempLocalPath(String tempLocalPath) { + this.tempLocalPath = tempLocalPath; + } + + /** + * 初始化 + * @throws IOException + */ + public void init() throws IOException{ + inputStream = new FileInputStream(new File(this.tempLocalPath)); + xwpfDocument = new XWPFDocument(inputStream); + } + + /** + * 导出方法 + * @param params 表格里的数据列表 + * @param orgFullName 需要替换的页眉的公司的名称 + * @param logoFilePath 需要替换的页眉的Logo的图片的地址 + * @param tableIndex 需替换的第几个表格的下标 + * @param textMap 需替换的文本的数据入参 + * @return + * @throws Exception + */ + public boolean export(List<Map<String,String>> params, String orgFullName, String logoFilePath, int tableIndex, Map<String,String> textMap) throws Exception{ + //createWaterMark(xwpfDocument); + createHeader(xwpfDocument,orgFullName,logoFilePath); + replaceText(xwpfDocument,textMap); + this.insertValueToTable(xwpfDocument,params,tableIndex); + return true; + } + + //添加水印 本示例没有用到水印 如果想添加水印 可以在导出方法里调用此方法 + public void createWaterMark(XWPFDocument doc){ + XWPFHeaderFooterPolicy policy=doc.getHeaderFooterPolicy(); + policy.createWatermark("新疆国泰新华化工有限责任公司"); + + } + + + + /** + * 替换非表格埋点值 + * @param xwpfDocument + * @param textMap 需要替换的文本入参 + */ + public void replaceText(XWPFDocument xwpfDocument,Map<String,String> textMap){ + List<XWPFParagraph> paras=xwpfDocument.getParagraphs(); + Set<String> keySet=textMap.keySet(); + for (XWPFParagraph para : paras) { + //当前段落的属性 + System.out.println("打印获取到的段落的每一行数据++++++++>>>>>>>"+para.getText()); + String str=para.getText(); + System.out.println("========================>>>>>>"+para.getParagraphText()); + + List<XWPFRun> list=para.getRuns(); + for(XWPFRun run:list){ + for(String key:keySet){ + if(key.equals(run.text())){ + run.setText(textMap.get(key),0); + } + } + } + } + } + + + /** + * 循环填充表格内容 + * @param xwpfDocument + * @param params + * @param tableIndex + * @throws Exception + */ + private void insertValueToTable(XWPFDocument xwpfDocument, List<Map<String,String>> params, int tableIndex) throws Exception { + try { + List<XWPFTable> tableList = xwpfDocument.getTables(); + if (tableList.size() <= tableIndex) { + throw new Exception("tableIndex对应的表格不存在"); + } + XWPFTable table = tableList.get(tableIndex); + List<XWPFTableRow> rows = table.getRows(); + if (rows.size() < 2) { + throw new Exception("tableIndex对应表格应该为2行"); + } + //模板的那一行 + XWPFTableRow tmpRow = rows.get(1); + List<XWPFTableCell> tmpCells = null; + List<XWPFTableCell> cells = null; + XWPFTableCell tmpCell = null; + tmpCells = tmpRow.getTableCells(); + + + String cellText = null; + String cellTextKey = null; + Map<String, Object> totalMap = null; + for (int i = 0, len = params.size(); i < len; i++) { + Map<String, String> map = params.get(i); + // 创建新的一行 + XWPFTableRow row = table.createRow(); + // 获取模板的行高 设置为新一行的行高 + row.setHeight(tmpRow.getHeight()); + cells = row.getTableCells(); + for (int k = 0, klen = cells.size(); k < klen; k++) { + tmpCell = tmpCells.get(k); + XWPFTableCell cell = cells.get(k); + cellText = tmpCell.getText(); + if (StringUtils.isNotBlank(cellText)) { + //转换为mapkey对应的字段 + cellTextKey = cellText.replace("$", "").replace("{", "").replace("}", ""); + if (map.containsKey(cellTextKey)) { + // 填充内容 并且复制模板行的属性 + setCellText(tmpCell, cell, map.get(cellTextKey)); + } + } + } + + } + // 删除模版行 + table.removeRow(1); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 复制模板行的属性 + * @param tmpCell + * @param cell + * @param text + * @throws Exception + */ + private void setCellText(XWPFTableCell tmpCell, XWPFTableCell cell,String text) throws Exception { + + CTTc cttc2 = tmpCell.getCTTc(); + CTTcPr ctPr2 = cttc2.getTcPr(); + CTTc cttc = cell.getCTTc(); + CTTcPr ctPr = cttc.addNewTcPr(); + if (ctPr2.getTcW() != null) { + ctPr.addNewTcW().setW(ctPr2.getTcW().getW()); + } + if (ctPr2.getVAlign() != null) { + ctPr.addNewVAlign().setVal(ctPr2.getVAlign().getVal()); + } + if (cttc2.getPList().size() > 0) { + CTP ctp = cttc2.getPList().get(0); + if (ctp.getPPr() != null) { + if (ctp.getPPr().getJc() != null) { + cttc.getPList().get(0).addNewPPr().addNewJc() + .setVal(ctp.getPPr().getJc().getVal()); + } + } + } + if (ctPr2.getTcBorders() != null) { + ctPr.setTcBorders(ctPr2.getTcBorders()); + } + + XWPFParagraph tmpP = tmpCell.getParagraphs().get(0); + XWPFParagraph cellP = cell.getParagraphs().get(0); + XWPFRun tmpR = null; + if (tmpP.getRuns() != null && tmpP.getRuns().size() > 0) { + tmpR = tmpP.getRuns().get(0); + } + XWPFRun cellR = cellP.createRun(); + cellR.setText(text); + // 复制字体信息 + if (tmpR != null) { + if(!cellR.isBold()){ + cellR.setBold(tmpR.isBold()); + } + cellR.setItalic(tmpR.isItalic()); + cellR.setUnderline(tmpR.getUnderline()); + cellR.setColor(tmpR.getColor()); + cellR.setTextPosition(tmpR.getTextPosition()); + if (tmpR.getFontSize() != -1) { + cellR.setFontSize(tmpR.getFontSize()); + } + if (tmpR.getFontFamily() != null) { + cellR.setFontFamily(tmpR.getFontFamily()); + } +// if (tmpR.getCTR() != null) { +// if (tmpR.getCTR().isSetRPr()) { +// CTRPr tmpRPr = tmpR.getCTR().getRPr(); +// if (tmpRPr.isSetRFonts()) { +// CTFonts tmpFonts = tmpRPr.getRFonts(); +// CTRPr cellRPr = cellR.getCTR().isSetRPr() ? cellR +// .getCTR().getRPr() : cellR.getCTR().addNewRPr(); +// CTFonts cellFonts = cellRPr.isSetRFonts() ? cellRPr +// .getRFonts() : cellRPr.addNewRFonts(); +// cellFonts.setAscii(tmpFonts.getAscii()); +// cellFonts.setAsciiTheme(tmpFonts.getAsciiTheme()); +// cellFonts.setCs(tmpFonts.getCs()); +// cellFonts.setCstheme(tmpFonts.getCstheme()); +// cellFonts.setEastAsia(tmpFonts.getEastAsia()); +// cellFonts.setEastAsiaTheme(tmpFonts.getEastAsiaTheme()); +// cellFonts.setHAnsi(tmpFonts.getHAnsi()); +// cellFonts.setHAnsiTheme(tmpFonts.getHAnsiTheme()); +// } +// } +// } + + } + // 复制段落信息 + cellP.setAlignment(tmpP.getAlignment()); + cellP.setVerticalAlignment(tmpP.getVerticalAlignment()); + cellP.setBorderBetween(tmpP.getBorderBetween()); + cellP.setBorderBottom(tmpP.getBorderBottom()); + cellP.setBorderLeft(tmpP.getBorderLeft()); + cellP.setBorderRight(tmpP.getBorderRight()); + cellP.setBorderTop(tmpP.getBorderTop()); + cellP.setPageBreak(tmpP.isPageBreak()); + if (tmpP.getCTP() != null) { + if (tmpP.getCTP().getPPr() != null) { + CTPPr tmpPPr = tmpP.getCTP().getPPr(); + CTPPr cellPPr = cellP.getCTP().getPPr() != null ? cellP + .getCTP().getPPr() : cellP.getCTP().addNewPPr(); + // 复制段落间距信息 + CTSpacing tmpSpacing = tmpPPr.getSpacing(); + if (tmpSpacing != null) { + CTSpacing cellSpacing = cellPPr.getSpacing() != null ? cellPPr + .getSpacing() : cellPPr.addNewSpacing(); + if (tmpSpacing.getAfter() != null) { + cellSpacing.setAfter(tmpSpacing.getAfter()); + } + if (tmpSpacing.getAfterAutospacing() != null) { + cellSpacing.setAfterAutospacing(tmpSpacing + .getAfterAutospacing()); + } + if (tmpSpacing.getAfterLines() != null) { + cellSpacing.setAfterLines(tmpSpacing.getAfterLines()); + } + if (tmpSpacing.getBefore() != null) { + cellSpacing.setBefore(tmpSpacing.getBefore()); + } + if (tmpSpacing.getBeforeAutospacing() != null) { + cellSpacing.setBeforeAutospacing(tmpSpacing + .getBeforeAutospacing()); + } + if (tmpSpacing.getBeforeLines() != null) { + cellSpacing.setBeforeLines(tmpSpacing.getBeforeLines()); + } + if (tmpSpacing.getLine() != null) { + cellSpacing.setLine(tmpSpacing.getLine()); + } + if (tmpSpacing.getLineRule() != null) { + cellSpacing.setLineRule(tmpSpacing.getLineRule()); + } + } + // 复制段落缩进信息 + CTInd tmpInd = tmpPPr.getInd(); + if (tmpInd != null) { + CTInd cellInd = cellPPr.getInd() != null ? cellPPr.getInd() + : cellPPr.addNewInd(); + if (tmpInd.getFirstLine() != null) { + cellInd.setFirstLine(tmpInd.getFirstLine()); + } + if (tmpInd.getFirstLineChars() != null) { + cellInd.setFirstLineChars(tmpInd.getFirstLineChars()); + } + if (tmpInd.getHanging() != null) { + cellInd.setHanging(tmpInd.getHanging()); + } + if (tmpInd.getHangingChars() != null) { + cellInd.setHangingChars(tmpInd.getHangingChars()); + } + if (tmpInd.getLeft() != null) { + cellInd.setLeft(tmpInd.getLeft()); + } + if (tmpInd.getLeftChars() != null) { + cellInd.setLeftChars(tmpInd.getLeftChars()); + } + if (tmpInd.getRight() != null) { + cellInd.setRight(tmpInd.getRight()); + } + if (tmpInd.getRightChars() != null) { + cellInd.setRightChars(tmpInd.getRightChars()); + } + } + } + } + } + + + + //添加不带图片的页眉 如果页眉不做图片处理 可以用此方法 + public void createHeader(XWPFDocument doc, String orgFullName) throws Exception { + /* + * 对页眉段落作处理 + * */ + CTSectPr sectPr = doc.getDocument().getBody().addNewSectPr(); + XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(doc,sectPr); + XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT); + + XWPFParagraph paragraph = header.getParagraphArray(0); + paragraph.setBorderBottom(Borders.THICK); + + + /* + * 添加字体页眉,公司全称 + * */ + if (StringUtils.isNotEmpty(orgFullName)) { + XWPFRun run = paragraph.createRun(); + run.setText(orgFullName); + //setXWPFRunStyle(run,"新宋体",10); + } + } + + + /** + * 对页眉处理 页眉包含公司名称 二维码图片 + * @param doc + * @param orgFullName 公司全称 + * @param logoFilePath 二维码图片的地址 + * @throws Exception + */ + public void createHeader(XWPFDocument doc, String orgFullName, String logoFilePath) throws Exception { + /* + * 对页眉段落作处理,使二维码图片在页眉右边,公司全称在页眉左边 + * */ + CTSectPr sectPr = doc.getDocument().getBody().addNewSectPr(); + XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(doc, sectPr); + XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT); + + XWPFParagraph paragraph = header.getParagraphArray(0); + paragraph.setAlignment(ParagraphAlignment.BOTH); //设置段落左对齐 + paragraph.setBorderBottom(Borders.THICK); //设置下划线 + + + + + XWPFRun run = paragraph.createRun(); + setXWPFRunStyle(run,"新宋体",10); + + + /* + * 添加字体页眉,公司全称 + * 公司全称在右边 + * */ + if (StringUtils.isNotEmpty(orgFullName)) { + run = paragraph.createRun(); + run.setText(orgFullName); + setXWPFRunStyle(run,"新宋体",10); + } + + //处理两个段落之间的制表符宽度 + run.addTab(); + + + CTTabStop tabStop = paragraph.getCTP().getPPr().addNewTabs().addNewTab(); + tabStop.setVal(STTabJc.CENTER); + int twipsPerInch = 1450; + tabStop.setPos(BigInteger.valueOf(6 * twipsPerInch)); + + /* + * 取到二维码的图片的字节流 + * */ + if (StringUtils.isNotEmpty(logoFilePath)) { + + + File file=new File(logoFilePath); + InputStream is = new FileInputStream(file); + + XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, logoFilePath, Units.toEMU(40), Units.toEMU(40)); + + String blipID = ""; + for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示 + blipID = header.getRelationId(picturedata); + } + picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID); + run.addTab(); + is.close(); + } + + } + + + + + /** + * 设置页脚的字体样式 + * + * @param r1 段落元素 + */ + private void setXWPFRunStyle(XWPFRun r1,String font,int fontSize) { + r1.setFontSize(fontSize); + CTRPr rpr = r1.getCTR().isSetRPr() ? r1.getCTR().getRPr() : r1.getCTR().addNewRPr(); +// CTFonts fonts = rpr.isSetRFonts() ? rpr.getRFonts() : rpr.addNewRFonts(); +// fonts.setAscii(font); +// fonts.setEastAsia(font); +// fonts.setHAnsi(font); + } + public void addRows(XWPFTable table, int source, int rows, int insertRowIndex){ + try{ + //获取表格的总行数 + int index = table.getNumberOfRows(); + //循环添加行和和单元格 + for(int i=1;i<=rows;i++) { + //获取要复制样式的行 + XWPFTableRow sourceRow = table.getRow(source); + //添加新行 + XWPFTableRow targetRow = table.insertNewTableRow(insertRowIndex++); + //复制行的样式给新行 + targetRow.getCtRow().setTrPr(sourceRow.getCtRow().getTrPr()); + //获取要复制样式的行的单元格 + List<XWPFTableCell> sourceCells = sourceRow.getTableCells(); + //循环复制单元格 + for (XWPFTableCell sourceCell : sourceCells) { + //添加新列 + XWPFTableCell newCell = targetRow.addNewTableCell(); + //复制单元格的样式给新单元格 + newCell.getCTTc().setTcPr(sourceCell.getCTTc().getTcPr()); + //设置垂直居中 + newCell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);//垂直居中 + //复制单元格的居中方式给新单元格 + CTPPr pPr = sourceCell.getCTTc().getPList().get(0).getPPr(); + if(pPr!=null&&pPr.getJc()!=null&&pPr.getJc().getVal()!=null){ + CTTc cttc = newCell.getCTTc(); + CTP ctp = cttc.getPList().get(0); + CTPPr ctppr = ctp.getPPr(); + if (ctppr == null) { + ctppr = ctp.addNewPPr(); + } + CTJc ctjc = ctppr.getJc(); + if (ctjc == null) { + ctjc = ctppr.addNewJc(); + } + ctjc.setVal(pPr.getJc().getVal()); //水平居中 + } + + //得到复制单元格的段落 + List<XWPFParagraph> sourceParagraphs = sourceCell.getParagraphs(); + if (StringUtils.isEmpty(sourceCell.getText())) { + continue; + } + //拿到第一段 + XWPFParagraph sourceParagraph = sourceParagraphs.get(0); + //得到新单元格的段落 + List<XWPFParagraph> targetParagraphs = newCell.getParagraphs(); + //判断新单元格是否为空 + if (StringUtils.isEmpty(newCell.getText())) { + //添加新的段落 + XWPFParagraph ph = newCell.addParagraph(); + //复制段落样式给新段落 + ph.getCTP().setPPr(sourceParagraph.getCTP().getPPr()); + //得到文本对象 + XWPFRun run = ph.getRuns().isEmpty() ? ph.createRun() : ph.getRuns().get(0); + //复制文本样式 + run.setFontFamily(sourceParagraph.getRuns().get(0).getFontFamily()); + } else { + XWPFParagraph ph = targetParagraphs.get(0); + ph.getCTP().setPPr(sourceParagraph.getCTP().getPPr()); + XWPFRun run = ph.getRuns().isEmpty() ? ph.createRun() : ph.getRuns().get(0); + run.setFontFamily(sourceParagraph.getRuns().get(0).getFontFamily()); + } + } + } + }catch (Exception e){ + //log.error(e.getMessage(),e); + } + } + + + /** + * 收尾方法 + * @param outDocPath + * @return + * @throws IOException + */ + public boolean generate(String outDocPath) throws IOException{ + outputStream = new FileOutputStream(outDocPath); + xwpfDocument.write(outputStream); + this.close(outputStream); + this.close(inputStream); + return true; + } + + /** + * 关闭输入流 + * @param is + */ + private void close(InputStream is) { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 关闭输出流 + * @param os + */ + private void close(OutputStream os) { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public static void main(String[] args) throws Exception { + + // 添加假数据 这里你也可以从数据库里获取数据 + List<Map<String, String>> list = new ArrayList<>(); + for (int i =0;i < 10; i++){ + Map<String,String> map = new HashMap<>(); + map.put("index", "2018"+i); + map.put("fileName", "我是第一列数据"+i); + map.put("creationDate", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); + map.put("supervisionOpinions", "监理意见"+i); + map.put("comment", "我是备注"+i); + list.add(map); + } + Map<String,String> textMap=new HashMap<>(); + textMap.put("companyName", "测试替换文本的的公司名"); + textMap.put("folderName", "测试替换文本里的第二个埋点"); + + // 模板文件输入输出地址 + String filePath = "F:/test/test.docx"; + String outPath = "F:/test/示例文档.docx"; + + String orgFullName="测试替换页眉的公司名"; + String imgFile="F:/test/chengyi.png"; + WordReporter wordReporter = new WordReporter(); + wordReporter.setTempLocalPath(filePath); //设置模板的路径 + wordReporter.init(); //初始化工具类 + wordReporter.export(list,orgFullName,imgFile,0,textMap); //写入相关数据 + wordReporter.generate(outPath); //导出到目标文档 + + } + + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/util/WorkExportUtil.java b/src/main/java/com/gk/hotwork/specialWork/util/WorkExportUtil.java new file mode 100644 index 0000000..958d17b --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/util/WorkExportUtil.java @@ -0,0 +1,729 @@ +package com.gk.hotwork.specialWork.util; + +import com.documents4j.api.DocumentType; +import com.documents4j.api.IConverter; +import com.documents4j.job.LocalConverter; +import com.gk.hotwork.Domain.Exception.BusinessException; +import com.gk.hotwork.Domain.Exception.E; +import io.micrometer.core.instrument.util.StringUtils; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.util.Units; +import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; +import org.apache.poi.xwpf.usermodel.*; +import org.apache.xmlbeans.XmlException; +import org.apache.xmlbeans.impl.xb.xmlschema.SpaceAttribute; +import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject; +import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; +import org.springframework.core.io.ClassPathResource; + +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigInteger; +import java.net.URLEncoder; +import java.util.*; + +public class WorkExportUtil { + private String tempLocalPath; + private XWPFDocument xwpfDocument = null; + private FileInputStream inputStream = null; + private OutputStream outputStream = null; + // 宽度 + private static final int WIDTH = 70; + // 高度 + private static final int HEIGHT = 70; + // 左偏移量 + private static final int LEFTOFFSET = 400; + //上偏移量 + private static final int TOPOFFSET = -10; + + public WorkExportUtil(){ + + } + public WorkExportUtil(String tempLocalPath){ + this.tempLocalPath = tempLocalPath; + } + /** + * 设置模板路径 + * @param tempLocalPath + */ + public void setTempLocalPath(String tempLocalPath) { + this.tempLocalPath = tempLocalPath; + } + + /** + * 初始化 + * @throws IOException + */ + public void init() throws IOException{ + + //inputStream = new FileInputStream(new File(this.tempLocalPath)); + ClassPathResource classPathResource = new ClassPathResource(this.tempLocalPath); + InputStream input = classPathResource.getInputStream(); + xwpfDocument = new XWPFDocument(input); + } + + /** + * 导出方法 + * @param map 文档中所有数据 + * @param map 需替换的文本的数据入参 + * @return + * @throws Exception + */ + public boolean export(Map<String,Object> map) throws Exception{ + //生成二维码 + generateQRCode((String) map.get("text")); + //填充基础数据 + Map<String,Integer> baseDataMap = this.insertBaseDataToTable((Map) map.get("baseData")); + + if(baseDataMap.get("approval") != 0){//模板存在审批层 + if(null != map.get("approval")){//审批数据不为空 + insertValue(baseDataMap.get("approval"),(List<Map<String, String>>) map.get("approval")); + } + } + + if(0 != baseDataMap.get("measure")){//措施 + if(null != map.get("measure")){//审批数据不为空 + insertValue(baseDataMap.get("measure"),(List<Map<String, String>>) map.get("measure")); + } + } + if(0 != baseDataMap.get("analysis")){//分析 + if(null != map.get("analysis")){//审批数据不为空 + insertValue(baseDataMap.get("analysis"),(List<Map<String, String>>) map.get("analysis")); + } + } + createDefaultFooter1((String) map.get("workCode")); + return true; + } + + //添加水印 本示例没有用到水印 如果想添加水印 可以在导出方法里调用此方法 + public void createWaterMark(XWPFDocument doc){ + XWPFHeaderFooterPolicy policy=doc.getHeaderFooterPolicy(); + policy.createWatermark("新疆国泰新华化工有限责任公司"); + + } + //生成页码 + /** + * 创建默认的页脚(该页脚主要只居中显示页码) + * @return 返回文档帮助类对象,可用于方法链调用 + * @throws XmlException + * XML异常 + * @throws IOException + * IO异常 + */ + public void createDefaultFooter1(String workCode) { + // TODO 设置页码起始值 + CTP pageNo = CTP.Factory.newInstance(); + XWPFParagraph footer = new XWPFParagraph(pageNo, xwpfDocument); + CTPPr begin = pageNo.addNewPPr(); + begin.addNewPStyle().setVal("STYLE_FOOTER"); + begin.addNewJc().setVal(STJc.CENTER); + + XWPFRun run = footer.createRun(); + run.addTab(); + + run = footer.createRun(); + run.setText(workCode+" "); + setXWPFRunStyle(run, "宋体", 10); + + run = footer.createRun(); + run.setText("第"); + setXWPFRunStyle(run, "宋体", 10); + + CTFldChar fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("begin")); + run = footer.createRun(); + CTText ctText = run.getCTR().addNewInstrText(); + ctText.setStringValue("PAGE \\* MERGEFORMAT"); + ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve")); + setXWPFRunStyle(run, "宋体", 10); + + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("end")); + + run = footer.createRun(); + run.setText("页/共"); + setXWPFRunStyle(run, "宋体", 10); + + run = footer.createRun(); + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("begin")); + + run = footer.createRun(); + ctText = run.getCTR().addNewInstrText(); + ctText.setStringValue("NUMPAGES \\* MERGEFORMAT "); + ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve")); + setXWPFRunStyle(run, "宋体", 10); + + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("end")); + + run = footer.createRun(); + run.setText("页"); + setXWPFRunStyle(run, "宋体", 10); + + CTSectPr sectPr = xwpfDocument.getDocument().getBody().isSetSectPr() ? xwpfDocument.getDocument().getBody().getSectPr() : xwpfDocument.getDocument().getBody().addNewSectPr(); + XWPFHeaderFooterPolicy policy = new XWPFHeaderFooterPolicy(xwpfDocument, sectPr); + policy.createFooter(STHdrFtr.DEFAULT, new XWPFParagraph[] { footer }); + } + + //生成页脚 + public void createFooter(){ + /* + * 生成页脚段落 + * 给段落设置宽度为占满一行 + * */ + CTSectPr sectPr = xwpfDocument.getDocument().getBody().addNewSectPr(); + XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(xwpfDocument, sectPr); + XWPFFooter footer = headerFooterPolicy.createFooter(STHdrFtr.DEFAULT); + XWPFParagraph paragraph = footer.getParagraphArray(0); + paragraph.setAlignment(ParagraphAlignment.LEFT); + paragraph.setVerticalAlignment(TextAlignment.CENTER); + paragraph.setBorderTop(Borders.THICK); + CTTabStop tabStop = paragraph.getCTP().getPPr().addNewTabs().addNewTab(); + tabStop.setVal(STTabJc.RIGHT); + int twipsPerInch = 1440; + tabStop.setPos(BigInteger.valueOf(6 * twipsPerInch)); + /* + * 给段落创建元素 + * 设置元素字面为公司地址+公司电话 + * */ + XWPFRun run = paragraph.createRun(); + run.addTab(); + String s = run.getFontFamily(); + /* + * 生成页码 + * 页码右对齐 + * */ + run = paragraph.createRun(); + run.setText("第"); + run = paragraph.createRun(); + CTFldChar fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("begin")); + run = paragraph.createRun(); + CTText ctText = run.getCTR().addNewInstrText(); + ctText.setStringValue("PAGE \\* MERGEFORMAT"); + ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve")); + setXWPFRunStyle(run, "宋体", 8); + + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("end")); + + run = paragraph.createRun(); + run.setText("页/共"); + setXWPFRunStyle(run, "宋体", 8); + + run = paragraph.createRun(); + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("begin")); + + run = paragraph.createRun(); + ctText = run.getCTR().addNewInstrText(); + ctText.setStringValue("NUMPAGES \\* MERGEFORMAT "); + ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve")); + setXWPFRunStyle(run, "宋体", 8); + + fldChar = run.getCTR().addNewFldChar(); + fldChar.setFldCharType(STFldCharType.Enum.forString("end")); + + run = paragraph.createRun(); + run.setText("页"); + setXWPFRunStyle(run, "宋体", 8); + } + /** + * 设置页脚的字体样式 + * + * @param r1 段落元素 + */ + private void setXWPFRunStyle(XWPFRun r1,String font,int fontSize) { + r1.setFontSize(fontSize); + CTRPr rpr = r1.getCTR().isSetRPr() ? r1.getCTR().getRPr() : r1.getCTR().addNewRPr(); + CTFonts fonts = rpr.addNewRFonts(); + fonts.setAscii(font); + fonts.setEastAsia(font); + fonts.setHAnsi(font); + } + + /** + * 替换非表格埋点值 + * @param xwpfDocument + * @param textMap 需要替换的文本入参 + */ + public void replaceText(XWPFDocument xwpfDocument,Map<String,String> textMap){ + List<XWPFParagraph> paras=xwpfDocument.getParagraphs(); + Set<String> keySet=textMap.keySet(); + for (XWPFParagraph para : paras) { + //当前段落的属性 + System.out.println("打印获取到的段落的每一行数据++++++++>>>>>>>"+para.getText()); + System.out.println("========================>>>>>>"+para.getParagraphText()); + + List<XWPFRun> list=para.getRuns(); + for(XWPFRun run:list){ + for(String key:keySet){ + if(key.equals(run.text())){ + if(run.text().equals("name")){ + run.setText(textMap.get(key)+"证",0); + }else{ + run.setText(textMap.get(key),0); + run.setFontSize(12); + } + } + } + } + } + } + + /** + * 填充表格基础数据 + * @param baseDataMap + * @return + */ + private Map<String,Integer> insertBaseDataToTable( Map<String,String> baseDataMap){ + //获取行数 + List<XWPFTable> tables = xwpfDocument.getTables(); + List<XWPFTableRow> rows = tables.get(0).getRows(); + int rowNumber = 0; + int analysisMode = 0; + int measureMode = 0; + int approvalMode = 0; + //循环行 + for(XWPFTableRow row : rows){ + List<XWPFTableCell> tableCells = row.getTableCells(); + //循环列 + for(XWPFTableCell cell:tableCells){ + String cellText = cell.getText(); + //如果列不为空 + if(StringUtils.isNotBlank(cellText)){ + //字体 + String fontFamily = cell.getParagraphs().get(0).getRuns().get(0).getFontFamily(); + Double fontSizeDouble = cell.getParagraphs().get(0).getRuns().get(0).getFontSizeAsDouble(); + //转换为mapkey对应的字段 + String cellTextKey = cellText.replace("$", "").replace("{", "").replace("}", ""); + if(null != baseDataMap){ + if (baseDataMap.containsKey(cellTextKey)) { + + //清除数据 + clearCell(cell); + // 填充内容 + cell.setText(baseDataMap.get(cellTextKey)); + cell.getParagraphs().get(0).getRuns().get(0).setFontFamily(fontFamily); + cell.getParagraphs().get(0).getRuns().get(0).setFontSize(fontSizeDouble); + } + } + if(cellText.contains("anaUname")){//包含分析人 + analysisMode = rowNumber; + continue; + } + if(cellText.contains("mUname")){//措施 + measureMode = rowNumber; + continue; + } + if(cellText.contains("apprUname")){//审批层 + approvalMode = rowNumber; + continue; + } + } + } + rowNumber+=1; + } + Map<String,Integer> rowMap = new HashMap<>(); + rowMap.put("analysis",analysisMode); + rowMap.put("measure",measureMode); + rowMap.put("approval",approvalMode); + return rowMap; + } + + /** + * 插入审批层数据 + */ + public void insertValue(int rowNo,List<Map<String,String>> approvalList) throws Exception { + XWPFTable xwpfTable = xwpfDocument.getTables().get(0); + List<XWPFTableRow> rows = xwpfTable.getRows(); + if (rows.size() < rowNo+1) { + throw new Exception("模板错误!"); + } + // + //模板的那一行 + XWPFTableRow modeRow = rows.get(rowNo); + int newRowNo = rowNo + 1; + for (int i = 0, len = approvalList.size(); i < len; i++) { + Map<String, String> map = approvalList.get(i); + if(null != map){ + // 创建新的一行 + XWPFTableRow newRow = xwpfTable.insertNewTableRow(newRowNo++); + setNewRowStyle(modeRow, newRow,map); + } + } + // 删除模版行 + xwpfTable.removeRow(rowNo); + } + + //填充值并调整样式 + public void setNewRowStyle(XWPFTableRow modeRow, XWPFTableRow newRow,Map<String,String> map){ + try{ + //复制行的样式给新行 + newRow.getCtRow().setTrPr(modeRow.getCtRow().getTrPr()); + //获取要复制样式的行的单元格 + List<XWPFTableCell> modeCells = modeRow.getTableCells(); + //循环复制单元格 + for (XWPFTableCell modeCell : modeCells) { + //添加新列 + XWPFTableCell newCell = newRow.addNewTableCell(); + //模板列 + String modeCellText = modeCell.getText(); + if (StringUtils.isNotBlank(modeCellText)) { + //转换为mapkey对应的字段 + String cellTextKey = modeCellText.replace("$", "").replace("{", "").replace("}", ""); + if (map.containsKey(cellTextKey)) { + //字体 + String fontFamily = modeCell.getParagraphs().get(0).getRuns().get(0).getFontFamily(); + Double fontSizeDouble = modeCell.getParagraphs().get(0).getRuns().get(0).getFontSizeAsDouble(); + // 填充内容 + newCell.setText(map.get(cellTextKey)); + newCell.getParagraphs().get(0).getRuns().get(0).setFontFamily(fontFamily); + newCell.getParagraphs().get(0).getRuns().get(0).setFontSize(fontSizeDouble); + } + } + //复制单元格的样式给新单元格 + newCell.getCTTc().setTcPr(modeCell.getCTTc().getTcPr()); + //设置垂直居中 + newCell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);//垂直居中 + //复制单元格的居中方式给新单元格 + CTPPr pPr = modeCell.getCTTc().getPList().get(0).getPPr(); + if(pPr!=null&&pPr.getJc()!=null&&pPr.getJc().getVal()!=null){ + CTTc cttc = newCell.getCTTc(); + CTP ctp = cttc.getPList().get(0); + CTPPr ctppr = ctp.getPPr(); + if (ctppr == null) { + ctppr = ctp.addNewPPr(); + } + CTJc ctjc = ctppr.getJc(); + if (ctjc == null) { + ctjc = ctppr.addNewJc(); + } + ctjc.setVal(pPr.getJc().getVal()); //水平居中 + } + + //得到复制单元格的段落 + List<XWPFParagraph> sourceParagraphs = modeCell.getParagraphs(); + if (StringUtils.isEmpty(modeCell.getText())) { + continue; + } + //拿到第一段 + XWPFParagraph modeParagraph = sourceParagraphs.get(0); + //得到新单元格的段落 + List<XWPFParagraph> targetParagraphs = newCell.getParagraphs(); + //判断新单元格是否为空 + if (StringUtils.isEmpty(newCell.getText())) { + //添加新的段落 + XWPFParagraph ph = newCell.addParagraph(); + //复制段落样式给新段落 + ph.getCTP().setPPr(modeParagraph.getCTP().getPPr()); + //得到文本对象 + XWPFRun run = ph.getRuns().isEmpty() ? ph.createRun() : ph.getRuns().get(0); + //复制文本样式 + run.setFontFamily(modeParagraph.getRuns().get(0).getFontFamily()); + } else { + XWPFParagraph ph = targetParagraphs.get(0); + ph.getCTP().setPPr(modeParagraph.getCTP().getPPr()); + XWPFRun run = ph.getRuns().isEmpty() ? ph.createRun() : ph.getRuns().get(0); + run.setFontFamily(modeParagraph.getRuns().get(0).getFontFamily()); + } + } + }catch (Exception e){ + throw new BusinessException(E.EXPORT_FAIL,"单元格格式复制失败!"); + } + } + + /** + * 清除单元格数据 + * @param cell + */ + public void clearCell(XWPFTableCell cell){ + List<XWPFParagraph> paragraphs = cell.getParagraphs(); + for(int j = 0; j < paragraphs.size(); j++){ + cell.removeParagraph(j); + } + } + + + /** + * 收尾方法 + * @param outDocPath + * @return + * @throws IOException + */ + public boolean generate(String outDocPath) throws IOException{ + outputStream = new FileOutputStream(outDocPath); + xwpfDocument.write(outputStream); + this.close(outputStream); + this.close(inputStream); + return true; + } + + /** + * 返回浏览器端 导出word + * @param response + * @return + * @throws IOException + */ + public boolean responseWord(HttpServletResponse response, String fileName, String workCode) throws IOException{ + if(StringUtils.isNotBlank(fileName) && StringUtils.isNotBlank(workCode) ){ + fileName = fileName + "-"+ workCode; + }else { + fileName = "特殊作业证"; + } + fileName = URLEncoder.encode(fileName,"UTF-8"); + response.setContentType("application/x-msdownload;charset=UTF-8"); + response.addHeader("Content-Disposition", "attachment;filename=" + fileName + ".docx"); + xwpfDocument.write(response.getOutputStream()); + this.close(inputStream); + return true; + } + + /** + * 返回浏览器端 导出pdf + * @param response + * @return + * @throws IOException + */ + public void responsePDF(HttpServletResponse response, String fileName, String workCode) throws IOException{ + if(StringUtils.isNotBlank(fileName) && StringUtils.isNotBlank(workCode) ){ + fileName = fileName + "-"+ workCode + ".pdf"; + }else { + fileName = "特殊作业证"+".pdf"; + } + //getPDF(response); + response.setContentType("application/pdf;charset=UTF-8"); + response.addHeader("Content-Disposition", + "attachment;filename=" + new String(fileName.getBytes(), "UTF-8")); + + //将word文档文件流写到字节输出流中 + ByteArrayOutputStream outDocx = new ByteArrayOutputStream(); + xwpfDocument.write(outDocx); + //将输出流转换成输入流 + ByteArrayInputStream inDocx = new ByteArrayInputStream(outDocx.toByteArray()); + IConverter converter = LocalConverter.builder().build(); + converter.convert(inDocx).as(DocumentType.DOCX).to(response.getOutputStream()).as(DocumentType.PDF).execute(); + + outDocx.flush(); + outDocx.close(); + inDocx.close(); + this.close(inputStream); + } + /** + * 转换PDF + */ + /* public String getTemPdfPath() throws IOException { + //将文件存入项目根目录下 + String tempPath = System.getProperty("user.dir") + "/" + System.currentTimeMillis(); + OutputStream outTemPDF = new FileOutputStream(tempPath); + //将word文档文件流写到字节输出流中 + ByteArrayOutputStream outDocx = new ByteArrayOutputStream(); + xwpfDocument.write(outDocx); + //将输出流转换成输入流 + ByteArrayInputStream inDocx = new ByteArrayInputStream(outDocx.toByteArray()); + IConverter converter = LocalConverter.builder().build(); + converter.convert(inDocx).as(DocumentType.DOCX).to(outTemPDF).as(DocumentType.PDF).execute(); + outDocx.flush(); + outDocx.close(); + outTemPDF.flush(); + outTemPDF.close(); + inDocx.close(); + return tempPath; + }*/ + /** + * 关闭输入流 + * @param is + */ + private void close(InputStream is) { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 关闭输出流 + * @param os + */ + private void close(OutputStream os) { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 获取二维码字节流 + */ + public void generateQRCode(String text) throws IOException, InvalidFormatException { + //生成二维码 + ByteArrayOutputStream outputStream = QrCodeUtil.generate(text); + //插入图片 + XWPFParagraph paragraph = xwpfDocument.getParagraphArray(0); + List<XWPFRun> runs = paragraph.getRuns(); + for (XWPFRun run : runs) { + String runText = run.text().trim(); + if(runText.equals("${qrcode}")){ + run.setText("",0); + ByteArrayInputStream is = new ByteArrayInputStream(outputStream.toByteArray()); + run.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, "qrcode", Units.toEMU(40), Units.toEMU(40)); + + + //浮于文字上方 + CTDrawing drawing= run.getCTR().getDrawingArray(0); + CTGraphicalObject go= drawing.getInlineArray(0).getGraphic(); + Random random= new Random(); + int number = random.nextInt(999) + 1; + + CTAnchor anchor1 = getAnchorWithGraphic(go, "Seal" +number, + + Units.toEMU(WIDTH), Units.toEMU(HEIGHT),//图片大小 + + Units.toEMU(LEFTOFFSET), Units.toEMU(TOPOFFSET), false); + + drawing.setAnchorArray(new CTAnchor[]{anchor1});//添加浮动属性 + drawing.removeInline(0);//删除行内属性//添加签名图片 + + //关闭输出流 + outputStream.close(); + //关闭输入流 + is.close(); + + } + + } + } + + /** + * 设置二维码样式 + * @param ctGraphicalObject + * @param deskFileName + * @param width + * @param height + * @param leftOffset + * @param topOffset + * @param behind + * @return + */ + public static CTAnchor getAnchorWithGraphic(CTGraphicalObject ctGraphicalObject, + + String deskFileName,int width, int height,int leftOffset, int topOffset, boolean behind) { + String anchorXML = + "<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " + + "simplePos=\"0\" relativeHeight=\"0\" behindDoc=\"" + ((behind) ? 1 : 0) + "\" locked=\"0\" layoutInCell=\"1\" allowOverlap=\"1\">" + + "<wp:simplePos x=\"0\" y=\"0\"/>" + + "<wp:positionH relativeFrom=\"column\">" + + "<wp:posOffset>" + leftOffset + "</wp:posOffset>" + + "</wp:positionH>" + + "<wp:positionV relativeFrom=\"paragraph\">" + + "<wp:posOffset>" + topOffset + "</wp:posOffset>" + + "</wp:positionV>" + + "<wp:extent cx=\"" + width + "\" cy=\"" + height + "\"/>" + + "<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>" + + "<wp:wrapNone/>" + + "<wp:docPr id=\"1\" name=\"Drawing 0\" descr=\"" + deskFileName + "\"/><wp:cNvGraphicFramePr/>" + + "</wp:anchor>"; + + + CTDrawing drawing= null; + try{ + drawing= CTDrawing.Factory.parse(anchorXML); + + }catch(XmlException e) { + e.printStackTrace(); + + } + + assert drawing != null; + CTAnchor anchor= drawing.getAnchorArray(0); + + anchor.setGraphic(ctGraphicalObject); + return anchor; + + } + + + /** + * 测试 + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + + /*// 添加假数据 这里你也可以从数据库里获取数据 + List<Map<String, String>> approvalList = new ArrayList<>(); + for (int i =0;i < 5; i++){ + Map<String,String> map = new HashMap<>(); + map.put("apprDepName", "2018"+i); + map.put("apprOpinion", "我是第一列数据"+i); + map.put("apprUname", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); + map.put("apResult", "监理意见"+i); + map.put("apprSign", "我是备注"+i); + map.put("apprTime","时间"); + approvalList.add(map); + } + // 添加假数据 这里你也可以从数据库里获取数据 + List<Map<String, String>> measureList = new ArrayList<>(); + for (int i =0;i < 10; i++){ + Map<String,String> map = new HashMap<>(); + map.put("index", "2018"+i); + map.put("measure", "我是第一列数据"+i); + map.put("mResult", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); + map.put("mUname", "监理意见"+i); + measureList.add(map); + } + List<Map<String, String>> analysisList = new ArrayList<>(); + for (int i =0;i < 10; i++){ + Map<String,String> map = new HashMap<>(); + map.put("anaAddress", "2018"+i); + map.put("anaData", "我是第一列数据"+i); + map.put("anaResult", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())); + map.put("anaUname", "监理意见"+i); + map.put("anaTime", "监理意见"+i); + analysisList.add(map); + } + Map<String,String> textMap=new HashMap<>(); + textMap.put("name", "新疆国泰新华化工有限责任公司动火作业"); + textMap.put("footer", "此票一式三联,一联生产车间留存,二联作业单位留存,三联生产技术科留存"); + //基础数据 + Map<String,String> baseDataMap=new HashMap<>(); + baseDataMap.put("applydepName","人事部"); + baseDataMap.put("applyUname","张三"); + baseDataMap.put("workCode","GK-000001"); + baseDataMap.put("workType","动火作业"); + baseDataMap.put("workMethod","电焊"); + baseDataMap.put("addressAndContent","动火地点及内容"); + baseDataMap.put("workTime","作业时间"); + baseDataMap.put("operatorNames","作业人"); + baseDataMap.put("otherSpeicialWork","其他特殊作业"); + baseDataMap.put("harm","危害辨识"); + + Map<String,Object> dataMap = new HashMap<>(); + dataMap.put("baseData",baseDataMap); + dataMap.put("text","You a pig ! emmmmmm"); + dataMap.put("approval",approvalList); + dataMap.put("measure",measureList); + dataMap.put("analysis",analysisList); + + // 模板文件输入输出地址 + String filePath = "F:/test/workhot.docx"; + String outPath = "F:/test/workhot示例文档.docx"; + + WorkExportUtil workExportUtil = new WorkExportUtil(); + workExportUtil.setTempLocalPath(filePath); //设置模板的路径 + workExportUtil.init(); //初始化工具类 + workExportUtil.export(dataMap); //写入相关数据 + workExportUtil.generate(outPath); //导出到目标文档*/ + String rootPath= System.getProperty("user.dir"); + System.out.println(rootPath); + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/util/WorkPrintShiftUtil.java b/src/main/java/com/gk/hotwork/specialWork/util/WorkPrintShiftUtil.java new file mode 100644 index 0000000..ff33027 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/util/WorkPrintShiftUtil.java @@ -0,0 +1,88 @@ +package com.gk.hotwork.specialWork.util; + + +import com.gk.hotwork.Domain.dto.DepInfoRPCRespDTO; +import com.gk.hotwork.specialWork.entity.WorkApplyOperatorInfo; +import com.gk.hotwork.specialWork.enums.WorkTypeEnum; +import org.apache.commons.lang3.StringUtils; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; + +public class WorkPrintShiftUtil { + /** + * 时间转换 + */ + public static String shiftTime(LocalDateTime dateTime){ + if(null != dateTime){ + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分"); + String time = formatter.format(dateTime); + return time; + } + return null; + + } + /** + * 特殊作业名称转换 + */ + public static String shiftOtherSpecialWork(String otherSpecialWorkIds){ + if(StringUtils.isNotBlank(otherSpecialWorkIds)){ + String[] strSplit = otherSpecialWorkIds.split(","); + StringBuffer stringBuffer = new StringBuffer(); + for (String str : strSplit) { + stringBuffer.append(WorkTypeEnum.parse(Byte.parseByte(str)).getName()).append(","); + } + stringBuffer.deleteCharAt(stringBuffer.toString().length()-1); + return stringBuffer.toString(); + } + return null; + } + /** + * 作业人转换 + */ + public static String shiftOperators(List<WorkApplyOperatorInfo> list){ + if(null != list && list.size()>0){ + StringBuffer stringBuffer = new StringBuffer(); + for (WorkApplyOperatorInfo operatorInfo : list) { + stringBuffer.append(operatorInfo.getOperatorUname()).append(","); + } + String substring = stringBuffer.toString().substring(0, stringBuffer.length() - 1); + return substring; + } + return null; + } + + /** + * 字符串转换list集合 + * @param str + * @return + */ + public static List<Long> shiftList(String str){ + if(StringUtils.isNotBlank(str)){ + List<Long> list = new ArrayList<>(); + String[] arr = str.split(","); + for (int i = 0; i < arr.length; i++) { + list.add(Long.valueOf(arr[i])); + } + return list; + } + return null; + } + /** + * 相关部门转换 + */ + public static String shiftInvolvedDepName(List<DepInfoRPCRespDTO> deptInfoList){ + if(null != deptInfoList && deptInfoList.size() > 0){ + StringBuffer stringBuffer = new StringBuffer(); + for (DepInfoRPCRespDTO deptInfo : deptInfoList) { + stringBuffer.append(deptInfo.getDepName()).append(","); + } + String substring = stringBuffer.toString().substring(0, stringBuffer.length() - 1); + return substring; + } + return null; + } + +} diff --git a/src/main/java/com/gk/hotwork/specialWork/util/WorkUtil.java b/src/main/java/com/gk/hotwork/specialWork/util/WorkUtil.java new file mode 100644 index 0000000..b3c90e8 --- /dev/null +++ b/src/main/java/com/gk/hotwork/specialWork/util/WorkUtil.java @@ -0,0 +1,249 @@ +package com.gk.hotwork.specialWork.util; + +import org.apache.poi.xwpf.usermodel.*; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.math.BigInteger; +import java.net.URLEncoder; +import java.util.List; + +public class WorkUtil { + public static void write2Docx()throws Exception{ + XWPFDocument document = new XWPFDocument(); + + + wordHeader(document,"动火作业"); + //基本信息表格 + XWPFTable infoTable = document.createTable(1,12); + //infoTable.setTableAlignment(TableRowAlign.CENTER); + //列宽自动分割 + CTTblWidth infoTableWidth = infoTable.getCTTbl().addNewTblPr().addNewTblW(); + infoTableWidth.setType(STTblWidth.DXA); + infoTableWidth.setW(BigInteger.valueOf(9072)); + + //表格第一行 + XWPFTableRow infoTableRowOne = infoTable.getRow(0); + infoTableRowOne.getCell(0).setText("申请单位"); + infoTableRowOne.addNewTableCell().setText("人事部门"); + infoTableRowOne.addNewTableCell().setText("申请人"); + infoTableRowOne.addNewTableCell().setText("张三"); + infoTableRowOne.addNewTableCell().setText("作业证编号"); + infoTableRowOne.addNewTableCell().setText("XHGT-00001"); + + //表格第二行 + XWPFTableRow infoTableRowTwo = infoTable.createRow(); + infoTableRowTwo.getCell(0).setText("动火作业级别"); + infoTableRowTwo.getCell(1).setText("特级动火作业"); + infoTableRowTwo.getCell(2).setText("动火方式"); + infoTableRowTwo.getCell(3).setText("电焊、气割、手动论切割"); + + infoTableRowTwo.addNewTableCell().setText(""); + //表格第三行 + XWPFTableRow infoTableRowThree = infoTable.createRow(); + infoTableRowThree.getCell(0).setText("动火地点及内容"); + infoTableRowThree.getCell(1).setText("·········"); + infoTableRowThree.getCell(2).setText(""); + infoTableRowThree.getCell(3).setText(""); + infoTableRowThree.getCell(4).setText(""); + infoTableRowThree.getCell(5).setText(""); + //表格第四行 + XWPFTableRow infoTableRowFour = infoTable.createRow(); + infoTableRowFour.getCell(0).setText("动火时间"); + infoTableRowFour.getCell(1).setText("XXXX-XX-XX"); + + mergeCellsHorizontal(infoTable,3,1,5); + + //分析数据 + //表格第五行 + XWPFTableRow infoTableRowFive = infoTable.createRow(); + infoTableRowFive.getCell(0).setText("分析点名称"); + infoTableRowFive.getCell(1).setText("分析项"); + infoTableRowFive.getCell(2).setText("分析数据"); + infoTableRowFive.getCell(3).setText("分析结果"); + infoTableRowFive.getCell(4).setText("分析人"); + infoTableRowFive.getCell(5).setText("分析时间"); + + XWPFTableRow infoTableRowSix = infoTable.createRow(); + infoTableRowSix.getCell(0).setText("XX"); + infoTableRowSix.getCell(1).setText("XX"); + infoTableRowSix.getCell(2).setText("XX"); + infoTableRowSix.getCell(3).setText("XX"); + infoTableRowSix.getCell(4).setText("XX"); + infoTableRowSix.getCell(5).setText("XX"); + + XWPFTableRow infoTableRowSeven = infoTable.createRow(); + infoTableRowSeven.getCell(0).setText("XX"); + infoTableRowSeven.getCell(1).setText("XX"); + infoTableRowSeven.getCell(2).setText("XX"); + infoTableRowSeven.getCell(3).setText("XX"); + infoTableRowSeven.getCell(4).setText("XX"); + infoTableRowSeven.getCell(5).setText("XX"); + + XWPFTableRow infoTableRowEight = infoTable.createRow(); + infoTableRowEight.getCell(0).setText("涉及的其他特殊作业"); + infoTableRowEight.getCell(1).setText("XX"); + infoTableRowEight.getCell(2).setText("XX"); + infoTableRowEight.getCell(3).setText("XX"); + infoTableRowEight.getCell(4).setText("XX"); + infoTableRowEight.getCell(5).setText("XX"); + + XWPFTableRow infoTableRowNine = infoTable.createRow(); + infoTableRowNine.getCell(0).setText("涉及的其他特殊作业"); + infoTableRowNine.getCell(1).setText("危害辨识"); + infoTableRowNine.getCell(2).setText("XX"); + infoTableRowNine.getCell(3).setText("XX"); + infoTableRowNine.getCell(4).setText("XX"); + infoTableRowNine.getCell(5).setText("XX"); + + XWPFTableRow infoTableRowTen = infoTable.createRow(); + infoTableRowTen.getCell(0).setText("安全措施"); + infoTableRowTen.getCell(1).setText("XX"); + infoTableRowTen.getCell(2).setText("XX"); + infoTableRowTen.getCell(3).setText("XX"); + infoTableRowTen.getCell(4).setText("XX"); + infoTableRowTen.getCell(5).setText("XX"); + int numberOfRows = infoTable.getNumberOfRows(); + System.out.println(numberOfRows); + + wordFooter(document); + + + //创建文档 + File file = new File("F:\\Offer\\create_table.docx"); + if(!file.exists()){ + if(!file.getParentFile().exists()){ + file.getParentFile().mkdir(); + } + if (!file.exists()){ + file.createNewFile(); + } + } + FileOutputStream out = new FileOutputStream(file); + document.write(out); + out.close(); + } + + /** + * 作业票证头部 + * @param document + */ + public static void wordHeader(XWPFDocument document,String workTypeName){ + //添加标题 + XWPFParagraph titleParagraph = document.createParagraph(); + //设置段落居中 + titleParagraph.setAlignment(ParagraphAlignment.CENTER); + + XWPFRun titleParagraphRun = titleParagraph.createRun(); + titleParagraphRun.setText("新疆国泰新华化工有限责任公司"+workTypeName+"证"); + titleParagraphRun.setColor("000000"); + titleParagraphRun.setFontSize(14); +// //换行 +// titleParagraphRun.addBreak(); + + } + + /** + * 作业票证尾部 + * @param document + */ + public static void wordFooter(XWPFDocument document){ + //添加标题 + XWPFParagraph footerParagraph = document.createParagraph(); + //设置段落居中 + footerParagraph.setAlignment(ParagraphAlignment.CENTER); + + XWPFRun titleParagraphRun = footerParagraph.createRun(); + titleParagraphRun.setText("此票一式三联,一联生产车间留存,二联作业单位留存,三联生产技术科留存"); + titleParagraphRun.setColor("000000"); + titleParagraphRun.setFontSize(12); + //换行 + titleParagraphRun.addBreak(); + } + + /** + * word单元格列合并列 + * @param table 表格 + * @param row 合并列所在行 + * @param startCell 开始列 + * @param endCell 结束列 + */ + public static void mergeCellsHorizontal(XWPFTable table, int row, int startCell, int endCell) { + for (int i = startCell; i <= endCell; i++) { + XWPFTableCell cell = table.getRow(row).getCell(i); + if (i == startCell) { + // The first merged cell is set with RESTART merge value + cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART); + } else { + // Cells which join (merge) the first one, are set with CONTINUE + cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE); + } + } + } + + /** + * word单元格列合并行 + * @param table 表格 + * @param col 合并行所在列 + * @param startRow 开始行 + * @param endRow 结束行 + */ + public static void mergeCellsVertically(XWPFTable table, int col, int startRow, int endRow) { + for (int i = startRow; i <= endRow; i++) { + XWPFTableCell cell = table.getRow(i).getCell(col); + if (i == startRow) { + cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.RESTART); + } else { + cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE); + } + } + } + + public static void expotWord(HttpServletResponse response, String fileName, XWPFDocument document) { + try { + fileName = URLEncoder.encode(fileName,"UTF-8"); + response.setContentType("application/x-msdownload;charset=UTF-8"); + response.addHeader("Content-Disposition", "attachment;filename=" + fileName + ".docx"); + document.write(response.getOutputStream()); + }catch (Exception e){ + e.printStackTrace(); + } + } + + /** + * 清空单元格数据 + * @param row 行 + * @throws Exception + */ + public static void clearCell(XWPFTableRow row){ + List<XWPFTableCell> tableCells = row.getTableCells(); + for (int i = 0; i < tableCells.size(); i++) { + tableCells.get(i).getParagraphs(); + if(tableCells.get(i).getParagraphs().size()>0){ + tableCells.get(i).removeParagraph(0); + } + + } + } + public static void clearCell1(XWPFTableRow row,int col,String text){ + XWPFTableCell cell = row.getTableCells().get(col); + for (XWPFParagraph p : cell.getParagraphs()) + { + for (XWPFRun r : p.getRuns()) + { + + r.setText(text);//要深入到原cell中的run替换内容才能保证样式一致 + } + } + } + + public static void main(String[] args) throws Exception { + write2Docx(); + System.out.println(System.getProperty("user.dir")); + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..0780eca --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,139 @@ +# server +server: + tomcat: + uri-encoding: UTF-8 + basedir: / + port: 8006 + servlet: + context-path: / +# mysql +spring: + datasource: + one: + url: jdbc:mysql://139.196.181.203:3306/hazad_investigation?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: GKHY@root20201! + type: com.alibaba.druid.pool.DruidDataSource + + #redis + redis: + database: 0 + host: 127.0.0.1 + port: 6379 + password: root + jedis: + pool: + max-idle: 8 + max-active: 8 + max-wait: -1ms + min-idle: 0 + +#控制线程是否执行 true:执行;false:不执行 +scheduling: + enabled: false + + + +host: http://localhost:8006 + +filePath: d:/uploads/ +fileurl: http://localhost:8006/upload/ +socketport: 504 + +sqlPath: /home/dbback/ +sqlurl: http://nmy.sinanoaq.cn:8006/dbback/ + +enterprisePath: /home/uploads/enterprise/ +enterpriseUrl: http://nmy.sinanoaq.cn:8006/upload/enterprise/ +enterprise: enterprise/ + +transportCertificatePath: /home/uploads/transportCertificate/ +transportCertificateUrl: http://nmy.sinanoaq.cn:8006/upload/transportCertificate/ +transportCertificate: transportCertificate/ + +hiddenDangerPath: /home/uploads/hiddenDanger/ +hiddenDangerUrl: http://nmy.sinanoaq.cn:8006/upload/hiddenDanger/ +hiddenDanger: hiddenDanger/ + +standardPath: /home/uploads/standard/ +standardUrl: http://nmy.sinanoaq.cn:8006/upload/standard/ +standard: standard/ + +contractPath: /home/uploads/contract/ +contractUrl: http://nmy.sinanoaq.cn:8006/upload/contract/ +contract: contract/ + +patrolPath: /home/uploads/patrol/ +patrolUrl: http://nmy.sinanoaq.cn:8006/upload/patrol/ + +appPath: /home/uploads/app/ +app: app/ +appUrl: http://nmy.sinanoaq.cn:8006/upload/app/ + +productPath: /home/uploads/product/ +productUrl: http://nmy.sinanoaq.cn:8006/upload/product/ + +assessApplyPath: /home/uploads/assessApply/ +assessApplytUrl: http://nmy.sinanoaq.cn:8006/upload/assessApply/ +assessApply: assessApply/ + +workCertPath: /home/uploads/workCert/ +workCertUrl: http://nmy.sinanoaq.cn:8006/upload/workCert/ +workCert: workCert/ + +nanowebUrl: http://nmy.sinanoaq.cn:8006/nanoweb/api/register +nanowebEnable: true + +taskPath: d:/uploads/task/ +taskPathPrefix: d:/uploads/ +taskUrl: http://localhost:8006/upload/task/ +task: task/ + +emergencyPlanPath: /home/uploads/emergencyPlan/ +emergencyPlanUrl: http://localhost:8006/upload/emergencyPlan/ +emergencyPlan : emergencyPlan/ + +safecheckExecImagePath : /home/uploads/safecheck/ +safecheckExecImageFatherPath: /home/uploads/ +safecheckRelativePath : safecheck/ + +slice: + size: 20 + + +sms: + enable: true + active: jh + limit: 5 + supplier: + jh: + name: jh + key: RZ8HGrgw/eztIa1wk+5hCkTGlr27axo8Y4lvZjmEmVfGsLJrhpexK30hc/qyBEeZ + url: http://v.juhe.cn/sms/send + ali: + name: ali + key: + url: + +rocketmq: + name-server: 192.168.30.107:9876 + #name-server: localhost:9876 + producer: + group: gkhy-safeplatform-dev-ZIS + sendMessageTimeout: 300000 + consumers: + #group: gkhy-safeplatform-dev-s + CreateGroup: gkhy-safeplatform-CreateConsumer-ZIS + NoticeGroup: gkhy-safeplatform-NoticeConsumer-ZIS + TimeOutGroup: gkhy-safeplatform-TimeOutConsumer-ZIS + WaitWorkGroup: gkhy-safeplatform-WaitWorkConsumer-ZIS + applySpecialWorkGroup: gkhy-safeplatform-applySpecialWorkConsumer-ZIS + approvalSpecialWorkGroup: gkhy-safeplatform-topic-approvalSpecialWorkConsumer-ZIS + topic: + #demoTopic: gkhy-safeplatform-topic-demo-s + preventCreateTaskTopic: gkhy-safeplatform-topic-preventCreateTask-ZIS + preventNoticeTaskTopic: gkhy-safeplatform-topic-preventNoticeTask-ZIS + preventTimeOutTaskTopic: gkhy-safeplatform-topic-preventTimeOutTask-ZIS + preventWaitWorkTopic: gkhy-safeplatform-topic-preventWaitWork-ZIS + applySpecialWorkTopic: gkhy-safeplatform-topic-applySpecialWork-ZIS + approvalSpecialWorkTopic: gkhy-safeplatform-topic-approvalSpecialWork-ZIS diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..46adf95 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,145 @@ +# server +server: + tomcat: + uri-encoding: UTF-8 + basedir: / + port: 8006 + servlet: + context-path: / +# mysql +spring: + datasource: + one: + url: jdbc:mysql://twt.sinanoaq.com:13306/hotwork?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: Sinanoaq#415 + type: com.alibaba.druid.pool.DruidDataSource + + #redis + redis: + database: 0 + host: 127.0.0.1 + port: 6379 + password: root + jedis: + pool: + max-idle: 8 + max-active: 8 + max-wait: -1ms + min-idle: 0 + +#控制线程是否执行 true:执行;false:不执行 +scheduling: +# enabled: true + enabled: false + +host: http://localhost:8006/zhongtai + +filePath: /home/uploads/ +fileurl: http://nmy.sinanoaq.cn:8006/upload/ +socketport: 504 + +sqlPath: /home/dbback/ +sqlurl: http://nmy.sinanoaq.cn:8006/dbback/ + +enterprisePath: /home/uploads/enterprise/ +enterpriseUrl: http://nmy.sinanoaq.cn:8006/upload/enterprise/ +enterprise: enterprise/ + +transportCertificatePath: /home/uploads/transportCertificate/ +transportCertificateUrl: http://nmy.sinanoaq.cn:8006/upload/transportCertificate/ +transportCertificate: transportCertificate/ + +hiddenDangerPath: /home/uploads/hiddenDanger/ +hiddenDangerUrl: http://nmy.sinanoaq.cn:8006/upload/hiddenDanger/ +hiddenDanger: hiddenDanger/ + +standardPath: /home/uploads/standard/ +standardUrl: http://nmy.sinanoaq.cn:8006/upload/standard/ +standard: standard/ + +contractPath: /home/uploads/contract/ +contractUrl: http://nmy.sinanoaq.cn:8006/upload/contract/ +contract: contract/ + +patrolPath: /home/uploads/patrol/ +patrolUrl: http://nmy.sinanoaq.cn:8006/upload/patrol/ + +appPath: /home/uploads/app/ +app: app/ +appUrl: http://nmy.sinanoaq.cn:8006/upload/app/ + +productPath: /home/uploads/product/ +productUrl: http://nmy.sinanoaq.cn:8006/upload/product/ + +assessApplyPath: /home/uploads/assessApply/ +assessApplytUrl: http://nmy.sinanoaq.cn:8006/upload/assessApply/ +assessApply: assessApply/ + +workCertPath: /home/uploads/workCert/ +workCertUrl: http://nmy.sinanoaq.cn:8006/upload/workCert/ +workCert: workCert/ + +nanowebUrl: http://nmy.sinanoaq.cn:8006/nanoweb/api/register +nanowebEnable: true + +taskPath: /home/uploads/task/ +taskPathPrefix: /home/uploads/ +taskUrl: http://nmy.sinanoaq.cn:8006/upload/task/ +task: task/ + +emergencyPlanPath: /home/uploads/emergencyPlan/ +emergencyPlanUrl: http://localhost:8006/upload/emergencyPlan/ +emergencyPlan : emergencyPlan/ + +safecheckExecImagePath : /home/uploads/safecheck/ +safecheckExecImageFatherPath: /home/uploads/ +safecheckRelativePath : safecheck/ + +slice: + size: 20 + + +#短信api服务地址 +sms-service.url: http://v.juhe.cn/sms/send +#短信api请求key +sms-service.key: f89279278b739f972ed922fa708eafa0 + +sms: + enable: true + active: jh + limit: 5 + supplier: + jh: + name: jh + key: RZ8HGrgw/eztIa1wk+5hCkTGlr27axo8Y4lvZjmEmVfGsLJrhpexK30hc/qyBEeZ + url: http://v.juhe.cn/sms/send + ali: + name: ali + key: + url: + +rocketmq: + client: + logLevel: ERROR + name-server: 192.168.30.107:9876 +# name-server: localhost:9876 + producer: + group: gkhy-safeplatform-prod-HIS + sendMessageTimeout: 300000 + consumers: + #group: gkhy-safeplatform-dev-s + CreateGroup: gkhy-safeplatform-CreateConsumer-HIS + NoticeGroup: gkhy-safeplatform-NoticeConsumer-HIS + TimeOutGroup: gkhy-safeplatform-TimeOutConsumer-HIS + WaitWorkGroup: gkhy-safeplatform-WaitWorkConsumer-HIS + applySpecialWorkGroup: gkhy-safeplatform-applySpecialWorkConsumer-HIS + approvalSpecialWorkGroup: gkhy-safeplatform-topic-approvalSpecialWorkConsumer-HIS + topic: + #demoTopic: gkhy-safeplatform-topic-demo-s + preventCreateTaskTopic: gkhy-safeplatform-topic-preventCreateTask-HIS + preventNoticeTaskTopic: gkhy-safeplatform-topic-preventNoticeTask-HIS + preventTimeOutTaskTopic: gkhy-safeplatform-topic-preventTimeOutTask-HIS + preventWaitWorkTopic: gkhy-safeplatform-topic-preventWaitWork-HIS + applySpecialWorkTopic: gkhy-safeplatform-topic-applySpecialWork-HIS + approvalSpecialWorkTopic: gkhy-safeplatform-topic-approvalSpecialWork-HIS diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..9585ced --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,139 @@ +# server +server: + tomcat: + uri-encoding: UTF-8 + basedir: / + port: 8006 + servlet: + context-path: / +# mysql +spring: + datasource: + one: + url: jdbc:mysql://localhost:3306/hotwork?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: 123456 + type: com.alibaba.druid.pool.DruidDataSource + + #redis + redis: + database: 0 + host: 127.0.0.1 + port: 6379 + password: root + jedis: + pool: + max-idle: 8 + max-active: 8 + max-wait: -1ms + min-idle: 0 + +#控制线程是否执行 true:执行;false:不执行 +scheduling: + enabled: false + + + +host: http://localhost:8006 + +filePath: d:/uploads/ +fileurl: http://localhost:8006/upload/ +socketport: 504 + +sqlPath: /home/dbback/ +sqlurl: http://nmy.sinanoaq.cn:8006/dbback/ + +enterprisePath: /home/uploads/enterprise/ +enterpriseUrl: http://nmy.sinanoaq.cn:8006/upload/enterprise/ +enterprise: enterprise/ + +transportCertificatePath: /home/uploads/transportCertificate/ +transportCertificateUrl: http://nmy.sinanoaq.cn:8006/upload/transportCertificate/ +transportCertificate: transportCertificate/ + +hiddenDangerPath: /home/uploads/hiddenDanger/ +hiddenDangerUrl: http://nmy.sinanoaq.cn:8006/upload/hiddenDanger/ +hiddenDanger: hiddenDanger/ + +standardPath: /home/uploads/standard/ +standardUrl: http://nmy.sinanoaq.cn:8006/upload/standard/ +standard: standard/ + +contractPath: /home/uploads/contract/ +contractUrl: http://nmy.sinanoaq.cn:8006/upload/contract/ +contract: contract/ + +patrolPath: /home/uploads/patrol/ +patrolUrl: http://nmy.sinanoaq.cn:8006/upload/patrol/ + +appPath: /home/uploads/app/ +app: app/ +appUrl: http://nmy.sinanoaq.cn:8006/upload/app/ + +productPath: /home/uploads/product/ +productUrl: http://nmy.sinanoaq.cn:8006/upload/product/ + +assessApplyPath: /home/uploads/assessApply/ +assessApplytUrl: http://nmy.sinanoaq.cn:8006/upload/assessApply/ +assessApply: assessApply/ + +workCertPath: /home/uploads/workCert/ +workCertUrl: http://nmy.sinanoaq.cn:8006/upload/workCert/ +workCert: workCert/ + +nanowebUrl: http://nmy.sinanoaq.cn:8006/nanoweb/api/register +nanowebEnable: true + +taskPath: d:/uploads/task/ +taskPathPrefix: d:/uploads/ +taskUrl: http://localhost:8006/upload/task/ +task: task/ + +emergencyPlanPath: /home/uploads/emergencyPlan/ +emergencyPlanUrl: http://localhost:8006/upload/emergencyPlan/ +emergencyPlan : emergencyPlan/ + +safecheckExecImagePath : /home/uploads/safecheck/ +safecheckExecImageFatherPath: /home/uploads/ +safecheckRelativePath : safecheck/ + +slice: + size: 20 + + +sms: + enable: true + active: jh + limit: 5 + supplier: + jh: + name: jh + key: RZ8HGrgw/eztIa1wk+5hCkTGlr27axo8Y4lvZjmEmVfGsLJrhpexK30hc/qyBEeZ + url: http://v.juhe.cn/sms/send + ali: + name: ali + key: + url: + +rocketmq: + name-server: 192.168.0.52:9876 + #name-server: localhost:9876 + producer: + group: gkhy-safeplatform-test-ZIS + sendMessageTimeout: 300000 + consumers: + #group: gkhy-safeplatform-dev-s + CreateGroup: gkhy-safeplatform-CreateConsumer-ZIS + NoticeGroup: gkhy-safeplatform-NoticeConsumer-ZIS + TimeOutGroup: gkhy-safeplatform-TimeOutConsumer-ZIS + WaitWorkGroup: gkhy-safeplatform-WaitWorkConsumer-ZIS + applySpecialWorkGroup: gkhy-safeplatform-applySpecialWorkConsumer-ZIS + approvalSpecialWorkGroup: gkhy-safeplatform-topic-approvalSpecialWorkConsumer-ZIS + topic: + #demoTopic: gkhy-safeplatform-topic-demo-s + preventCreateTaskTopic: gkhy-safeplatform-topic-preventCreateTask-ZIS + preventNoticeTaskTopic: gkhy-safeplatform-topic-preventNoticeTask-ZIS + preventTimeOutTaskTopic: gkhy-safeplatform-topic-preventTimeOutTask-ZIS + preventWaitWorkTopic: gkhy-safeplatform-topic-preventWaitWork-ZIS + applySpecialWorkTopic: gkhy-safeplatform-topic-applySpecialWork-ZIS + approvalSpecialWorkTopic: gkhy-safeplatform-topic-approvalSpecialWork-ZIS diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..a97433d --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,88 @@ +# mysql 多数据源 +spring: + application: + # 环境 dev|prod|online + profiles: + active: dev +# active: prod +# active: test +# active: online +# active: test-local + + #redis + redis: + database: 0 + host: 10.187.1.202 + port: 6379 + password: ZhongtaiRedis@103 + redisson: + pool: + max-active: 12 + min-idle: 6 + + jedis: + pool: + max-idle: 8 + max-active: 8 + max-wait: -1ms + min-idle: 1 + #security + security: + user: + name: user + password: 123 + roles: admin + # jackson config + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + default-property-inclusion: NON_NULL + #上传文件大小 + servlet: + multipart: + max-file-size: 500MB + max-request-size: 500MB + thymeleaf: + cache: false +#mybatis: +# mapper-locations: classpath*:com/gk/firework/Mapper/mybatis/*.xml +# type-aliases-package: com.gk.firework.Domain + +#mybatis 多数据源 +mybatis-plus: +# mapper-locations: classpath*:com/gk/hotwork/Mapper/mybatis/*.xml,classpath*:com/gk/hotwork/Mapper2/mybatis/*.xml + mapper-locations: classpath*:com/gk/hotwork/**/*.xml + type-aliases-package: com.gk.hotwork.Domain + type-enums-package: com.gk.hotwork.Domain.Enum + +#线程池配置 +threadPool: + corePoolSize: 20 + maxPoolSize: 20 + queueCapacity: 10000 + +logging: + level: + com.gk.hotwork: info + com.gk.hotwork.Mapper: error + org.springframework: error + org.apache.rocketmq: error + +location: + port: 1666 + + +#sendwarnurl-nms: http://sinanoaq.com/daping/sendWarnInfo.json + +#定义入库、出库、销售分表 +slice: _slice1 + +workname: 特殊作业 + +workCode: TS + +locationUrl: http://121.239.169.28:8084/ZKYNMS +locationUsername: zkynms +locationPassword: 123456 + + diff --git a/src/main/resources/docxTemplate/workAtHeight.docx b/src/main/resources/docxTemplate/workAtHeight.docx new file mode 100644 index 0000000..ac0f5d3 --- /dev/null +++ b/src/main/resources/docxTemplate/workAtHeight.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workBlindPlatePlugging.docx b/src/main/resources/docxTemplate/workBlindPlatePlugging.docx new file mode 100644 index 0000000..bf67c39 --- /dev/null +++ b/src/main/resources/docxTemplate/workBlindPlatePlugging.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workBrokenCircuit.docx b/src/main/resources/docxTemplate/workBrokenCircuit.docx new file mode 100644 index 0000000..15bba17 --- /dev/null +++ b/src/main/resources/docxTemplate/workBrokenCircuit.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workConfinedSpace.docx b/src/main/resources/docxTemplate/workConfinedSpace.docx new file mode 100644 index 0000000..1f52e67 --- /dev/null +++ b/src/main/resources/docxTemplate/workConfinedSpace.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workGroundBreaking.docx b/src/main/resources/docxTemplate/workGroundBreaking.docx new file mode 100644 index 0000000..e88d8ac --- /dev/null +++ b/src/main/resources/docxTemplate/workGroundBreaking.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workHoisting.docx b/src/main/resources/docxTemplate/workHoisting.docx new file mode 100644 index 0000000..f71d098 --- /dev/null +++ b/src/main/resources/docxTemplate/workHoisting.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workTemporaryPower.docx b/src/main/resources/docxTemplate/workTemporaryPower.docx new file mode 100644 index 0000000..cc76d7c --- /dev/null +++ b/src/main/resources/docxTemplate/workTemporaryPower.docx Binary files differ diff --git a/src/main/resources/docxTemplate/workhot.docx b/src/main/resources/docxTemplate/workhot.docx new file mode 100644 index 0000000..69ef632 --- /dev/null +++ b/src/main/resources/docxTemplate/workhot.docx Binary files differ diff --git a/src/main/resources/error.setting b/src/main/resources/error.setting new file mode 100644 index 0000000..98d2f1e --- /dev/null +++ b/src/main/resources/error.setting @@ -0,0 +1,34 @@ +# ------------------------------------------------------------- +# ----- Setting File with UTF8 ----- +# ----- 错误信息code码 ----- +# ------------------------------------------------------------- + +# 错误代码 +#code_999为自定义异常 + +code_999={} +code_998=登录超时 +code_997=系统异常请稍后重试 +code_996=非ip白名单,没有权限 + +code_401=非授权访问,无效的token +code_402=token 已过期 +code_403=权限不足,访问失败 +code_404=权限不足,非白名单用户 + +code_100=用户不存在 +code_101=验证码错误 +code_102=登录失败请稍后重试 +code_103=密码不正确 +code_104=参数不能为空:[{}] +code_105=参数异常:[{}] +code_106=修改提交记录失败,状态异常 +code_107=操作失败,记录不存在 +code_108=用户名已存在 +code_109=当前账号已停用 +code_110=操作失败,{} +code_112=角色英文名已存在 + + + + diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties new file mode 100644 index 0000000..20ed2e3 --- /dev/null +++ b/src/main/resources/log4j.properties @@ -0,0 +1,17 @@ +# LOG4J +#log4j.rootCategory=INFO,stdout,file +log4j.rootCategory=INFO,file,stdout + +# print console +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n + +# print file +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender +log4j.appender.file.DatePattern='-'yyyy-MM-dd'.log' +log4j.appender.file.File=/data/logs/hazard/hazard.log +#log4j.appender.file.File=${zhongtai}/../../logs/zhongtai/zhongtai.log +#log4j.appender.file.File=E:/logs/zhongtai/zhongtai.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} %p [%c]: %m%n diff --git a/src/main/resources/printTemplate/allworkcert.doc b/src/main/resources/printTemplate/allworkcert.doc new file mode 100644 index 0000000..9cb4a88 --- /dev/null +++ b/src/main/resources/printTemplate/allworkcert.doc Binary files differ diff --git a/src/main/resources/printTemplate/certificatelicense.docx b/src/main/resources/printTemplate/certificatelicense.docx new file mode 100644 index 0000000..734a93f --- /dev/null +++ b/src/main/resources/printTemplate/certificatelicense.docx Binary files differ diff --git a/src/main/resources/printTemplate/certificatelicenseapply.docx b/src/main/resources/printTemplate/certificatelicenseapply.docx new file mode 100644 index 0000000..c6cab18 --- /dev/null +++ b/src/main/resources/printTemplate/certificatelicenseapply.docx Binary files differ -- Gitblit v1.9.2